Loading services/core/java/com/android/server/wm/WindowState.java +3 −0 Original line number Diff line number Diff line Loading @@ -2170,6 +2170,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (isInputMethodTarget()) { dc.computeImeTarget(true /* updateImeTarget */); } if (dc.mInputMethodInputTarget == this) { dc.setInputMethodInputTarget(null); } if (dc.mInputMethodControlTarget == this) { dc.updateImeControlTarget(); } Loading services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +15 −0 Original line number Diff line number Diff line Loading @@ -889,6 +889,21 @@ public class DisplayContentTests extends WindowTestsBase { assertEquals(dc.getImeContainer().getParentSurfaceControl(), dc.computeImeParent()); } @Test public void testInputMethodInputTarget_isClearedWhenWindowStateIsRemoved() throws Exception { final DisplayContent dc = createNewDisplay(); WindowState app = createWindow(null, TYPE_BASE_APPLICATION, dc, "app"); dc.mInputMethodInputTarget = app; assertEquals(app, dc.computeImeControlTarget()); app.removeImmediately(); assertNull(dc.mInputMethodInputTarget); assertNull(dc.computeImeControlTarget()); } @Test public void testComputeImeControlTarget() throws Exception { final DisplayContent dc = createNewDisplay(); Loading Loading
services/core/java/com/android/server/wm/WindowState.java +3 −0 Original line number Diff line number Diff line Loading @@ -2170,6 +2170,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (isInputMethodTarget()) { dc.computeImeTarget(true /* updateImeTarget */); } if (dc.mInputMethodInputTarget == this) { dc.setInputMethodInputTarget(null); } if (dc.mInputMethodControlTarget == this) { dc.updateImeControlTarget(); } Loading
services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +15 −0 Original line number Diff line number Diff line Loading @@ -889,6 +889,21 @@ public class DisplayContentTests extends WindowTestsBase { assertEquals(dc.getImeContainer().getParentSurfaceControl(), dc.computeImeParent()); } @Test public void testInputMethodInputTarget_isClearedWhenWindowStateIsRemoved() throws Exception { final DisplayContent dc = createNewDisplay(); WindowState app = createWindow(null, TYPE_BASE_APPLICATION, dc, "app"); dc.mInputMethodInputTarget = app; assertEquals(app, dc.computeImeControlTarget()); app.removeImmediately(); assertNull(dc.mInputMethodInputTarget); assertNull(dc.computeImeControlTarget()); } @Test public void testComputeImeControlTarget() throws Exception { final DisplayContent dc = createNewDisplay(); Loading