Home
last modified time | relevance | path

Searched refs:locales (Results 1 – 25 of 120) sorted by relevance

12345

/frameworks/base/services/tests/servicestests/src/com/android/server/textservices/
DLocaleUtilsTest.java49 final ArrayList<Locale> locales = in testGetSuitableLocalesForSpellChecker() local
51 assertEquals(3, locales.size()); in testGetSuitableLocalesForSpellChecker()
52 assertEquals(LOCALE_EN_US, locales.get(0)); in testGetSuitableLocalesForSpellChecker()
53 assertEquals(LOCALE_EN_GB, locales.get(1)); in testGetSuitableLocalesForSpellChecker()
54 assertEquals(LOCALE_EN, locales.get(2)); in testGetSuitableLocalesForSpellChecker()
58 final ArrayList<Locale> locales = in testGetSuitableLocalesForSpellChecker() local
60 assertEquals(3, locales.size()); in testGetSuitableLocalesForSpellChecker()
61 assertEquals(LOCALE_EN_GB, locales.get(0)); in testGetSuitableLocalesForSpellChecker()
62 assertEquals(LOCALE_EN_US, locales.get(1)); in testGetSuitableLocalesForSpellChecker()
63 assertEquals(LOCALE_EN, locales.get(2)); in testGetSuitableLocalesForSpellChecker()
[all …]
/frameworks/base/services/core/java/com/android/server/textservices/
DLocaleUtils.java100 final ArrayList<Locale> locales = new ArrayList<>(); in getSuitableLocalesForSpellChecker() local
102 locales.add(systemLocaleLanguageCountryVariant); in getSuitableLocalesForSpellChecker()
114 locales.add(systemLocaleLanguageCountry); in getSuitableLocalesForSpellChecker()
117 locales.add(Locale.US); in getSuitableLocalesForSpellChecker()
120 locales.add(Locale.UK); in getSuitableLocalesForSpellChecker()
122 locales.add(Locale.ENGLISH); in getSuitableLocalesForSpellChecker()
129 locales.add(Locale.ENGLISH); in getSuitableLocalesForSpellChecker()
130 locales.add(Locale.US); in getSuitableLocalesForSpellChecker()
131 locales.add(Locale.UK); in getSuitableLocalesForSpellChecker()
141 locales.add(systemLocaleLanguageCountry); in getSuitableLocalesForSpellChecker()
[all …]
/frameworks/base/services/core/java/com/android/server/locales/
DLocaleManagerShellCommand.java17 package com.android.server.locales;
102 LocaleList locales = LocaleList.getEmptyLocaleList(); in runSetAppLocales() local
115 locales = parseLocales(); in runSetAppLocales()
129 mBinderService.setApplicationLocales(packageName, userId, locales, fromDelegate); in runSetAppLocales()
162 LocaleList locales = mBinderService.getApplicationLocales(packageName, userId); in runGetAppLocales() local
164 + " for user " + userId + " are [" + locales.toLanguageTags() + "]"); in runGetAppLocales()
183 LocaleList locales = null; in runSetAppOverrideLocaleConfig() local
195 locales = parseOverrideLocales(); in runSetAppOverrideLocaleConfig()
205 LocaleConfig localeConfig = locales == null ? null : new LocaleConfig(locales); in runSetAppOverrideLocaleConfig()
242 LocaleList locales = localeConfig.getSupportedLocales(); in runGetAppOverrideLocaleConfig() local
[all …]
DLocaleManagerService.java17 package com.android.server.locales;
184 @NonNull LocaleList locales, boolean fromDelegate) throws RemoteException { in setApplicationLocales() argument
188 LocaleManagerService.this.setApplicationLocales(appPackageName, userId, locales, in setApplicationLocales()
232 @NonNull LocaleList locales, boolean fromDelegate, int caller) in setApplicationLocales() argument
238 requireNonNull(locales); in setApplicationLocales()
240 atomRecordForMetrics.setNewLocales(locales.toLanguageTags()); in setApplicationLocales()
259 locales.isEmpty()); in setApplicationLocales()
262 setApplicationLocalesUnchecked(appPackageName, userId, locales, in setApplicationLocales()
273 @UserIdInt int userId, @NonNull LocaleList locales, in setApplicationLocalesUnchecked() argument
285 boolean isConfigChanged = updater.setLocales(locales).commit(); in setApplicationLocalesUnchecked()
[all …]
DAppLocaleChangedAtomRecord.java17 package com.android.server.locales;
67 private String convertEmptyLocales(String locales) { in convertEmptyLocales() argument
68 String target = locales; in convertEmptyLocales()
69 if ("".equals(locales)) { in convertEmptyLocales()
/frameworks/minikin/libs/minikin/
DLocaleListCache.cpp110 size_t LocaleListCache::LocaleVectorHash::operator()(const std::vector<Locale>& locales) const { in operator ()()
112 for (const auto& locale : locales) { in operator ()()
128 uint32_t LocaleListCache::getIdInternal(const std::string& locales) { in getIdInternal() argument
130 const auto& it = mLocaleListStringCache.find(locales); in getIdInternal()
134 uint32_t id = getIdInternal(parseLocaleList(locales)); in getIdInternal()
135 mLocaleListStringCache.emplace(locales, id); in getIdInternal()
139 uint32_t LocaleListCache::getIdInternal(std::vector<Locale>&& locales) { in getIdInternal() argument
140 if (locales.empty()) { in getIdInternal()
143 const auto& it = mLocaleListLookupTable.find(locales); in getIdInternal()
150 mLocaleListLookupTable.emplace(locales, nextId); in getIdInternal()
[all …]
DLocaleListCache.h36 static inline uint32_t getId(const std::string& locales) { in getId() argument
37 return getInstance().getIdInternal(locales); in getId()
55 size_t operator()(const std::vector<Locale>& locales) const;
61 uint32_t getIdInternal(const std::string& locales);
62 uint32_t getIdInternal(std::vector<Locale>&& locales) EXCLUSIVE_LOCKS_REQUIRED(mMutex);
/frameworks/minikin/fuzz/locale_fuzzer/
Dlocale_fuzzer.cpp35 const LocaleList& locales = LocaleListCache::getById(localeListId); in LLVMFuzzerTestOneInput() local
38 for (size_t i = 0; i < locales.size(); i++) { in LLVMFuzzerTestOneInput()
39 locales[i].getPartialLocale(fdp.PickValueInArray(subtangBits)); in LLVMFuzzerTestOneInput()
40 locales[i].supportsScript(fdp.ConsumeIntegral<uint32_t>()); in LLVMFuzzerTestOneInput()
41 locales[i].calcScoreFor(locales); in LLVMFuzzerTestOneInput()
/frameworks/base/core/java/android/app/
DLocaleManager.java75 public void setApplicationLocales(@NonNull LocaleList locales) { in setApplicationLocales() argument
76 setApplicationLocales(mContext.getPackageName(), locales, false); in setApplicationLocales() local
104 public void setApplicationLocales(@NonNull String appPackageName, @NonNull LocaleList locales) { in setApplicationLocales() argument
105 setApplicationLocales(appPackageName, locales, true); in setApplicationLocales()
108 private void setApplicationLocales(@NonNull String appPackageName, @NonNull LocaleList locales, in setApplicationLocales() argument
111 mService.setApplicationLocales(appPackageName, mContext.getUserId(), locales, in setApplicationLocales()
181 public void setSystemLocales(@NonNull LocaleList locales) { in setSystemLocales() argument
184 conf.setLocales(locales); in setSystemLocales()
/frameworks/minikin/tests/unittest/
DFontLanguageListCacheTest.cpp54 const LocaleList& locales = LocaleListCache::getById(LocaleListCache::getId("en")); in TEST() local
55 ASSERT_EQ(1UL, locales.size()); in TEST()
56 EXPECT_EQ(english, locales[0]); in TEST()
65 std::string locales[] = {"en", "jp", "en,zh-Hans"}; in TEST() local
68 for (const std::string& locale : locales) { in TEST()
74 for (const std::string& locale : locales) { in TEST()
79 for (const std::string& locale : locales) { in TEST()
/frameworks/base/telephony/java/android/telephony/mbms/
DServiceInfo.java46 private final List<Locale> locales; field in ServiceInfo
69 locales = new ArrayList(newLocales); in ServiceInfo()
92 locales = new ArrayList<Locale>(localesCount); in ServiceInfo()
95 locales.add(l); in ServiceInfo()
111 int localesCount = locales.size(); in writeToParcel()
113 for (Locale l : locales) { in writeToParcel()
159 return locales; in getLocales()
195 Objects.equals(locales, that.locales) && in equals()
203 return Objects.hash(names, className, locales, serviceId, sessionStartTime, sessionEndTime); in hashCode()
/frameworks/base/tests/Internal/src/com/android/internal/app/
DLocaleStoreTest.java97 Locale[] locales = {Locale.forLanguageTag(""), Locale.forLanguageTag("en-US")}; in convertExplicitLocales_hasEmptyLocale_receiveException() local
98 LocaleList localelist = new LocaleList(locales); in convertExplicitLocales_hasEmptyLocale_receiveException()
113 LocaleList locales = LocaleList.forLanguageTags("en-US,en-US"); in convertExplicitLocales_hasSameLocale_returnNonSameLocales() local
117 LocaleStore.convertExplicitLocales(locales, supportedLocale); in convertExplicitLocales_hasSameLocale_returnNonSameLocales()
125 LocaleList locales = LocaleList.forLanguageTags("en-US,ja-JP"); in convertExplicitLocales_hasEnUs_resultHasParentEn() local
129 LocaleStore.convertExplicitLocales(locales, supportedLocale); in convertExplicitLocales_hasEnUs_resultHasParentEn()
136 LocaleList locales = LocaleList.forLanguageTags("zh-TW,en-US,en"); in convertExplicitLocales_hasZhTw_resultZhHantTw() local
140 LocaleStore.convertExplicitLocales(locales, supportedLocale); in convertExplicitLocales_hasZhTw_resultZhHantTw()
147 LocaleList locales = LocaleList.forLanguageTags("de-1996,de-1901"); in convertExplicitLocales_nonRegularFormat_resultEmptyContry() local
151 LocaleStore.convertExplicitLocales(locales, supportedLocale); in convertExplicitLocales_nonRegularFormat_resultEmptyContry()
[all …]
/frameworks/base/tests/LocalizationTest/java/com/android/internal/app/
DLocalizationTest.kt76 val locales = LocalePicker.getSupportedLocales(mContext) in testGetSupportedLocales_invalidFilter() constant
78 assertThat(locales).isEqualTo(mUnfilteredLocales) in testGetSupportedLocales_invalidFilter()
85 val locales = LocalePicker.getSupportedLocales(mContext) in testGetSupportedLocales_inclusiveFilter() constant
87 assertThat(locales).isEqualTo( in testGetSupportedLocales_inclusiveFilter()
98 val locales = LocalePicker.getSupportedLocales(mContext) in testGetSupportedLocales_exclusiveFilter() constant
100 assertThat(locales).isEqualTo( in testGetSupportedLocales_exclusiveFilter()
/frameworks/base/core/java/android/text/style/
DLocaleSpan.java62 public LocaleSpan(@NonNull LocaleList locales) { in LocaleSpan() argument
63 Preconditions.checkNotNull(locales, "locales cannot be null"); in LocaleSpan()
64 mLocales = locales; in LocaleSpan()
126 private static void apply(@NonNull Paint paint, @NonNull LocaleList locales) { in apply() argument
127 paint.setTextLocales(locales); in apply()
/frameworks/base/core/java/com/android/internal/app/
DLocalePicker.java143 final String[] locales = getSystemAssetLocales(); in getAllAssetLocales() local
144 List<String> localeList = new ArrayList<String>(locales.length); in getAllAssetLocales()
145 Collections.addAll(localeList, locales); in getAllAssetLocales()
309 public static void updateLocales(LocaleList locales) {
310 if (locales != null) {
311 locales = removeExcludedLocales(locales);
318 config.setLocales(locales);
331 private static LocaleList removeExcludedLocales(@NonNull LocaleList locales) {
334 return locales;
337 int localeCount = locales.size();
[all …]
DLocaleHelper.java147 LocaleList locales, Locale displayLocale, @IntRange(from=1) int maxLocales) { in getDisplayLocaleList() argument
151 final boolean ellipsisNeeded = locales.size() > maxLocales; in getDisplayLocaleList()
157 listCount = localeCount = locales.size(); in getDisplayLocaleList()
161 localeNames[i] = LocaleHelper.getDisplayName(locales.get(i), dispLocale, false); in getDisplayLocaleList()
DAppLocaleStore.java94 String[] locales = packageManager.getResourcesForApplication( in getAssetLocales() local
97 if (locales == null) { in getAssetLocales()
99 } else if (locales.length <= 0) { in getAssetLocales()
102 for (String language : locales) { in getAssetLocales()
/frameworks/base/services/tests/servicestests/src/com/android/server/locales/
DLocaleManagerServiceTest.java17 package com.android.server.locales;
277 LocaleList locales = mLocaleManagerService.getApplicationLocales( in testGetApplicationLocales_appSpecificConfigAbsent_returnsEmptyList() local
280 assertEquals(LocaleList.getEmptyLocaleList(), locales); in testGetApplicationLocales_appSpecificConfigAbsent_returnsEmptyList() local
293 LocaleList locales = mLocaleManagerService.getApplicationLocales( in testGetApplicationLocales_appSpecificLocalesAbsent_returnsEmptyList() local
296 assertEquals(LocaleList.getEmptyLocaleList(), locales); in testGetApplicationLocales_appSpecificLocalesAbsent_returnsEmptyList() local
308 LocaleList locales = in testGetApplicationLocales_callerOwnsAppAndConfigPresent_returnsLocales() local
311 assertEquals(DEFAULT_LOCALES, locales); in testGetApplicationLocales_callerOwnsAppAndConfigPresent_returnsLocales()
324 LocaleList locales = in testGetApplicationLocales_arbitraryCallerWithPermissions_returnsLocales() local
327 assertEquals(DEFAULT_LOCALES, locales); in testGetApplicationLocales_arbitraryCallerWithPermissions_returnsLocales()
341 LocaleList locales = in testGetApplicationLocales_callerIsInstaller_returnsLocales() local
[all …]
DFakePackageConfigurationUpdater.java17 package com.android.server.locales;
44 public PackageConfigurationUpdater setLocales(LocaleList locales) { in setLocales() argument
45 mLocales = locales; in setLocales()
/frameworks/proto_logging/stats/atoms/locale/
Dlocale_atoms.proto27 * Logs when an override of app-specific supported locales is changed.
29 * frameworks/base/services/core/java/com/android/server/locales/LocaleManagerService.java
35 // The uid for which the override of app’s supported locales change is being done.
38 // The total number of locales in the override LocaleConfig.
53 // Application supported locales changed status.
58 // New override of supported locales is set successfully.
/frameworks/base/core/java/android/view/
DWindowInfo.java64 public LocaleList locales = LocaleList.getEmptyLocaleList(); field in WindowInfo
105 window.locales = other.locales; in obtain()
143 parcel.writeParcelable(locales, flags); in writeToParcel()
168 builder.append(", locales=").append(locales); in toString()
196 locales = parcel.readParcelable(null, LocaleList.class); in initFromParcel()
220 locales = LocaleList.getEmptyLocaleList(); in clear()
/frameworks/base/core/tests/coretests/src/android/content/res/
DResourcesLocaleTest.java70 final Resources resources = createResourcesWithApk(R.raw.locales); in testEnglishIsAlwaysConsideredSupported()
87 final Resources resources = createResourcesWithApk(R.raw.locales); in testSelectFirstSupportedLanguage()
115 LocaleList locales = new LocaleList(locale); in assertResGetString() local
117 config.setLocales(locales); in assertResGetString()
/frameworks/base/core/java/android/os/
DLocaleList.java567 public static void setDefault(@NonNull @Size(min=1) LocaleList locales) { in setDefault()
568 setDefault(locales, 0); in setDefault()
580 public static void setDefault(@NonNull @Size(min=1) LocaleList locales, int localeIndex) { in setDefault()
581 if (locales == null) { in setDefault()
584 if (locales.isEmpty()) { in setDefault()
588 sLastDefaultLocale = locales.get(localeIndex); in setDefault()
590 sLastExplicitlySetLocaleList = locales; in setDefault()
591 sDefaultLocaleList = locales; in setDefault()
/frameworks/opt/telephony/src/java/com/android/internal/telephony/util/
DLocaleUtils.java88 List<String> locales = new ArrayList<>(Arrays.asList(localeArray)); in getLocaleForLanguageCountry() local
91 locales.remove("ar-XB"); in getLocaleForLanguageCountry()
92 locales.remove("en-XA"); in getLocaleForLanguageCountry()
95 for (String locale : locales) { in getLocaleForLanguageCountry()
/frameworks/base/libs/androidfw/tests/
DAssetManager2_bench.cpp194 std::set<std::string> locales = in BM_AssetManagerGetResourceLocales() local
196 benchmark::DoNotOptimize(locales); in BM_AssetManagerGetResourceLocales()
212 Vector<String8> locales; in BM_AssetManagerGetResourceLocalesOld() local
213 table.getLocales(&locales, true /*includeSystemLocales*/, true /*mergeEquivalentLangs*/); in BM_AssetManagerGetResourceLocalesOld()
214 benchmark::DoNotOptimize(locales); in BM_AssetManagerGetResourceLocalesOld()

12345