Loading services/core/java/com/android/server/wm/DisplayContent.java +5 −2 Original line number Diff line number Diff line Loading @@ -3271,8 +3271,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // Attach it to app if the target is part of an app and such app is covering the entire // screen. If it's not covering the entire screen the IME might extend beyond the apps // bounds. if (mInputMethodTarget != null && mInputMethodTarget.mAppToken != null && mInputMethodTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN) { if (mInputMethodTarget != null && mInputMethodTarget.mAppToken != null && mInputMethodTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN // An activity with override bounds should be letterboxed inside its parent bounds, // so it doesn't fill the screen. && mInputMethodTarget.mAppToken.matchParentBounds()) { return mInputMethodTarget.mAppToken.getSurfaceControl(); } Loading services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +11 −1 Original line number Diff line number Diff line Loading @@ -34,11 +34,12 @@ import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION; import static com.android.dx.mockito.inline.extended.ExtendedMockito.any; import static com.android.dx.mockito.inline.extended.ExtendedMockito.anyBoolean; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing; import static com.android.dx.mockito.inline.extended.ExtendedMockito.eq; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; import static com.android.dx.mockito.inline.extended.ExtendedMockito.never; import static com.android.dx.mockito.inline.extended.ExtendedMockito.same; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spy; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.times; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; import static com.android.server.wm.WindowContainer.POSITION_TOP; Loading Loading @@ -662,6 +663,15 @@ public class DisplayContentTests extends WindowTestsBase { } } @Test public void testComputeImeParent_app_notMatchParentBounds() { spyOn(mAppWindow.mAppToken); doReturn(false).when(mAppWindow.mAppToken).matchParentBounds(); mDisplayContent.mInputMethodTarget = mAppWindow; // The surface parent of IME should be the display instead of app window. assertEquals(mDisplayContent.getWindowingLayer(), mDisplayContent.computeImeParent()); } @Test public void testComputeImeParent_noApp() throws Exception { try (final InsetsModeSession session = Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +5 −2 Original line number Diff line number Diff line Loading @@ -3271,8 +3271,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // Attach it to app if the target is part of an app and such app is covering the entire // screen. If it's not covering the entire screen the IME might extend beyond the apps // bounds. if (mInputMethodTarget != null && mInputMethodTarget.mAppToken != null && mInputMethodTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN) { if (mInputMethodTarget != null && mInputMethodTarget.mAppToken != null && mInputMethodTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN // An activity with override bounds should be letterboxed inside its parent bounds, // so it doesn't fill the screen. && mInputMethodTarget.mAppToken.matchParentBounds()) { return mInputMethodTarget.mAppToken.getSurfaceControl(); } Loading
services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +11 −1 Original line number Diff line number Diff line Loading @@ -34,11 +34,12 @@ import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION; import static com.android.dx.mockito.inline.extended.ExtendedMockito.any; import static com.android.dx.mockito.inline.extended.ExtendedMockito.anyBoolean; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing; import static com.android.dx.mockito.inline.extended.ExtendedMockito.eq; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; import static com.android.dx.mockito.inline.extended.ExtendedMockito.never; import static com.android.dx.mockito.inline.extended.ExtendedMockito.same; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spy; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.times; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; import static com.android.server.wm.WindowContainer.POSITION_TOP; Loading Loading @@ -662,6 +663,15 @@ public class DisplayContentTests extends WindowTestsBase { } } @Test public void testComputeImeParent_app_notMatchParentBounds() { spyOn(mAppWindow.mAppToken); doReturn(false).when(mAppWindow.mAppToken).matchParentBounds(); mDisplayContent.mInputMethodTarget = mAppWindow; // The surface parent of IME should be the display instead of app window. assertEquals(mDisplayContent.getWindowingLayer(), mDisplayContent.computeImeParent()); } @Test public void testComputeImeParent_noApp() throws Exception { try (final InsetsModeSession session = Loading