Loading core/java/com/android/internal/app/LocaleStore.java +26 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,9 @@ public class LocaleStore { } private boolean isSuggestionOfType(int suggestionMask) { if (!mIsTranslated) { // Never suggest an untranslated locale return false; } return (mSuggestionFlags & suggestionMask) == suggestionMask; } Loading Loading @@ -207,6 +210,27 @@ public class LocaleStore { } } /* * Show all the languages supported for a country in the suggested list. * This is also handy for devices without SIM (tablets). */ private static void addSuggestedLocalesForRegion(Locale locale) { if (locale == null) { return; } final String country = locale.getCountry(); if (country.isEmpty()) { return; } for (LocaleInfo li : sLocaleCache.values()) { if (country.equals(li.getLocale().getCountry())) { // We don't need to differentiate between manual and SIM suggestions li.mSuggestionFlags |= LocaleInfo.SUGGESTION_TYPE_SIM; } } } public static void fillCache(Context context) { if (sFullyInitialized) { return; Loading Loading @@ -256,6 +280,8 @@ public class LocaleStore { li.setTranslated(localizedLocales.contains(li.getLangScriptKey())); } addSuggestedLocalesForRegion(Locale.getDefault()); sFullyInitialized = true; } Loading Loading
core/java/com/android/internal/app/LocaleStore.java +26 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,9 @@ public class LocaleStore { } private boolean isSuggestionOfType(int suggestionMask) { if (!mIsTranslated) { // Never suggest an untranslated locale return false; } return (mSuggestionFlags & suggestionMask) == suggestionMask; } Loading Loading @@ -207,6 +210,27 @@ public class LocaleStore { } } /* * Show all the languages supported for a country in the suggested list. * This is also handy for devices without SIM (tablets). */ private static void addSuggestedLocalesForRegion(Locale locale) { if (locale == null) { return; } final String country = locale.getCountry(); if (country.isEmpty()) { return; } for (LocaleInfo li : sLocaleCache.values()) { if (country.equals(li.getLocale().getCountry())) { // We don't need to differentiate between manual and SIM suggestions li.mSuggestionFlags |= LocaleInfo.SUGGESTION_TYPE_SIM; } } } public static void fillCache(Context context) { if (sFullyInitialized) { return; Loading Loading @@ -256,6 +280,8 @@ public class LocaleStore { li.setTranslated(localizedLocales.contains(li.getLangScriptKey())); } addSuggestedLocalesForRegion(Locale.getDefault()); sFullyInitialized = true; } Loading