Loading services/core/java/com/android/server/wm/WindowState.java +3 −1 Original line number Diff line number Diff line Loading @@ -884,7 +884,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, Loading services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +9 −0 Original line number Diff line number Diff line Loading @@ -927,6 +927,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}) Loading Loading
services/core/java/com/android/server/wm/WindowState.java +3 −1 Original line number Diff line number Diff line Loading @@ -884,7 +884,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, Loading
services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +9 −0 Original line number Diff line number Diff line Loading @@ -927,6 +927,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}) Loading