Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 932184ae authored by Josh Hou's avatar Josh Hou
Browse files

[Panlingual] Fix NPE issue

Set the correct status if there is no LocaleManager service

Bug: 263542003
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppLocalePickerActivityTest
Change-Id: I27b8ad069b76d05b23cbf448262939875741adc9
parent dc01f138
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ public class LocaleConfig implements Parcelable {
    public static final String TAG_LOCALE_CONFIG = "locale-config";
    public static final String TAG_LOCALE = "locale";
    private LocaleList mLocales;
    private int mStatus;
    private int mStatus = STATUS_NOT_SPECIFIED;

    /**
     * succeeded reading the LocaleConfig structure stored in an XML file.
@@ -119,6 +119,7 @@ public class LocaleConfig implements Parcelable {
            LocaleManager localeManager = context.getSystemService(LocaleManager.class);
            if (localeManager == null) {
                Slog.w(TAG, "LocaleManager is null, cannot get the override LocaleConfig");
                mStatus = STATUS_NOT_SPECIFIED;
                return;
            }
            LocaleConfig localeConfig = localeManager.getOverrideLocaleConfig();