Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1dbd377 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix stuck IME when IME dialog is focused" into rvc-dev am: a13d3491...

Merge "Fix stuck IME when IME dialog is focused" into rvc-dev am: a13d3491 am: bf2c10fe am: 41226238 am: 0615cb38

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12174528

Change-Id: I6ef092675dede5dcecd690646b2b5172fe11551f
parents 40350de4 0615cb38
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2191,6 +2191,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (isInputMethodTarget()) {
        if (isInputMethodTarget()) {
            dc.computeImeTarget(true /* updateImeTarget */);
            dc.computeImeTarget(true /* updateImeTarget */);
        }
        }
        if (dc.mInputMethodInputTarget == this) {
            dc.setInputMethodInputTarget(null);
        }
        if (dc.mInputMethodControlTarget == this) {
        if (dc.mInputMethodControlTarget == this) {
            dc.updateImeControlTarget();
            dc.updateImeControlTarget();
        }
        }
+15 −0
Original line number Original line Diff line number Diff line
@@ -949,6 +949,21 @@ public class DisplayContentTests extends WindowTestsBase {
        assertEquals(dc.getImeContainer().getParentSurfaceControl(), dc.computeImeParent());
        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
    @Test
    public void testComputeImeControlTarget() throws Exception {
    public void testComputeImeControlTarget() throws Exception {
        final DisplayContent dc = createNewDisplay();
        final DisplayContent dc = createNewDisplay();