Bug 1391160 - Remember SYSTEM_UI_FLAG_LIGHT_STATUS_BAR when show/hide fullscreen. r?nechen,sebastian,walkingice draft
authorJing-wei Wu <topwu.tw@gmail.com>
Thu, 17 Aug 2017 14:55:19 +0800
changeset 648116 0a1b4859f8623910fd6e50c03d39b494af4a5f55
parent 648115 09f43f35fdbeaf0485dffc45ff62ea077f5e1e97
child 648117 97da3b8038d2fbd7dd273688bf1ca8192868cccc
push id74628
push userbmo:topwu.tw@gmail.com
push dateThu, 17 Aug 2017 08:32:13 +0000
reviewersnechen, sebastian, walkingice
bugs1391160
milestone57.0a1
Bug 1391160 - Remember SYSTEM_UI_FLAG_LIGHT_STATUS_BAR when show/hide fullscreen. r?nechen,sebastian,walkingice Keep the value of SYSTEM_UI_FLAG_LIGHT_STATUS_BAR in window system ui status when show/hide fullscreen. MozReview-Commit-ID: CnOsCFKuN65
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
@@ -34,16 +34,23 @@ public class ActivityUtils {
                             View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
                 } else {
                     newVis |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
                 }
             } else {
                 newVis = View.SYSTEM_UI_FLAG_VISIBLE;
             }
 
+            if (Build.VERSION.SDK_INT >= 23) {
+                // We also have to set SYSTEM_UI_FLAG_LIGHT_STATUS_BAR with to current system ui status
+                // to support both light and dark status bar.
+                final int oldVis = window.getDecorView().getSystemUiVisibility();
+                newVis |= (oldVis & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+            }
+
             window.getDecorView().setSystemUiVisibility(newVis);
         } else {
             window.setFlags(fullscreen ?
                             WindowManager.LayoutParams.FLAG_FULLSCREEN : 0,
                             WindowManager.LayoutParams.FLAG_FULLSCREEN);
         }
     }