diff options
3 files changed, 22 insertions, 6 deletions
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 1b759a33de56..eebcd845f61a 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -274,11 +274,18 @@ public interface WindowManagerPolicy { * Get the layer at which this window's surface will be Z-ordered. */ public int getSurfaceLayer(); - + /** - * Return the token for the application (actually activity) that owns - * this window. May return null for system windows. - * + * Retrieve the type of the top-level window. + * + * @return the base type of the parent window if attached or its own type otherwise + */ + public int getBaseType(); + + /** + * Return the token for the application (actually activity) that owns + * this window. May return null for system windows. + * * @return An IApplicationToken identifying the owning activity. */ public IApplicationToken getAppToken(); diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 17368aade9a7..f94c77b08d8b 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -6386,8 +6386,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { immersiveSticky = (vis & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0; final boolean navAllowedHidden = immersive || immersiveSticky; - if (!navAllowedHidden - && windowTypeToLayerLw(type) > windowTypeToLayerLw(TYPE_INPUT_CONSUMER)) { + if (hideNavBarSysui && !navAllowedHidden && windowTypeToLayerLw(win.getBaseType()) + > 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); diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index ad2546296e39..193d8120d79e 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -781,6 +781,15 @@ final class WindowState implements WindowManagerPolicy.WindowState { } @Override + public int getBaseType() { + WindowState win = this; + while (win.mAttachedWindow != null) { + win = win.mAttachedWindow; + } + return win.mAttrs.type; + } + + @Override public IApplicationToken getAppToken() { return mAppToken != null ? mAppToken.appToken : null; } |