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

Commit 125834e2 authored by Taran Singh's avatar Taran Singh
Browse files

Remove Ink window when IME is switched.

In [1] we started removing InkWindow from WM when Stylus
handwriting is inactive. This is a followup that handles a
special case of IME switch. If IME is switched before we remove the
invisible InkWindow, WindowManager will continue to hold a reference
to an orphan ink window.

This CL explicitly removes any Ink window when switching away from
stylus handwriting capable IME.

[1]: I3b2e7c8271dd60b189d30a226a9483fb3c5cdcd9

Fix: 300546382
Test: atest StylusHandwritingTest and manually verify that there are
no orphan windows in "adb shell dumpsys window windows" after switching
from Stylus handwriting capable IME.

Change-Id: Id222485735dab286b0a28650462ea5c239cdcfdf
parent db9f9d76
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3387,6 +3387,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        }

        // Changing to a different IME.
        IInputMethodInvoker curMethod = getCurMethodLocked();
        if (curMethod != null) {
            curMethod.removeStylusHandwritingWindow();
        }
        final long ident = Binder.clearCallingIdentity();
        try {
            // Set a subtype to this input method.