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

Commit 32b81205 authored by satok's avatar satok
Browse files

Fix a bug where disabled auxilialy IME is unexpectedly re-enabled

Bug: 7872918

This is a serious issue which the disabled system auxilialy IME is unexpectedly re-enabled by re-building internal IMI cache.

Change-Id: I0727cc973dfaea9823194021ce94af8665b98373
parent 858eb008
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -782,6 +782,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        if (!isSystemIme(imi)) {
            return false;
        }
        if (imi.isAuxiliaryIme()) {
            return false;
        }
        if (imi.getIsDefaultResourceId() != 0) {
            try {
                Resources res = context.createPackageContext(
@@ -805,6 +808,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        if (!isSystemIme(imi)) {
            return false;
        }
        if (imi.isAuxiliaryIme()) {
            return false;
        }
        return containsSubtypeOf(imi, ENGLISH_LOCALE.getLanguage());
    }

@@ -2856,6 +2862,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        List<Pair<String, ArrayList<String>>> enabledInputMethodsList = mSettings
                .getEnabledInputMethodsAndSubtypeListLocked();

        if (DEBUG) {
            Slog.d(TAG, (enabled ? "Enable " : "Disable ") + id);
        }
        if (enabled) {
            for (Pair<String, ArrayList<String>> pair: enabledInputMethodsList) {
                if (pair.first.equals(id)) {