diff options
author | 2015-03-11 16:11:50 -0700 | |
---|---|---|
committer | 2015-03-11 17:29:12 -0700 | |
commit | 107fb4c476779df16be23e245547253978c197ac (patch) | |
tree | eda7c85d72b7fa74efd8a489c1319958a9309e19 /java/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtils.java | |
parent | 9a289da4e6ea40417422a540e821069d5d6e4a82 (diff) | |
download | latinime-107fb4c476779df16be23e245547253978c197ac.tar.gz latinime-107fb4c476779df16be23e245547253978c197ac.tar.xz latinime-107fb4c476779df16be23e245547253978c197ac.zip |
Remove ALS from LatinIME.
This fixes unit tests and brings us closer to a green build.
Change-Id: Iffcc392eda4a7671a238b79cc7367320ca648725
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtils.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtils.java b/java/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtils.java index fa1583b7a..a5a1ea921 100644 --- a/java/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtils.java @@ -33,7 +33,6 @@ public final class LanguageOnSpacebarUtils { public static final int FORMAT_TYPE_NONE = 0; public static final int FORMAT_TYPE_LANGUAGE_ONLY = 1; public static final int FORMAT_TYPE_FULL_LOCALE = 2; - public static final int FORMAT_TYPE_MULTIPLE = 3; private static List<InputMethodSubtype> sEnabledSubtypes = Collections.emptyList(); private static boolean sIsSystemLanguageSameAsInputLanguage; @@ -51,11 +50,11 @@ public final class LanguageOnSpacebarUtils { if (sEnabledSubtypes.size() < 2 && sIsSystemLanguageSameAsInputLanguage) { return FORMAT_TYPE_NONE; } - final Locale[] locales = subtype.getLocales(); - if (1 < locales.length) { - return FORMAT_TYPE_MULTIPLE; + final Locale locale = subtype.getLocale(); + if (locale == null) { + return FORMAT_TYPE_NONE; } - final String keyboardLanguage = locales[0].getLanguage(); + final String keyboardLanguage = locale.getLanguage(); final String keyboardLayout = subtype.getKeyboardLayoutSetName(); int sameLanguageAndLayoutCount = 0; for (final InputMethodSubtype ims : sEnabledSubtypes) { @@ -77,14 +76,7 @@ public final class LanguageOnSpacebarUtils { public static void onSubtypeChanged(@Nonnull final RichInputMethodSubtype subtype, final boolean implicitlyEnabledSubtype, @Nonnull final Locale systemLocale) { - final Locale[] newLocales = subtype.getLocales(); - if (newLocales.length > 1) { - // In multi-locales mode, the system language is never the same as the input language - // because there is no single input language. - sIsSystemLanguageSameAsInputLanguage = false; - return; - } - final Locale newLocale = newLocales[0]; + final Locale newLocale = subtype.getLocale(); if (systemLocale.equals(newLocale)) { sIsSystemLanguageSameAsInputLanguage = true; return; |