[Panlingual] Fix duplicated locale show on suggested group
- When User select 2 same locale but different region, current logic will also check 2 times and add these same results into cache. - Use hashSet to resolve this problem Bug: 220804297 Test: local Test: atest pass Change-Id: I60c63a1eb570373fd714cf9b29ed926d15b2daa7
This commit is contained in:
@@ -48,6 +48,7 @@ import com.android.settingslib.widget.RadioButtonPreference;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@@ -292,7 +293,7 @@ public class AppLocaleDetails extends AppInfoBase implements RadioButtonPreferen
|
||||
});
|
||||
|
||||
// Other locales in suggested languages group.
|
||||
Collection<Locale> supportedSystemLocales = new ArrayList<>();
|
||||
Collection<Locale> supportedSystemLocales = new HashSet<>();
|
||||
getCurrentSystemLocales().forEach(systemLocale -> {
|
||||
mAppSupportedLocales.forEach(supportedLocale -> {
|
||||
if (compareLocale(systemLocale, supportedLocale)) {
|
||||
|
Reference in New Issue
Block a user