Loading core/java/com/android/internal/app/AppLocaleCollector.java +3 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ import java.util.Set; import java.util.stream.Collectors; /** The Locale data collector for per-app language. */ public class AppLocaleCollector implements LocalePickerWithRegion.LocaleCollectorBase { public class AppLocaleCollector implements LocaleCollectorBase { private static final String TAG = AppLocaleCollector.class.getSimpleName(); private final Context mContext; private final String mAppPackageName; Loading Loading @@ -167,8 +167,8 @@ public class AppLocaleCollector implements LocalePickerWithRegion.LocaleCollecto } @Override public HashSet<String> getIgnoredLocaleList(boolean translatedOnly) { HashSet<String> langTagsToIgnore = new HashSet<>(); public Set<String> getIgnoredLocaleList(boolean translatedOnly) { Set<String> langTagsToIgnore = new HashSet<>(); if (mAppCurrentLocale != null) { langTagsToIgnore.add(mAppCurrentLocale.getLocale().toLanguageTag()); Loading core/java/com/android/internal/app/LocaleCollectorBase.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /** * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.app; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; /** * The interface which provides the locale list. */ public interface LocaleCollectorBase { /** Gets the ignored locale list. */ Set<String> getIgnoredLocaleList(boolean translatedOnly); /** Gets the supported locale list. */ Set<LocaleStore.LocaleInfo> getSupportedLocaleList(LocaleStore.LocaleInfo parent, boolean translatedOnly, boolean isForCountryMode); /** Indicates if the class work for specific package. */ boolean hasSpecificPackageName(); } core/java/com/android/internal/app/LocalePickerWithRegion.java +3 −15 Original line number Diff line number Diff line Loading @@ -44,7 +44,10 @@ import java.util.Set; * <p>It shows suggestions at the top, then the rest of the locales. * Allows the user to search for locales using both their native name and their name in the * default locale.</p> * * @deprecated use SettingLib's widget instead of customized UIs. */ @Deprecated public class LocalePickerWithRegion extends ListFragment implements SearchView.OnQueryTextListener { private static final String TAG = LocalePickerWithRegion.class.getSimpleName(); private static final String PARENT_FRAGMENT_NAME = "localeListEditor"; Loading Loading @@ -78,21 +81,6 @@ public class LocalePickerWithRegion extends ListFragment implements SearchView.O default void onParentLocaleSelected(LocaleStore.LocaleInfo locale) {} } /** * The interface which provides the locale list. */ interface LocaleCollectorBase { /** Gets the ignored locale list. */ HashSet<String> getIgnoredLocaleList(boolean translatedOnly); /** Gets the supported locale list. */ Set<LocaleStore.LocaleInfo> getSupportedLocaleList(LocaleStore.LocaleInfo parent, boolean translatedOnly, boolean isForCountryMode); /** Indicates if the class work for specific package. */ boolean hasSpecificPackageName(); } private static LocalePickerWithRegion createNumberingSystemPicker( LocaleSelectedListener listener, LocaleStore.LocaleInfo parent, boolean translatedOnly, OnActionExpandListener onActionExpandListener, Loading core/java/com/android/internal/app/SystemLocaleCollector.java +4 −4 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import java.util.HashSet; import java.util.Set; /** The Locale data collector for System language. */ class SystemLocaleCollector implements LocalePickerWithRegion.LocaleCollectorBase { public class SystemLocaleCollector implements LocaleCollectorBase { private final Context mContext; private LocaleList mExplicitLocales; Loading @@ -32,14 +32,14 @@ class SystemLocaleCollector implements LocalePickerWithRegion.LocaleCollectorBas this(context, null); } SystemLocaleCollector(Context context, LocaleList explicitLocales) { public SystemLocaleCollector(Context context, LocaleList explicitLocales) { mContext = context; mExplicitLocales = explicitLocales; } @Override public HashSet<String> getIgnoredLocaleList(boolean translatedOnly) { HashSet<String> ignoreList = new HashSet<>(); public Set<String> getIgnoredLocaleList(boolean translatedOnly) { Set<String> ignoreList = new HashSet<>(); if (!translatedOnly) { final LocaleList userLocales = LocalePicker.getLocales(); final String[] langTags = userLocales.toLanguageTags().split(","); Loading Loading
core/java/com/android/internal/app/AppLocaleCollector.java +3 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ import java.util.Set; import java.util.stream.Collectors; /** The Locale data collector for per-app language. */ public class AppLocaleCollector implements LocalePickerWithRegion.LocaleCollectorBase { public class AppLocaleCollector implements LocaleCollectorBase { private static final String TAG = AppLocaleCollector.class.getSimpleName(); private final Context mContext; private final String mAppPackageName; Loading Loading @@ -167,8 +167,8 @@ public class AppLocaleCollector implements LocalePickerWithRegion.LocaleCollecto } @Override public HashSet<String> getIgnoredLocaleList(boolean translatedOnly) { HashSet<String> langTagsToIgnore = new HashSet<>(); public Set<String> getIgnoredLocaleList(boolean translatedOnly) { Set<String> langTagsToIgnore = new HashSet<>(); if (mAppCurrentLocale != null) { langTagsToIgnore.add(mAppCurrentLocale.getLocale().toLanguageTag()); Loading
core/java/com/android/internal/app/LocaleCollectorBase.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /** * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.app; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; /** * The interface which provides the locale list. */ public interface LocaleCollectorBase { /** Gets the ignored locale list. */ Set<String> getIgnoredLocaleList(boolean translatedOnly); /** Gets the supported locale list. */ Set<LocaleStore.LocaleInfo> getSupportedLocaleList(LocaleStore.LocaleInfo parent, boolean translatedOnly, boolean isForCountryMode); /** Indicates if the class work for specific package. */ boolean hasSpecificPackageName(); }
core/java/com/android/internal/app/LocalePickerWithRegion.java +3 −15 Original line number Diff line number Diff line Loading @@ -44,7 +44,10 @@ import java.util.Set; * <p>It shows suggestions at the top, then the rest of the locales. * Allows the user to search for locales using both their native name and their name in the * default locale.</p> * * @deprecated use SettingLib's widget instead of customized UIs. */ @Deprecated public class LocalePickerWithRegion extends ListFragment implements SearchView.OnQueryTextListener { private static final String TAG = LocalePickerWithRegion.class.getSimpleName(); private static final String PARENT_FRAGMENT_NAME = "localeListEditor"; Loading Loading @@ -78,21 +81,6 @@ public class LocalePickerWithRegion extends ListFragment implements SearchView.O default void onParentLocaleSelected(LocaleStore.LocaleInfo locale) {} } /** * The interface which provides the locale list. */ interface LocaleCollectorBase { /** Gets the ignored locale list. */ HashSet<String> getIgnoredLocaleList(boolean translatedOnly); /** Gets the supported locale list. */ Set<LocaleStore.LocaleInfo> getSupportedLocaleList(LocaleStore.LocaleInfo parent, boolean translatedOnly, boolean isForCountryMode); /** Indicates if the class work for specific package. */ boolean hasSpecificPackageName(); } private static LocalePickerWithRegion createNumberingSystemPicker( LocaleSelectedListener listener, LocaleStore.LocaleInfo parent, boolean translatedOnly, OnActionExpandListener onActionExpandListener, Loading
core/java/com/android/internal/app/SystemLocaleCollector.java +4 −4 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import java.util.HashSet; import java.util.Set; /** The Locale data collector for System language. */ class SystemLocaleCollector implements LocalePickerWithRegion.LocaleCollectorBase { public class SystemLocaleCollector implements LocaleCollectorBase { private final Context mContext; private LocaleList mExplicitLocales; Loading @@ -32,14 +32,14 @@ class SystemLocaleCollector implements LocalePickerWithRegion.LocaleCollectorBas this(context, null); } SystemLocaleCollector(Context context, LocaleList explicitLocales) { public SystemLocaleCollector(Context context, LocaleList explicitLocales) { mContext = context; mExplicitLocales = explicitLocales; } @Override public HashSet<String> getIgnoredLocaleList(boolean translatedOnly) { HashSet<String> ignoreList = new HashSet<>(); public Set<String> getIgnoredLocaleList(boolean translatedOnly) { Set<String> ignoreList = new HashSet<>(); if (!translatedOnly) { final LocaleList userLocales = LocalePicker.getLocales(); final String[] langTags = userLocales.toLanguageTags().split(","); Loading