Commit 480d1419 authored by Geoffrey Métais's avatar Geoffrey Métais

Code cleaning

parent 225fffa6
...@@ -2653,17 +2653,9 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS ...@@ -2653,17 +2653,9 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
} }
} }
@SuppressWarnings("deprecation")
private int getScreenRotation(){ private int getScreenRotation(){
final WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); final WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
if (wm == null) return Surface.ROTATION_0; return wm == null ? Surface.ROTATION_0 : wm.getDefaultDisplay().getRotation();
final Display display = wm.getDefaultDisplay();
try {
final Method m = display.getClass().getDeclaredMethod("getRotation");
return (Integer) m.invoke(display);
} catch (Exception e) {
return Surface.ROTATION_0;
}
} }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment