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

Commit 22992d58 authored by Antonio Kantek's avatar Antonio Kantek
Browse files

Make switchToInputMethodLocked concurrent multi-user aware

This change is required in order to enable `ime set` shell command.

This code change is an internal refactoring and should not cause
any noticeable issues on surfaces with non-concurrent multi-user IME
enabled.

Bug: 350834650
Test: `adb shell ime set --user 11 com.android.inputmethod.latin/.CarLatinIME` (user 11 is a bg visible user)
Test: presubmit
Flag: EXEMPT refactor
Change-Id: I58edae672be629bdacd4a9a16cc9ad5c8012eea6
parent 9d1ee9be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5616,7 +5616,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
    @GuardedBy("ImfLock.class")
    private boolean switchToInputMethodLocked(String imeId, @UserIdInt int userId) {
        final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
        if (userId == mCurrentUserId) {
        if (mExperimentalConcurrentMultiUserModeEnabled || userId == mCurrentUserId) {
            if (!settings.getMethodMap().containsKey(imeId)
                    || !settings.getEnabledInputMethodList()
                    .contains(settings.getMethodMap().get(imeId))) {