Bug 1135796 - Update ActivityUtils to use proper API levels. r=rnewman, a=lsblakk
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 26 Feb 2015 10:47:14 -0800
changeset 250095 7ede0abc5a1c
parent 250094 432de8008403
child 250096 2aa1ca037446
push id4501
push userryanvm@gmail.com
push date2015-02-27 20:57 +0000
treeherdermozilla-beta@2aa1ca037446 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, lsblakk
bugs1135796
milestone37.0
Bug 1135796 - Update ActivityUtils to use proper API levels. r=rnewman, a=lsblakk Fullscreen with the modern flags requires 4.1+ now; 4.0- is using the old flags.
mobile/android/base/util/ActivityUtils.java
--- a/mobile/android/base/util/ActivityUtils.java
+++ b/mobile/android/base/util/ActivityUtils.java
@@ -15,17 +15,17 @@ import org.mozilla.gecko.AppConstants.Ve
 public class ActivityUtils {
     private ActivityUtils() {
     }
 
     public static void setFullScreen(Activity activity, boolean fullscreen) {
         // Hide/show the system notification bar
         Window window = activity.getWindow();
 
-        if (Versions.feature11Plus) {
+        if (Versions.feature16Plus) {
             final int newVis;
             if (fullscreen) {
                 newVis = View.SYSTEM_UI_FLAG_FULLSCREEN |
                          View.SYSTEM_UI_FLAG_LOW_PROFILE;
             } else {
                 newVis = View.SYSTEM_UI_FLAG_VISIBLE;
             }
 
@@ -35,17 +35,17 @@ public class ActivityUtils {
                             WindowManager.LayoutParams.FLAG_FULLSCREEN : 0,
                             WindowManager.LayoutParams.FLAG_FULLSCREEN);
         }
     }
 
     public static boolean isFullScreen(final Activity activity) {
         final Window window = activity.getWindow();
 
-        if (Versions.feature11Plus) {
+        if (Versions.feature16Plus) {
             final int vis = window.getDecorView().getSystemUiVisibility();
             return (vis & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0;
-        } else {
-            final int flags = window.getAttributes().flags;
-            return ((flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0);
         }
+
+        final int flags = window.getAttributes().flags;
+        return ((flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0);
     }
 }