OSDN Git Service

Multi cutout: Fix IME navigation guard
authorAdrian Roos <roosa@google.com>
Fri, 9 Mar 2018 15:59:29 +0000 (16:59 +0100)
committerAdrian Roos <roosa@google.com>
Mon, 12 Mar 2018 17:29:38 +0000 (17:29 +0000)
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

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

index 5b23ad8..dda25bb 100644 (file)
@@ -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) {