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

Commit 422098ea authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Make "ime reset --user <userId>" consistent among users

With this CL

  adb shell ime reset --user <userId>

starts behaving in the same manner across users, meaning that there is
no special behavior when the userId is not IMMS#mCurrentUserId.

We expect no abrupt behavior change in this CL.

Bug: 350386877
Bug: 350834650
Test: manually verified
Flag: EXEMPT refactor
Change-Id: I4c776b45bb7d96d8f7dd49c71e269ffa310389c6
parent 1054f4ec
Loading
Loading
Loading
Loading
+36 −56
Original line number Diff line number Diff line
@@ -6825,7 +6825,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    final String nextIme;
                    final List<InputMethodInfo> nextEnabledImes;
                    final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
                    if (userId == mCurrentUserId) {
                    final var userData = getUserData(userId);
                    if (Flags.refactorInsetsController()) {
                        if (userData.mImeBindingState != null
@@ -6867,25 +6866,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                            settings.getEnabledInputMethodList());
                    nextIme = settings.getSelectedInputMethod();
                    nextEnabledImes = settings.getEnabledInputMethodList();
                    } else {
                        nextEnabledImes = InputMethodInfoUtils.getDefaultEnabledImes(mContext,
                                settings.getMethodList());
                        nextIme = InputMethodInfoUtils.getMostApplicableDefaultIME(
                                nextEnabledImes).getId();

                        // Reset enabled IMEs.
                        final String[] nextEnabledImeIds = new String[nextEnabledImes.size()];
                        for (int i = 0; i < nextEnabledImeIds.length; ++i) {
                            nextEnabledImeIds[i] = nextEnabledImes.get(i).getId();
                        }
                        settings.putEnabledInputMethodsStr(InputMethodUtils.concatEnabledImeIds(
                                "", nextEnabledImeIds));

                        // Reset selected IME.
                        settings.putSelectedInputMethod(nextIme);
                        settings.putSelectedDefaultDeviceInputMethod(null);
                        settings.putSelectedSubtype(NOT_A_SUBTYPE_ID);
                    }
                    out.println("Reset current and enabled IMEs for user #" + userId);
                    out.println("  Selected: " + nextIme);
                    nextEnabledImes.forEach(ime -> out.println("   Enabled: " + ime.getId()));