Bug 1031519 - Use immersive fullscreen when available. r=mcomella
authorTom Klein <twointofive@gmail.com>
Mon, 18 Jul 2016 18:50:47 -0500
changeset 331173 830a8be8be2a90e9730ad61039c06db980eef0cc
parent 331172 4a8156e1267732f57c9013349b6a49688b3857e3
child 331174 92a49962cec316bfb96ad398830119c3648915e6
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1031519
milestone50.0a1
Bug 1031519 - Use immersive fullscreen when available. r=mcomella This is Deepthi Venkitaramanan's patch with feedback comments addressed. MozReview-Commit-ID: 7vs0ZgefOVy
mobile/android/base/java/org/mozilla/gecko/util/ActivityUtils.java
--- a/mobile/android/base/java/org/mozilla/gecko/util/ActivityUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/ActivityUtils.java
@@ -16,20 +16,28 @@ 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.feature16Plus) {
-            final int newVis;
+            int newVis;
             if (fullscreen) {
-                newVis = View.SYSTEM_UI_FLAG_FULLSCREEN |
-                         View.SYSTEM_UI_FLAG_LOW_PROFILE;
+                newVis = View.SYSTEM_UI_FLAG_FULLSCREEN;
+                if (Versions.feature19Plus) {
+                    newVis |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
+                            View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
+                            View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
+                            View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
+                            View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+                } else {
+                    newVis |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
+                }
             } else {
                 newVis = View.SYSTEM_UI_FLAG_VISIBLE;
             }
 
             window.getDecorView().setSystemUiVisibility(newVis);
         } else {
             window.setFlags(fullscreen ?
                             WindowManager.LayoutParams.FLAG_FULLSCREEN : 0,