Loading core/java/android/view/textservice/TextServicesManager.java +3 −2 Original line number Diff line number Diff line Loading @@ -146,10 +146,11 @@ public final class TextServicesManager { /** * @hide */ public SpellCheckerSubtype getCurrentSpellCheckerSubtype() { public SpellCheckerSubtype getCurrentSpellCheckerSubtype( boolean allowImplicitlySelectedSubtype) { try { // Passing null as a locale for ICS return sService.getCurrentSpellCheckerSubtype(null); return sService.getCurrentSpellCheckerSubtype(null, allowImplicitlySelectedSubtype); } catch (RemoteException e) { Log.e(TAG, "Error in getCurrentSpellCheckerSubtype: " + e); return null; Loading core/java/com/android/internal/textservice/ITextServicesManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ import android.view.textservice.SpellCheckerSubtype; */ interface ITextServicesManager { SpellCheckerInfo getCurrentSpellChecker(String locale); SpellCheckerSubtype getCurrentSpellCheckerSubtype(String locale); SpellCheckerSubtype getCurrentSpellCheckerSubtype( String locale, boolean allowImplicitlySelectedSubtype); oneway void getSpellCheckerService(String sciId, in String locale, in ITextServicesSessionListener tsListener, in ISpellCheckerSessionListener scListener, in Bundle bundle); Loading services/java/com/android/server/TextServicesManagerService.java +10 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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(), Loading @@ -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) { Loading @@ -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; } } Loading Loading
core/java/android/view/textservice/TextServicesManager.java +3 −2 Original line number Diff line number Diff line Loading @@ -146,10 +146,11 @@ public final class TextServicesManager { /** * @hide */ public SpellCheckerSubtype getCurrentSpellCheckerSubtype() { public SpellCheckerSubtype getCurrentSpellCheckerSubtype( boolean allowImplicitlySelectedSubtype) { try { // Passing null as a locale for ICS return sService.getCurrentSpellCheckerSubtype(null); return sService.getCurrentSpellCheckerSubtype(null, allowImplicitlySelectedSubtype); } catch (RemoteException e) { Log.e(TAG, "Error in getCurrentSpellCheckerSubtype: " + e); return null; Loading
core/java/com/android/internal/textservice/ITextServicesManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ import android.view.textservice.SpellCheckerSubtype; */ interface ITextServicesManager { SpellCheckerInfo getCurrentSpellChecker(String locale); SpellCheckerSubtype getCurrentSpellCheckerSubtype(String locale); SpellCheckerSubtype getCurrentSpellCheckerSubtype( String locale, boolean allowImplicitlySelectedSubtype); oneway void getSpellCheckerService(String sciId, in String locale, in ITextServicesSessionListener tsListener, in ISpellCheckerSessionListener scListener, in Bundle bundle); Loading
services/java/com/android/server/TextServicesManagerService.java +10 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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(), Loading @@ -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) { Loading @@ -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; } } Loading