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

Commit 386e59c2 authored by Adrian Roos's avatar Adrian Roos Committed by Automerger Merge Worker
Browse files

Merge "IMF: Avoid config changes when resetting IMEs in IMMS" into udc-dev am: eb3e27a9

parents 9f12c1c9 eb3e27a9
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -6458,19 +6458,21 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                                0 /* flags */, null /* resultReceiver */,
                                SoftInputShowHideReason.HIDE_RESET_SHELL_COMMAND);
                        mBindingController.unbindCurrentMethod();
                        // Reset the current IME

                        // Enable default IMEs, disable others
                        var toDisable = mSettings.getEnabledInputMethodListLocked();
                        var defaultEnabled = InputMethodInfoUtils.getDefaultEnabledImes(
                                mContext, mMethodList);
                        toDisable.removeAll(defaultEnabled);
                        for (InputMethodInfo info : toDisable) {
                            setInputMethodEnabledLocked(info.getId(), false);
                        }
                        for (InputMethodInfo info : defaultEnabled) {
                            setInputMethodEnabledLocked(info.getId(), true);
                        }
                        // Choose new default IME, reset to none if no IME available.
                        if (!chooseNewDefaultIMELocked()) {
                            resetSelectedInputMethodAndSubtypeLocked(null);
                        // Also reset the settings of the current IME
                        mSettings.putSelectedInputMethod(null);
                        // Disable all enabled IMEs.
                        for (InputMethodInfo inputMethodInfo :
                                mSettings.getEnabledInputMethodListLocked()) {
                            setInputMethodEnabledLocked(inputMethodInfo.getId(), false);
                        }
                        // Re-enable with default enabled IMEs.
                        for (InputMethodInfo imi : InputMethodInfoUtils.getDefaultEnabledImes(
                                mContext, mMethodList)) {
                            setInputMethodEnabledLocked(imi.getId(), true);
                        }
                        updateInputMethodsFromSettingsLocked(true /* enabledMayChange */);
                        InputMethodUtils.setNonSelectedSystemImesDisabledUntilUsed(