Hanlde NPE when context from default phone is null.

Bug: 253630907
Test: Maunal test
Test: atest pass
Change-Id: I577a78d70428e8f438e02115586e5de49d415019
This commit is contained in:
tom hsu
2022-10-17 16:16:30 +08:00
committed by Tom Hsu
parent 02493c976f
commit 4c8fd97334

View File

@@ -100,6 +100,9 @@ public class LocalePicker extends ListFragment {
}
public static String[] getSupportedLocales(Context context) {
if (context == null) {
return new String[0];
}
String[] allLocales = context.getResources().getStringArray(R.array.supported_locales);
Predicate<String> localeFilter = getLocaleFilter();