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

Commit 05b5e0e2 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Make sure to not block SystemService#onUserStarting() in IMMS

As part of our on-going effort to make sure that slow I/O operations
will not block the system in InputMethodManagerService, we start
dispatching

  InputMethodManagerService#initializeVisibleBackgroundUserLocked()

into an I/O thread.

The observable semantics should remain unchanged in general.

Bug: 343601565
Test: presubmit
Flag: EXEMPT refactor
Change-Id: Iee0b1c7276f88e4b179b0eb8fb978503bc45760c
parent 626a053f
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1038,6 +1038,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            // Called on ActivityManager thread.
            final int userId = user.getUserIdentifier();
            SecureSettingsWrapper.onUserStarting(userId);
            mService.mIoHandler.post(() -> {
                synchronized (ImfLock.class) {
                    if (mService.mConcurrentMultiUserModeEnabled) {
                        if (mService.mCurrentUserId != userId && mService.mSystemReady) {
@@ -1045,6 +1046,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        }
                    }
                }
            });
        }

    }