Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +9 −4 Original line number Diff line number Diff line Loading @@ -5244,9 +5244,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { final boolean attachedInParent = attached != null && !layoutInScreen; // Ensure that windows with a DEFAULT or NEVER display cutout mode are laid out in // the cutout safe zone. // Windows that are attached to a parent and laid out in said parent are already avoiding // the cutout according to that parent and don't need to be further constrained. if (cutoutMode != LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS && !attachedInParent) { if (cutoutMode != LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS) { final Rect displayCutoutSafeExceptMaybeTop = mTmpRect; displayCutoutSafeExceptMaybeTop.set(displayFrames.mDisplayCutoutSafe); if (layoutInScreen && layoutInsetDecor && !requestedFullscreen Loading @@ -5257,8 +5255,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { // the window from that area. displayCutoutSafeExceptMaybeTop.top = Integer.MIN_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) { pf.intersectUnchecked(displayCutoutSafeExceptMaybeTop); } // Make sure that NO_LIMITS windows clipped to the display don't extend into the display // don't extend under the cutout. df.intersectUnchecked(displayCutoutSafeExceptMaybeTop); } // Content should never appear in the cutout. cf.intersectUnchecked(displayFrames.mDisplayCutoutSafe); Loading services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetBy(mAppWindow.displayFrame, 0, 0, 0, 0); } @Test Loading @@ -91,6 +92,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.displayFrame, 0, NAV_BAR_HEIGHT); } @Test Loading @@ -106,6 +108,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.displayFrame, 0, NAV_BAR_HEIGHT); } @Test Loading @@ -130,6 +133,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, 0, 0); } @Test Loading @@ -146,6 +150,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, STATUS_BAR_HEIGHT, 0); } @Test Loading @@ -162,6 +167,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetBy(mAppWindow.displayFrame, 0, 0, 0, 0); } @Test Loading @@ -178,6 +184,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, STATUS_BAR_HEIGHT, 0); } @Test Loading @@ -195,6 +202,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, 0, 0); } Loading @@ -212,6 +220,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetBy(mAppWindow.contentFrame, DISPLAY_CUTOUT_HEIGHT, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); assertInsetBy(mAppWindow.decorFrame, 0, 0, 0, 0); assertInsetBy(mAppWindow.displayFrame, DISPLAY_CUTOUT_HEIGHT, 0, 0, 0); } @Test Loading @@ -228,6 +237,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetBy(mAppWindow.contentFrame, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, DISPLAY_CUTOUT_HEIGHT, 0); assertInsetBy(mAppWindow.decorFrame, 0, 0, 0, 0); assertInsetBy(mAppWindow.displayFrame, 0, 0, DISPLAY_CUTOUT_HEIGHT, 0); } @Test Loading Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +9 −4 Original line number Diff line number Diff line Loading @@ -5244,9 +5244,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { final boolean attachedInParent = attached != null && !layoutInScreen; // Ensure that windows with a DEFAULT or NEVER display cutout mode are laid out in // the cutout safe zone. // Windows that are attached to a parent and laid out in said parent are already avoiding // the cutout according to that parent and don't need to be further constrained. if (cutoutMode != LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS && !attachedInParent) { if (cutoutMode != LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS) { final Rect displayCutoutSafeExceptMaybeTop = mTmpRect; displayCutoutSafeExceptMaybeTop.set(displayFrames.mDisplayCutoutSafe); if (layoutInScreen && layoutInsetDecor && !requestedFullscreen Loading @@ -5257,8 +5255,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { // the window from that area. displayCutoutSafeExceptMaybeTop.top = Integer.MIN_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) { pf.intersectUnchecked(displayCutoutSafeExceptMaybeTop); } // Make sure that NO_LIMITS windows clipped to the display don't extend into the display // don't extend under the cutout. df.intersectUnchecked(displayCutoutSafeExceptMaybeTop); } // Content should never appear in the cutout. cf.intersectUnchecked(displayFrames.mDisplayCutoutSafe); Loading
services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetBy(mAppWindow.displayFrame, 0, 0, 0, 0); } @Test Loading @@ -91,6 +92,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.displayFrame, 0, NAV_BAR_HEIGHT); } @Test Loading @@ -106,6 +108,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.displayFrame, 0, NAV_BAR_HEIGHT); } @Test Loading @@ -130,6 +133,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, 0, 0); } @Test Loading @@ -146,6 +150,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, STATUS_BAR_HEIGHT, 0); } @Test Loading @@ -162,6 +167,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetBy(mAppWindow.displayFrame, 0, 0, 0, 0); } @Test Loading @@ -178,6 +184,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, STATUS_BAR_HEIGHT, 0); } @Test Loading @@ -195,6 +202,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetByTopBottom(mAppWindow.stableFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.contentFrame, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT); assertInsetByTopBottom(mAppWindow.decorFrame, 0, 0); assertInsetByTopBottom(mAppWindow.displayFrame, 0, 0); } Loading @@ -212,6 +220,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetBy(mAppWindow.contentFrame, DISPLAY_CUTOUT_HEIGHT, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); assertInsetBy(mAppWindow.decorFrame, 0, 0, 0, 0); assertInsetBy(mAppWindow.displayFrame, DISPLAY_CUTOUT_HEIGHT, 0, 0, 0); } @Test Loading @@ -228,6 +237,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { assertInsetBy(mAppWindow.contentFrame, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, DISPLAY_CUTOUT_HEIGHT, 0); assertInsetBy(mAppWindow.decorFrame, 0, 0, 0, 0); assertInsetBy(mAppWindow.displayFrame, 0, 0, DISPLAY_CUTOUT_HEIGHT, 0); } @Test Loading