Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 09dcc3d

Browse files
authored
Gate locale.getScript() behind version check for android API < 21 (#6592)
1 parent c176244 commit 09dcc3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shell/platform/android/io/flutter/view/FlutterView.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,11 @@ private void setLocales(Configuration config) {
345345
List<String> data = new ArrayList<String>();
346346
data.add(locale.getLanguage());
347347
data.add(locale.getCountry());
348-
data.add(locale.getScript());
348+
if (Build.VERSION.SDK_INT >= 21) {
349+
data.add(locale.getScript());
350+
} else {
351+
data.add("");
352+
}
349353
data.add(locale.getVariant());
350354
mFlutterLocalizationChannel.invokeMethod("setLocale", Arrays.asList(locale.getLanguage(), locale.getCountry(), locale.getScript(), locale.getVariant()));
351355

0 commit comments

Comments
 (0)