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

Add api 21 check to LocalizationChannel.java #7967

Merged
merged 1 commit into from
Feb 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package io.flutter.embedding.engine.systemchannels;

import android.os.Build;
import android.support.annotation.NonNull;

import java.util.ArrayList;
Expand Down Expand Up @@ -35,7 +36,8 @@ public void sendLocales(List<Locale> locales) {
for (Locale locale : locales) {
data.add(locale.getLanguage());
data.add(locale.getCountry());
data.add(locale.getScript());
// locale.getScript() was added in API 21.
data.add(Build.VERSION.SDK_INT >= 21 ? locale.getScript() : "");
data.add(locale.getVariant());
}
channel.invokeMethod("setLocale", data);
Expand Down