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

Commit 93c00cea authored by Tarandeep Singh's avatar Tarandeep Singh
Browse files

Unbind InputMethod when app crashes

If a running app (with bound InputMethod) crashes, the currently running InputMethod is not
unbound. As a result, onBindInput is not called.
In order to fix this, IMMS.removeClient() should also unbind the current client and clear
the flag IMMS.mBoundToMethod.
With the fix, I haven't seen any test failures mentioned in bug.

Bug: 72399950
Fixes: 73274813
Test: atest InputMethodServiceLifecycleTest && atest FocusHandlingTest
Change-Id: I0c09381b43a8b96480976edafbc0b0ee40ae5de0
parent 1d84b173
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -1706,6 +1706,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            if (cs != null) {
            if (cs != null) {
                clearClientSessionLocked(cs);
                clearClientSessionLocked(cs);
                if (mCurClient == cs) {
                if (mCurClient == cs) {
                    if (mBoundToMethod) {
                        mBoundToMethod = false;
                        if (mCurMethod != null) {
                            executeOrSendMessage(mCurMethod, mCaller.obtainMessageO(
                                    MSG_UNBIND_INPUT, mCurMethod));
                        }
                    }
                    mCurClient = null;
                    mCurClient = null;
                }
                }
                if (mCurFocusedWindowClient == cs) {
                if (mCurFocusedWindowClient == cs) {