From 1f778d59982e583f3bf7b89ccbcf7992eaaaced1 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Fri, 9 Mar 2018 16:59:29 +0100 Subject: [PATCH] Multi cutout: Fix IME navigation guard Ensures that the IME window always extends all the way to the bottom. This is fine because in its decor view the navigation bar inset is consumed by the navigation guard. Bug: 74195186 Test: Enable multi-cutout; open a text field over non-black navigation bar. Verify entire bar turns black. Change-Id: Iff142ccd2034684c37e140e4ccd1839691dbf443 --- .../java/com/android/server/policy/PhoneWindowManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 5b23ad8496003..dda25bb49b362 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -4984,8 +4984,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { df.set(displayFrames.mDock); pf.set(displayFrames.mDock); // IM dock windows layout below the nav bar... - pf.bottom = df.bottom = of.bottom = Math.min(displayFrames.mUnrestricted.bottom, - displayFrames.mDisplayCutoutSafe.bottom); + pf.bottom = df.bottom = of.bottom = displayFrames.mUnrestricted.bottom; // ...with content insets above the nav bar cf.bottom = vf.bottom = displayFrames.mStable.bottom; if (mStatusBar != null && mFocusedWindow == mStatusBar && canReceiveInput(mStatusBar)) { @@ -5324,6 +5323,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { break; } } + if (type == TYPE_INPUT_METHOD && mNavigationBarPosition == NAV_BAR_BOTTOM) { + // The IME can always extend under the bottom cutout if the navbar is there. + displayCutoutSafeExceptMaybeBars.bottom = Integer.MAX_VALUE; + } // Windows that are attached to a parent and laid out in said parent are already // avoidingthe cutout according to that parent and don't need to be further constrained. if (!attachedInParent) {