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

Commit f39daef1 authored by satok's avatar satok
Browse files

Reset subtype when the current spell checker was changed.

Change-Id: I79099695337dbc5577871458b24c6710fc0ecca7
parent ca6d29da
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -416,10 +416,16 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
            Slog.w(TAG, "setCurrentSpellChecker: " + sciId);
        }
        if (TextUtils.isEmpty(sciId) || !mSpellCheckerMap.containsKey(sciId)) return;
        final SpellCheckerInfo currentSci = getCurrentSpellChecker(null);
        if (currentSci != null && currentSci.getId().equals(sciId)) {
            // Do nothing if the current spell checker is same as new spell checker.
            return;
        }
        final long ident = Binder.clearCallingIdentity();
        try {
            Settings.Secure.putString(mContext.getContentResolver(),
                    Settings.Secure.SELECTED_SPELL_CHECKER, sciId);
            setCurrentSpellCheckerSubtypeLocked(0);
        } finally {
            Binder.restoreCallingIdentity(ident);
        }