This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
io/flutter/embedding/engine
test/io/flutter/plugin/localization Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1212,7 +1212,7 @@ public String[] computePlatformResolvedLocale(@NonNull String[] strings) {
1212
1212
String languageCode = strings [i + 0 ];
1213
1213
String countryCode = strings [i + 1 ];
1214
1214
String scriptCode = strings [i + 2 ];
1215
- // Convert to Locales via LocaleBuilder if available (API 24 +) to include scriptCode.
1215
+ // Convert to Locales via LocaleBuilder if available (API 21 +) to include scriptCode.
1216
1216
if (Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .LOLLIPOP ) {
1217
1217
Locale .Builder localeBuilder = new Locale .Builder ();
1218
1218
if (!languageCode .isEmpty ()) {
@@ -1226,7 +1226,7 @@ public String[] computePlatformResolvedLocale(@NonNull String[] strings) {
1226
1226
}
1227
1227
supportedLocales .add (localeBuilder .build ());
1228
1228
} else {
1229
- // Pre-API 24 , we fall back on scriptCode-less locales.
1229
+ // Pre-API 21 , we fall back on scriptCode-less locales.
1230
1230
supportedLocales .add (new Locale (languageCode , countryCode ));
1231
1231
}
1232
1232
}
Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ public void computePlatformResolvedLocaleAPI26() {
140
140
141
141
// This test should be synced with the version for API 26.
142
142
@ Test
143
- @ Config (sdk = Build .VERSION_CODES .N )
144
- public void computePlatformResolvedLocaleAPI24 () {
143
+ @ Config (minSdk = Build .VERSION_CODES .N )
144
+ public void computePlatformResolvedLocale_fromAndroidN () {
145
145
// --- Test Setup ---
146
146
FlutterJNI flutterJNI = new FlutterJNI ();
147
147
@@ -235,8 +235,8 @@ public void computePlatformResolvedLocaleAPI24() {
235
235
236
236
// Tests the legacy pre API 24 algorithm.
237
237
@ Test
238
- @ Config (sdk = Build .VERSION_CODES .JELLY_BEAN )
239
- public void computePlatformResolvedLocaleAPI16 () {
238
+ @ Config (minSdk = Build .VERSION_CODES .JELLY_BEAN , maxSdk = Build . VERSION_CODES . M )
239
+ public void computePlatformResolvedLocale_beforeAndroidN () {
240
240
// --- Test Setup ---
241
241
FlutterJNI flutterJNI = new FlutterJNI ();
242
242
You can’t perform that action at this time.
0 commit comments