Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 271c3ca8 authored by Zoey Chen's avatar Zoey Chen Committed by Android (Google) Code Review
Browse files

Merge "[Settings] Do not show the locale which is added already" into main

parents f15e98e1 d0c63aef
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ public abstract class LocalePickerBaseListPreferenceController extends
    private Set<LocaleStore.LocaleInfo> mLocaleList;
    private List<LocaleStore.LocaleInfo> mLocaleOptions;
    private Map<String, Preference> mPreferences;
    private String mPackageName;
    private FragmentManager mFragmentManager;
    private boolean mIsCountryMode;
    @Nullable
@@ -174,6 +173,9 @@ public abstract class LocalePickerBaseListPreferenceController extends
                    mContext.getString(R.string.all_supported_numbering_system_title));
        }

        // Remove the locale which is added into system language's list already.
        List<LocaleStore.LocaleInfo> localeList = getUserLocaleList();
        localeInfoList.removeIf(localeInfo -> localeList.contains(localeInfo));
        localeInfoList.stream().forEach(locale ->
        {
            Preference pref = existingPreferences.remove(locale.getId());
@@ -213,10 +215,6 @@ public abstract class LocalePickerBaseListPreferenceController extends
    @Nullable
    protected abstract LocaleList getExplicitLocaleList();

    protected String getPackageName() {
        return mPackageName;
    }

    protected List<LocaleStore.LocaleInfo> getSuggestedLocaleList() {
        setupLocaleList();
        if (mLocaleList != null && !mLocaleList.isEmpty()) {