Bug 1031519 - Use immersive fullscreen when available. r=mcomella
authorTom Klein <twointofive@gmail.com>
Mon, 18 Jul 2016 18:50:47 -0500
changeset 306109 830a8be8be2a90e9730ad61039c06db980eef0cc
parent 306108 4a8156e1267732f57c9013349b6a49688b3857e3
child 306110 92a49962cec316bfb96ad398830119c3648915e6
push id30478
push usercbook@mozilla.com
push dateFri, 22 Jul 2016 09:54:14 +0000
treeherdermozilla-central@35921a0c3857 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1031519
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,