OSDN Git Service

Protecting against the correct flag for the input consumer
authorSelim Cinek <cinek@google.com>
Thu, 21 May 2015 05:48:40 +0000 (22:48 -0700)
committerSelim Cinek <cinek@google.com>
Thu, 21 May 2015 18:49:27 +0000 (18:49 +0000)
Also allow hiding the navbar if immersive or immersivesticky.

Bug: 21089476
Change-Id: I540e668746056a0e4bb077898792afd225e4e19e

services/core/java/com/android/server/policy/PhoneWindowManager.java

index 9bb5e40..7d14d47 100644 (file)
@@ -6320,11 +6320,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
             }
             vis = (vis & ~flags) | (oldVis & flags);
         }
-        if (windowTypeToLayerLw(type) > windowTypeToLayerLw(TYPE_INPUT_CONSUMER)) {
-            // We can't get into fullscreen from this window otherwise the consumer would not get
-            // the input events.
-            vis = (vis & ~View.SYSTEM_UI_FLAG_FULLSCREEN);
-        }
 
         if (!areTranslucentBarsAllowed() && transWin != mStatusBar) {
             vis &= ~(View.NAVIGATION_BAR_TRANSLUCENT | View.STATUS_BAR_TRANSLUCENT
@@ -6363,6 +6358,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
             vis &= ~View.SYSTEM_UI_CLEARABLE_FLAGS;
         }
 
+        final boolean immersive = (vis & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0;
+        immersiveSticky = (vis & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0;
+        final boolean navAllowedHidden = immersive || immersiveSticky;
+
+        if (!navAllowedHidden
+                && windowTypeToLayerLw(type) > windowTypeToLayerLw(TYPE_INPUT_CONSUMER)) {
+            // We can't hide the navbar from this window otherwise the input consumer would not get
+            // the input events.
+            vis = (vis & ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
+        }
+
         vis = mStatusBarController.updateVisibilityLw(transientStatusBarAllowed, oldVis, vis);
 
         // update navigation bar