From ee36cf91d2cc7eed0f3cd4d7446a44e856bcdd03 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Tue, 16 Jan 2024 20:08:00 -0800 Subject: Accept List<> instead of ArrayList<> around InputMethodListBuilder InputMethodListBuilder can actually take List instead of ArrayList, and such a change will help us merge the following fields InputMethodManagerService#mMethodList InputMethodManagerService#mMethodMap into InputMethodManagerService#mSettings in a subsequent CL. There must be no observable behavior change. Bug: 309837937 Bug: 309870347 Test: presubmit Change-Id: Ie81ad03693c91d8f39167c0711649b5f2448ceb9 --- .../android/server/inputmethod/InputMethodInfoUtils.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodInfoUtils.java b/services/core/java/com/android/server/inputmethod/InputMethodInfoUtils.java index a7632519b7bc..542165d06a92 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodInfoUtils.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodInfoUtils.java @@ -46,7 +46,7 @@ final class InputMethodInfoUtils { private static final String TAG = "InputMethodInfoUtils"; /** - * Used in {@link #getFallbackLocaleForDefaultIme(ArrayList, Context)} to find the fallback IMEs + * Used in {@link #getFallbackLocaleForDefaultIme(List, Context)} to find the fallback IMEs * that are mainly used until the system becomes ready. Note that {@link Locale} in this array * is checked with {@link Locale#equals(Object)}, which means that {@code Locale.ENGLISH} * doesn't automatically match {@code Locale("en", "IN")}. @@ -64,7 +64,7 @@ final class InputMethodInfoUtils { @NonNull private final LinkedHashSet mInputMethodSet = new LinkedHashSet<>(); - InputMethodListBuilder fillImes(ArrayList imis, Context context, + InputMethodListBuilder fillImes(List imis, Context context, boolean checkDefaultAttribute, @Nullable Locale locale, boolean checkCountry, String requiredSubtypeMode) { for (int i = 0; i < imis.size(); ++i) { @@ -77,7 +77,7 @@ final class InputMethodInfoUtils { return this; } - InputMethodListBuilder fillAuxiliaryImes(ArrayList imis, Context context) { + InputMethodListBuilder fillAuxiliaryImes(List imis, Context context) { // If one or more auxiliary input methods are available, OK to stop populating the list. for (final InputMethodInfo imi : mInputMethodSet) { if (imi.isAuxiliaryIme()) { @@ -118,7 +118,7 @@ final class InputMethodInfoUtils { } private static InputMethodListBuilder getMinimumKeyboardSetWithSystemLocale( - ArrayList imis, Context context, @Nullable Locale systemLocale, + List imis, Context context, @Nullable Locale systemLocale, @Nullable Locale fallbackLocale) { // Once the system becomes ready, we pick up at least one keyboard in the following order. // Secondary users fall into this category in general. @@ -167,7 +167,7 @@ final class InputMethodInfoUtils { } static ArrayList getDefaultEnabledImes( - Context context, ArrayList imis, boolean onlyMinimum) { + Context context, List imis, boolean onlyMinimum) { final Locale fallbackLocale = getFallbackLocaleForDefaultIme(imis, context); // We will primarily rely on the system locale, but also keep relying on the fallback locale // as a last resort. @@ -186,7 +186,7 @@ final class InputMethodInfoUtils { } static ArrayList getDefaultEnabledImes( - Context context, ArrayList imis) { + Context context, List imis) { return getDefaultEnabledImes(context, imis, false /* onlyMinimum */); } @@ -283,7 +283,7 @@ final class InputMethodInfoUtils { } @Nullable - private static Locale getFallbackLocaleForDefaultIme(ArrayList imis, + private static Locale getFallbackLocaleForDefaultIme(List imis, Context context) { // At first, find the fallback locale from the IMEs that are declared as "default" in the // current locale. Note that IME developers can declare an IME as "default" only for -- cgit v1.2.3-59-g8ed1b