Merge "Fix stuck IME when IME dialog is focused" into rvc-dev am: a13d349172
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12174528 Change-Id: I827451241c4fec6c848b6ce43cea3f9df7dcd618
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user