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

Commit 028d0aac authored by Satoshi Kataoka's avatar Satoshi Kataoka Committed by Android Git Automerger
Browse files

am 3022b6b9: am 17150cf9: Fix locale in TextServicesManagerService

* commit '3022b6b9':
  Fix locale in TextServicesManagerService
parents f0b2cd4a 3022b6b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ public final class TextServicesManager {
    public SpellCheckerSubtype getCurrentSpellCheckerSubtype(
            boolean allowImplicitlySelectedSubtype) {
        try {
            // Passing null as a locale for ICS
            // Passing null as a locale until we support multiple enabled spell checker subtypes.
            return sService.getCurrentSpellCheckerSubtype(null, allowImplicitlySelectedSubtype);
        } catch (RemoteException e) {
            Log.e(TAG, "Error in getCurrentSpellCheckerSubtype: " + e);
+3 −3
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
    }

    // TODO: Respect allowImplicitlySelectedSubtype
    // TODO: Save SpellCheckerSubtype by supported languages.
    // TODO: Save SpellCheckerSubtype by supported languages by looking at "locale".
    @Override
    public SpellCheckerSubtype getCurrentSpellCheckerSubtype(
            String locale, boolean allowImplicitlySelectedSubtype) {
@@ -250,10 +250,10 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
            for (int i = 0; i < sci.getSubtypeCount(); ++i) {
                final SpellCheckerSubtype scs = sci.getSubtypeAt(i);
                if (hashCode == 0) {
                    if (candidateLocale.equals(locale)) {
                    final String scsLocale = scs.getLocale();
                    if (candidateLocale.equals(scsLocale)) {
                        return scs;
                    } else if (candidate == null) {
                        final String scsLocale = scs.getLocale();
                        if (candidateLocale.length() >= 2 && scsLocale.length() >= 2
                                && candidateLocale.startsWith(scsLocale)) {
                            // Fall back to the applicable language