Loading services/core/java/com/android/server/wm/WindowState.java +2 −1 Original line number Diff line number Diff line Loading @@ -4927,7 +4927,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // animation on the keyguard but seeing the IME window that originally on the app // which behinds the keyguard. final WindowState imeInputTarget = getImeInputTarget(); if (imeInputTarget != null && !(imeInputTarget.isDrawn() || imeInputTarget.isVisible())) { if (imeInputTarget != null && !(imeInputTarget.isDrawn() || imeInputTarget.isVisibleRequested())) { return false; } return mDisplayContent.forAllImeWindows(callback, traverseTopToBottom); Loading services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java +38 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,44 @@ public class InsetsStateControllerTest extends WindowTestsBase { verify(navBar, atLeastOnce()).notifyInsetsChanged(); } @Test public void testUpdateAboveInsetsState_imeTargetOnScreenBehavior() { final WindowToken imeToken = createTestWindowToken(TYPE_INPUT_METHOD, mDisplayContent); final WindowState ime = createWindow(null, TYPE_INPUT_METHOD, imeToken, "ime"); final WindowState app = createTestWindow("app"); getController().getSourceProvider(ITYPE_IME).setWindowContainer(ime, null, null); ime.getControllableInsetProvider().setServerVisible(true); app.mActivityRecord.setVisibility(true); mDisplayContent.setImeLayeringTarget(app); mDisplayContent.updateImeInputAndControlTarget(app); app.setRequestedVisibleTypes(ime(), ime()); getController().onInsetsModified(app); assertTrue(ime.getControllableInsetProvider().getSource().isVisible()); getController().updateAboveInsetsState(true /* notifyInsetsChange */); assertNotNull(app.getInsetsState().peekSource(ITYPE_IME)); verify(app, atLeastOnce()).notifyInsetsChanged(); // Expect the app will still get IME insets even when the app was invisible. // (i.e. app invisible after locking the device) app.mActivityRecord.setVisible(false); app.setHasSurface(false); getController().updateAboveInsetsState(true /* notifyInsetsChange */); assertNotNull(app.getInsetsState().peekSource(ITYPE_IME)); verify(app, atLeastOnce()).notifyInsetsChanged(); // Expect the app will get IME insets when the app is requesting visible. // (i.e. app is going to visible when unlocking the device) app.mActivityRecord.setVisibility(true); assertTrue(app.isVisibleRequested()); getController().updateAboveInsetsState(true /* notifyInsetsChange */); assertNotNull(app.getInsetsState().peekSource(ITYPE_IME)); verify(app, atLeastOnce()).notifyInsetsChanged(); } @Test public void testDispatchGlobalInsets() { final WindowState navBar = createWindow(null, TYPE_APPLICATION, "navBar"); Loading services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -772,6 +772,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase { // Simulating now win1 is being covered by the lockscreen which has no surface, // and then launching an activity win2 with the remote animation win1.mHasSurface = false; win1.mActivityRecord.setVisibility(false); mDisplayContent.mOpeningApps.add(win2.mActivityRecord); final AnimationAdapter adapter = mController.createRemoteAnimationRecord( win2.mActivityRecord, new Point(50, 100), null, Loading Loading
services/core/java/com/android/server/wm/WindowState.java +2 −1 Original line number Diff line number Diff line Loading @@ -4927,7 +4927,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // animation on the keyguard but seeing the IME window that originally on the app // which behinds the keyguard. final WindowState imeInputTarget = getImeInputTarget(); if (imeInputTarget != null && !(imeInputTarget.isDrawn() || imeInputTarget.isVisible())) { if (imeInputTarget != null && !(imeInputTarget.isDrawn() || imeInputTarget.isVisibleRequested())) { return false; } return mDisplayContent.forAllImeWindows(callback, traverseTopToBottom); Loading
services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java +38 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,44 @@ public class InsetsStateControllerTest extends WindowTestsBase { verify(navBar, atLeastOnce()).notifyInsetsChanged(); } @Test public void testUpdateAboveInsetsState_imeTargetOnScreenBehavior() { final WindowToken imeToken = createTestWindowToken(TYPE_INPUT_METHOD, mDisplayContent); final WindowState ime = createWindow(null, TYPE_INPUT_METHOD, imeToken, "ime"); final WindowState app = createTestWindow("app"); getController().getSourceProvider(ITYPE_IME).setWindowContainer(ime, null, null); ime.getControllableInsetProvider().setServerVisible(true); app.mActivityRecord.setVisibility(true); mDisplayContent.setImeLayeringTarget(app); mDisplayContent.updateImeInputAndControlTarget(app); app.setRequestedVisibleTypes(ime(), ime()); getController().onInsetsModified(app); assertTrue(ime.getControllableInsetProvider().getSource().isVisible()); getController().updateAboveInsetsState(true /* notifyInsetsChange */); assertNotNull(app.getInsetsState().peekSource(ITYPE_IME)); verify(app, atLeastOnce()).notifyInsetsChanged(); // Expect the app will still get IME insets even when the app was invisible. // (i.e. app invisible after locking the device) app.mActivityRecord.setVisible(false); app.setHasSurface(false); getController().updateAboveInsetsState(true /* notifyInsetsChange */); assertNotNull(app.getInsetsState().peekSource(ITYPE_IME)); verify(app, atLeastOnce()).notifyInsetsChanged(); // Expect the app will get IME insets when the app is requesting visible. // (i.e. app is going to visible when unlocking the device) app.mActivityRecord.setVisibility(true); assertTrue(app.isVisibleRequested()); getController().updateAboveInsetsState(true /* notifyInsetsChange */); assertNotNull(app.getInsetsState().peekSource(ITYPE_IME)); verify(app, atLeastOnce()).notifyInsetsChanged(); } @Test public void testDispatchGlobalInsets() { final WindowState navBar = createWindow(null, TYPE_APPLICATION, "navBar"); Loading
services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -772,6 +772,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase { // Simulating now win1 is being covered by the lockscreen which has no surface, // and then launching an activity win2 with the remote animation win1.mHasSurface = false; win1.mActivityRecord.setVisibility(false); mDisplayContent.mOpeningApps.add(win2.mActivityRecord); final AnimationAdapter adapter = mController.createRemoteAnimationRecord( win2.mActivityRecord, new Point(50, 100), null, Loading