From f39daef102f2dff7517e257eb25c2e3677247e83 Mon Sep 17 00:00:00 2001 From: satok Date: Fri, 26 Aug 2011 19:54:27 +0900 Subject: [PATCH] Reset subtype when the current spell checker was changed. Change-Id: I79099695337dbc5577871458b24c6710fc0ecca7 --- services/java/com/android/server/TextServicesManagerService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/java/com/android/server/TextServicesManagerService.java b/services/java/com/android/server/TextServicesManagerService.java index e27c11f70446..f6c369eacddf 100644 --- a/services/java/com/android/server/TextServicesManagerService.java +++ b/services/java/com/android/server/TextServicesManagerService.java @@ -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); } -- 2.11.0