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

Commit fca524fb authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Use IO thread to handle IMMS user switching

This is a preparation before enabling strict mode check on IO
operation on the handler thread (UI thread) in IMMS.

As other user-related operations are also offloaded to IO thread,
moving user swithcing task to the IO thread would also give us a
strong order garantee across user-related operations (e.g. user
addition/removal, unlocking, and so on).

Observable semantics should remain unchanged.

Bug: 196206770
Bug: 343601565
Test: presubmit
Flag: EXEMPT refactor
Change-Id: I3b6212d724b1d3bec89aa7fd7f0bc12187376719
parent 325cdf65
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1095,7 +1095,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                mUserSwitchHandlerTask.mClientToBeReset = clientToBeReset;
                mUserSwitchHandlerTask.mClientToBeReset = clientToBeReset;
                return;
                return;
            }
            }
            mHandler.removeCallbacks(mUserSwitchHandlerTask);
            mIoHandler.removeCallbacks(mUserSwitchHandlerTask);
        }
        }
        // Hide soft input before user switch task since switch task may block main handler a while
        // Hide soft input before user switch task since switch task may block main handler a while
        // and delayed the hideCurrentInputLocked().
        // and delayed the hideCurrentInputLocked().
@@ -1105,7 +1105,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        final UserSwitchHandlerTask task = new UserSwitchHandlerTask(this, userId,
        final UserSwitchHandlerTask task = new UserSwitchHandlerTask(this, userId,
                clientToBeReset);
                clientToBeReset);
        mUserSwitchHandlerTask = task;
        mUserSwitchHandlerTask = task;
        mHandler.post(task);
        mIoHandler.post(task);
    }
    }


    @VisibleForTesting
    @VisibleForTesting