From fca524fbb38b95ec4fa73e887e81ea4392c7960a Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 25 Jul 2024 09:38:33 -0700 Subject: 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 --- .../com/android/server/inputmethod/InputMethodManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 4716e6c24154..8b673ee8d088 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -1095,7 +1095,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. mUserSwitchHandlerTask.mClientToBeReset = clientToBeReset; return; } - mHandler.removeCallbacks(mUserSwitchHandlerTask); + mIoHandler.removeCallbacks(mUserSwitchHandlerTask); } // Hide soft input before user switch task since switch task may block main handler a while // and delayed the hideCurrentInputLocked(). @@ -1105,7 +1105,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. final UserSwitchHandlerTask task = new UserSwitchHandlerTask(this, userId, clientToBeReset); mUserSwitchHandlerTask = task; - mHandler.post(task); + mIoHandler.post(task); } @VisibleForTesting -- cgit v1.2.3-59-g8ed1b