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

Commit 880d3fb0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix an edge case in IMS#switchInputMethod()" into udc-qpr-dev

parents d42ee920 dc394bdd
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -3377,15 +3377,18 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            } else {
                // If subtype is null, try to find the most applicable one from
                // getCurrentInputMethodSubtype.
                subtypeId = NOT_A_SUBTYPE_ID;
                newSubtype = getCurrentInputMethodSubtypeLocked();
                if (newSubtype != null) {
                    for (int i = 0; i < subtypeCount; ++i) {
                        if (Objects.equals(newSubtype, info.getSubtypeAt(i))) {
                            subtypeId = i;
                            break;
                        }
                    }
                }
            if (newSubtype == null || oldSubtype == null) {
                Slog.w(TAG, "Illegal subtype state: old subtype = " + oldSubtype
                        + ", new subtype = " + newSubtype);
                notifyInputMethodSubtypeChangedLocked(userId, info, null);
                return;
            }
            if (!newSubtype.equals(oldSubtype)) {
            if (!Objects.equals(newSubtype, oldSubtype)) {
                setSelectedInputMethodAndSubtypeLocked(info, subtypeId, true);
                IInputMethodInvoker curMethod = getCurMethodLocked();
                if (curMethod != null) {