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

Commit 835b42e7 authored by Tom Hsu's avatar Tom Hsu Committed by Android (Google) Code Review
Browse files

Merge "[Regional Preference] Fix subtitle overlap"

parents af2570af 108162b8
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -141,8 +141,9 @@ public class LocaleStore {
        @UnsupportedAppUsage
        public String getFullNameNative() {
            if (mFullNameNative == null) {
                Locale locale = mLocale.stripExtensions();
                mFullNameNative =
                        LocaleHelper.getDisplayName(mLocale, mLocale, true /* sentence case */);
                        LocaleHelper.getDisplayName(locale, locale, true /* sentence case */);
            }
            return mFullNameNative;
        }
@@ -563,6 +564,22 @@ 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);
                LocaleInfo localeInfo = sLocaleCache.get(filteredLocale.toLanguageTag());
                // This locale is included in supported locales, so follow the settings
                // of supported locales.
                result.mIsPseudo = localeInfo.mIsPseudo;
                result.mIsTranslated = localeInfo.mIsTranslated;
                result.mSuggestionFlags = localeInfo.mSuggestionFlags;
                return result;
            }
            result = new LocaleInfo(locale);
            sLocaleCache.put(id, result);
        } else {