Reset subtype when the current spell checker was changed.

Change-Id: I79099695337dbc5577871458b24c6710fc0ecca7
This commit is contained in:
satok
2011-08-26 19:54:27 +09:00
parent ca6d29da77
commit f39daef102

View File

@@ -416,10 +416,16 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
Slog.w(TAG, "setCurrentSpellChecker: " + sciId); Slog.w(TAG, "setCurrentSpellChecker: " + sciId);
} }
if (TextUtils.isEmpty(sciId) || !mSpellCheckerMap.containsKey(sciId)) return; 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(); final long ident = Binder.clearCallingIdentity();
try { try {
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.putString(mContext.getContentResolver(),
Settings.Secure.SELECTED_SPELL_CHECKER, sciId); Settings.Secure.SELECTED_SPELL_CHECKER, sciId);
setCurrentSpellCheckerSubtypeLocked(0);
} finally { } finally {
Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident);
} }