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

Commit 5c7c53d0 authored by tom hsu's avatar tom hsu
Browse files

[Regional Preference] Fix subtitle overlap

 - Avoid to generate a new locale with extra U extension.
 - Get correct LocaleInfo from LocaleStore.

Bug: b/267268410
Test: Maunal test passed.
Change-Id: If6ef23f508c4eb7a72900a5d4e70b2f09b858663
parent 2409beff
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -563,6 +563,18 @@ public class LocaleStore {
        String id = locale.toLanguageTag();
        LocaleInfo result;
        if (!sLocaleCache.containsKey(id)) {
            // Locale preferences can modify the language tag to current system languages, so we
            // need to check the input locale without extra u extension except numbering system.
            Locale filteredLocale = new Locale.Builder()
                    .setLocale(locale.stripExtensions())
                    .setUnicodeLocaleKeyword("nu", locale.getUnicodeLocaleType("nu"))
                    .build();
            if (sLocaleCache.containsKey(filteredLocale.toLanguageTag())) {
                result = new LocaleInfo(locale);
                // This locale is included in supported locales, so set translated be true here.
                result.mIsTranslated = true;
                return result;
            }
            result = new LocaleInfo(locale);
            sLocaleCache.put(id, result);
        } else {