Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97c5a858 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DisplayCutout: Fix positioning of NO_LIMITS windows"

parents c1be09f1 eb3697c1
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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
@@ -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);
+10 −0
Original line number Diff line number Diff line
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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);
    }


@@ -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
@@ -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