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

Commit 24670018 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Do not set insets changed for invisible window" into tm-dev am:...

Merge "Do not set insets changed for invisible window" into tm-dev am: e79e811a am: 40b4671c am: 821776d7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18912001



Change-Id: Ie05231b2e1a283b63ddf9d96a29976de9d068ba9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents edb922d1 821776d7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -879,7 +879,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     * {@link InsetsStateController#notifyInsetsChanged}.
     */
    boolean isReadyToDispatchInsetsState() {
        return isVisibleRequested() && mFrozenInsetsState == null;
        final boolean visible = shouldCheckTokenVisibleRequested()
                ? isVisibleRequested() : isVisible();
        return visible && mFrozenInsetsState == null;
    }

    void seamlesslyRotateIfAllowed(Transaction transaction, @Rotation int oldRotation,
+9 −0
Original line number Diff line number Diff line
@@ -935,6 +935,15 @@ public class WindowStateTests extends WindowTestsBase {
        assertTrue(app.isReadyToDispatchInsetsState());
        mDisplayContent.getInsetsStateController().notifyInsetsChanged();
        verify(app).notifyInsetsChanged();

        // Verify that invisible non-activity window won't dispatch insets changed.
        final WindowState overlay = createWindow(null, TYPE_APPLICATION_OVERLAY, "overlay");
        makeWindowVisible(overlay);
        assertTrue(overlay.isReadyToDispatchInsetsState());
        overlay.mHasSurface = false;
        assertFalse(overlay.isReadyToDispatchInsetsState());
        mDisplayContent.getInsetsStateController().notifyInsetsChanged();
        assertFalse(overlay.getWindowFrames().hasInsetsChanged());
    }

    @UseTestDisplay(addWindows = {W_INPUT_METHOD, W_ACTIVITY})