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

Commit 80b57419 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Fix LocalePicker locale filtering.

This was broken by commit b27c1370 which
removed a badly phrased check. Prior to that commit,
there was a check that excluded locales whose toString()
length was not 5.

This change reinstates that check in a less roundabout
way, by excluding BCP-47 tags that don't have a country
subtag.

bug: 16038949

Change-Id: Ic24b1df87b2e2ce47d9ae04c7759088721f27b4f
parent 104da1e4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -131,7 +131,8 @@ public class LocalePicker extends ListFragment {
        final ArrayList<LocaleInfo> localeInfos = new ArrayList<LocaleInfo>(localeList.size());
        for (String locale : localeList) {
            final Locale l = Locale.forLanguageTag(locale.replace('_', '-'));
            if (l == null || "und".equals(l.getLanguage())) {
            if (l == null || "und".equals(l.getLanguage())
                    || l.getLanguage().isEmpty() || l.getCountry().isEmpty()) {
                continue;
            }