[Android] Code cleaning

Geoffrey Métais git at videolan.org
Mon Feb 11 15:11:16 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 11 14:10:54 2019 +0100| [480d1419902eda0d7ff3fdf77f790ab76aba7ea6] | committer: Geoffrey Métais

Code cleaning

> https://code.videolan.org/videolan/vlc-android/commit/480d1419902eda0d7ff3fdf77f790ab76aba7ea6
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java    | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 70e38fc28..e388fb5c4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2653,17 +2653,9 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
         }
     }
 
-    @SuppressWarnings("deprecation")
     private int getScreenRotation(){
         final WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
-        if (wm == null) return Surface.ROTATION_0;
-        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;
-        }
+        return wm == null ? Surface.ROTATION_0 : wm.getDefaultDisplay().getRotation();
     }
 
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)



More information about the Android mailing list