diff options
author | satok <satok@google.com> | 2011-08-26 11:55:21 +0900 |
---|---|---|
committer | satok <satok@google.com> | 2011-08-26 12:39:42 +0900 |
commit | 3cb5b39a0e63d98c4e7b47e9a5b5758e9d4024bd (patch) | |
tree | 670892893fc08f5ba8ee0b55fb80b8236cf9a9e9 /services/java/com/android/server/TextServicesManagerService.java | |
parent | 1e3fac8bc62a2495eb9bb79cc208573b5782cedc (diff) |
Fix setCurrentSpellCheckerSubtype
Change-Id: Ib42a3b4377b8700ceaf4b7e13150848464d073c1
Diffstat (limited to 'services/java/com/android/server/TextServicesManagerService.java')
-rw-r--r-- | services/java/com/android/server/TextServicesManagerService.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/services/java/com/android/server/TextServicesManagerService.java b/services/java/com/android/server/TextServicesManagerService.java index 321274fcb641..5eae45678531 100644 --- a/services/java/com/android/server/TextServicesManagerService.java +++ b/services/java/com/android/server/TextServicesManagerService.java @@ -131,6 +131,11 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { if (DBG) Slog.d(TAG, "Add: " + compName); try { final SpellCheckerInfo sci = new SpellCheckerInfo(context, ri); + if (sci.getSubtypeCount() <= 0) { + Slog.w(TAG, "Skipping text service " + compName + + ": it does not contain subtypes."); + continue; + } list.add(sci); map.put(sci.getId(), sci); } catch (XmlPullParserException e) { @@ -186,9 +191,11 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { } } + // TODO: Respect allowImplicitlySelectedSubtype // TODO: Save SpellCheckerSubtype by supported languages. @Override - public SpellCheckerSubtype getCurrentSpellCheckerSubtype(String locale) { + public SpellCheckerSubtype getCurrentSpellCheckerSubtype( + String locale, boolean allowImplicitlySelectedSubtype) { synchronized (mSpellCheckerMap) { final String subtypeHashCodeStr = Settings.Secure.getString(mContext.getContentResolver(), @@ -207,8 +214,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { if (DBG) { Slog.w(TAG, "Return first subtype in " + sci.getId()); } - // Return the first Subtype if there is no settings for the current subtype. - return sci.getSubtypeAt(0); + return null; } final int hashCode = Integer.valueOf(subtypeHashCodeStr); for (int i = 0; i < sci.getSubtypeCount(); ++i) { @@ -223,7 +229,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { if (DBG) { Slog.w(TAG, "Return first subtype in " + sci.getId()); } - return sci.getSubtypeAt(0); + return null; } } |