diff options
Diffstat (limited to 'java/src')
8 files changed, 19 insertions, 22 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index fa7ec5cbf..68858e5bf 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -275,7 +275,7 @@ public class Key { additionalMoreKeys = style.getStringArray( keyAttr, R.styleable.Keyboard_Key_additionalMoreKeys); } - moreKeys = KeySpecParser.insertAddtionalMoreKeys(moreKeys, additionalMoreKeys); + moreKeys = KeySpecParser.insertAdditionalMoreKeys(moreKeys, additionalMoreKeys); if (moreKeys != null) { actionFlags |= ACTION_FLAGS_ENABLE_LONG_PRESS; mMoreKeys = new MoreKeySpec[moreKeys.length]; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java index 2981a8e5c..9bbd3a280 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java @@ -267,7 +267,7 @@ public class KeySpecParser { } } - public static String[] insertAddtionalMoreKeys(String[] moreKeySpecs, + public static String[] insertAdditionalMoreKeys(String[] moreKeySpecs, String[] additionalMoreKeySpecs) { final String[] moreKeys = filterOutEmptyString(moreKeySpecs); final String[] additionalMoreKeys = filterOutEmptyString(additionalMoreKeySpecs); diff --git a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java index deb247860..5e42ad6c5 100644 --- a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java +++ b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java @@ -19,7 +19,6 @@ package com.android.inputmethod.latin; import android.view.inputmethod.InputMethodSubtype; import java.util.HashMap; -import java.util.Locale; public class AdditionalSubtype { public static final String QWERTY = "qwerty"; @@ -43,14 +42,14 @@ public class AdditionalSubtype { return subtype.containsExtraValueKey(SUBTYPE_EXTRA_VALUE_IS_ADDITIONAL_SUBTYPE); } - public static InputMethodSubtype createAddtionalSubtype( - Locale locale, String keyboardLayoutSet) { + public static InputMethodSubtype createAdditionalSubtype( + String localeString, String keyboardLayoutSet) { final String extraValue = String.format( "%s=%s,%s", LatinIME.SUBTYPE_EXTRA_VALUE_KEYBOARD_LAYOUT_SET, keyboardLayoutSet, SUBTYPE_EXTRA_VALUE_IS_ADDITIONAL_SUBTYPE); Integer nameId = sKeyboardLayoutToNameIdsMap.get(keyboardLayoutSet); if (nameId == null) nameId = R.string.subtype_generic; return new InputMethodSubtype(nameId, R.drawable.ic_subtype_keyboard, - locale.toString(), SUBTYPE_MODE_KEYBOARD, extraValue, false, false); + localeString, SUBTYPE_MODE_KEYBOARD, extraValue, false, false); } } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 7d0818193..deb956753 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -441,7 +441,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen loadSettings(); - SubtypeUtils.setAditionalInputMethodSubtypes( + SubtypeUtils.setAdditionalInputMethodSubtypes( this, mSettingsValues.getPrefefinedAdditionalSubtypes()); // TODO: remove the following when it's not needed by updateCorrectionMode() any more diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 8ff644fc5..b961a768d 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -150,10 +150,10 @@ public class SettingsValues { mVoiceKeyOnMain = mVoiceMode != null && mVoiceMode.equals(voiceModeMain); // Predefined additional subtypes - final InputMethodSubtype DE_QWERTY = AdditionalSubtype.createAddtionalSubtype( - Locale.GERMAN, AdditionalSubtype.QWERTY); - final InputMethodSubtype FR_QWERTZ = AdditionalSubtype.createAddtionalSubtype( - Locale.FRENCH, AdditionalSubtype.QWERTZ); + final InputMethodSubtype DE_QWERTY = AdditionalSubtype.createAdditionalSubtype( + Locale.GERMAN.toString(), AdditionalSubtype.QWERTY); + final InputMethodSubtype FR_QWERTZ = AdditionalSubtype.createAdditionalSubtype( + Locale.FRENCH.toString(), AdditionalSubtype.QWERTZ); mPredefinedAdditionalSubtypes = new InputMethodSubtype[] { DE_QWERTY, FR_QWERTZ, diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java index 03780419e..37f46fc79 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java +++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java @@ -25,8 +25,7 @@ import java.util.Locale; public class SubtypeLocale { // Special language code to represent "no language". - private static final String NO_LANGUAGE = "zz"; - public static final Locale LOCALE_NO_LANGUAGE = new Locale(NO_LANGUAGE); + public static final String NO_LANGUAGE = "zz"; // Exceptional locales to display name map. private static final HashMap<String, String> sExceptionalDisplayNamesMap = diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index 3bb3ab4ba..a2b8254a6 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -105,7 +105,7 @@ public class SubtypeSwitcher { mCurrentSubtype = mImm.getCurrentInputMethodSubtype(); mAllEnabledSubtypesOfCurrentInputMethod = null; mNoLanguageSubtype = SubtypeUtils.findSubtypeByLocaleAndKeyboardLayoutSet( - service, SubtypeLocale.LOCALE_NO_LANGUAGE, AdditionalSubtype.QWERTY); + service, SubtypeLocale.NO_LANGUAGE, AdditionalSubtype.QWERTY); final NetworkInfo info = mConnectivityManager.getActiveNetworkInfo(); mIsNetworkConnected = (info != null && info.isConnected()); @@ -333,7 +333,7 @@ public class SubtypeSwitcher { } public boolean needsToDisplayLanguage(Locale keyboardLocale) { - if (keyboardLocale.equals(SubtypeLocale.LOCALE_NO_LANGUAGE)) { + if (keyboardLocale.toString().equals(SubtypeLocale.NO_LANGUAGE)) { return true; } if (!keyboardLocale.equals(mInputLocale)) { diff --git a/java/src/com/android/inputmethod/latin/SubtypeUtils.java b/java/src/com/android/inputmethod/latin/SubtypeUtils.java index a361027af..30be181de 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeUtils.java +++ b/java/src/com/android/inputmethod/latin/SubtypeUtils.java @@ -24,7 +24,6 @@ import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; import java.util.Collections; import java.util.List; -import java.util.Locale; public class SubtypeUtils { private SubtypeUtils() { @@ -132,22 +131,22 @@ public class SubtypeUtils { } public static InputMethodSubtype findSubtypeByLocaleAndKeyboardLayoutSet( - Context context, Locale locale, String keyoardLayoutSet) { - final String localeString = locale.toString(); + Context context, String localeString, String keyboardLayoutSetName) { final InputMethodInfo imi = getInputMethodInfo(context.getPackageName()); final int count = imi.getSubtypeCount(); for (int i = 0; i < count; i++) { final InputMethodSubtype subtype = imi.getSubtypeAt(i); - final String layout = SubtypeLocale.getKeyboardLayoutSetName(subtype); - if (localeString.equals(subtype.getLocale()) && keyoardLayoutSet.equals(layout)) { + final String layoutName = SubtypeLocale.getKeyboardLayoutSetName(subtype); + if (localeString.equals(subtype.getLocale()) + && keyboardLayoutSetName.equals(layoutName)) { return subtype; } } throw new RuntimeException("Can't find subtype for locale " + localeString - + " and keyboard layout " + keyoardLayoutSet); + + " and keyboard layout " + keyboardLayoutSetName); } - public static void setAditionalInputMethodSubtypes(Context context, + public static void setAdditionalInputMethodSubtypes(Context context, InputMethodSubtype[] subtypes) { final InputMethodManagerCompatWrapper imm = InputMethodManagerCompatWrapper.getInstance(); if (imm == null) { |