diff options
Diffstat (limited to 'src/com/android/settings/inputmethod')
3 files changed, 15 insertions, 8 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java index 3ba06252c..0e5be2063 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java +++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java @@ -181,7 +181,8 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment { for (int i = 0; i < N; ++i) { final InputMethodInfo imi = mInputMethodProperties.get(i); - if (imi.getSubtypes().size() <= 1) continue; + final int subtypeCount = imi.getSubtypeCount(); + if (subtypeCount <= 1) continue; final String imiId = imi.getId(); // Add this subtype to the list when no IME is specified or when the IME of this // subtype is the specified IME. @@ -205,10 +206,10 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment { activeInputMethodsCategory.setTitle(R.string.active_input_method_subtypes); root.addPreference(activeInputMethodsCategory); - ArrayList<InputMethodSubtype> subtypes = imi.getSubtypes(); ArrayList<Preference> subtypePreferences = new ArrayList<Preference>(); - if (subtypes.size() > 0) { - for (InputMethodSubtype subtype: subtypes) { + if (subtypeCount > 0) { + for (int j = 0; j < subtypeCount; ++j) { + InputMethodSubtype subtype = imi.getSubtypeAt(j); CharSequence subtypeLabel; int nameResId = subtype.getNameResId(); if (nameResId != 0) { diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java index bc347faa3..80030418a 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java +++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java @@ -179,7 +179,9 @@ public class InputMethodAndSubtypeUtil { HashSet<String> subtypesSet = enabledIMEAndSubtypesMap.get(imiId); boolean subtypeCleared = false; - for (InputMethodSubtype subtype : imi.getSubtypes()) { + final int subtypeCount = imi.getSubtypeCount(); + for (int i = 0; i < subtypeCount; ++i) { + InputMethodSubtype subtype = imi.getSubtypeAt(i); final String subtypeHashCodeStr = String.valueOf(subtype.hashCode()); CheckBoxPreference subtypePref = (CheckBoxPreference) context.findPreference( imiId + subtypeHashCodeStr); @@ -293,7 +295,9 @@ public class InputMethodAndSubtypeUtil { PreferenceScreen preferenceScreen = context.getPreferenceScreen(); for (InputMethodInfo imi : inputMethodProperties) { if (id.equals(imi.getId())) { - for (InputMethodSubtype subtype : imi.getSubtypes()) { + final int subtypeCount = imi.getSubtypeCount(); + for (int i = 0; i < subtypeCount; ++i) { + InputMethodSubtype subtype = imi.getSubtypeAt(i); CheckBoxPreference pref = (CheckBoxPreference) preferenceScreen.findPreference( id + subtype.hashCode()); if (pref != null) { @@ -311,7 +315,9 @@ public class InputMethodAndSubtypeUtil { for (InputMethodInfo imi : inputMethodProperties) { String id = imi.getId(); HashSet<String> enabledSubtypesSet = enabledSubtypes.get(id); - for (InputMethodSubtype subtype : imi.getSubtypes()) { + final int subtypeCount = imi.getSubtypeCount(); + for (int i = 0; i < subtypeCount; ++i) { + InputMethodSubtype subtype = imi.getSubtypeAt(i); String hashCode = String.valueOf(subtype.hashCode()); if (DEBUG) { Log.d(TAG, "--- Set checked state: " + "id" + ", " + hashCode + ", " diff --git a/src/com/android/settings/inputmethod/InputMethodConfig.java b/src/com/android/settings/inputmethod/InputMethodConfig.java index 908fa05a2..22d4411f6 100644 --- a/src/com/android/settings/inputmethod/InputMethodConfig.java +++ b/src/com/android/settings/inputmethod/InputMethodConfig.java @@ -218,7 +218,7 @@ public class InputMethodConfig extends SettingsPreferenceFragment { // Add subtype settings when this IME has two or more subtypes. PreferenceScreen prefScreen = new PreferenceScreen(getActivity(), null); prefScreen.setTitle(R.string.active_input_method_subtypes); - if (imi.getSubtypes().size() > 1) { + if (imi.getSubtypeCount() > 1) { intent = new Intent(Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED |