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

Commit 1b14a5f1 authored by Allen Su's avatar Allen Su
Browse files

Add API to check country availability

Bug: 411286970
Test: by manual
Flag: EXEMPT bug fix
Change-Id: I75ac725ae88f7a2f892f511c80e5cf17339221f6
parent 0783180e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public class LocaleStore {
    private static final HashMap<String, LocaleInfo> sLocaleCache = new HashMap<>();
    private static final String TAG = LocaleStore.class.getSimpleName();
    private static boolean sFullyInitialized = false;
    private static boolean sLocationAvailable = false;

    public static class LocaleInfo implements Serializable {
        public static final int SUGGESTION_TYPE_NONE = 0;
@@ -317,6 +318,13 @@ public class LocaleStore {
        return result;
    }

    /**
     * @return whether SIM country or network country code is available during locale initialization
     */
    public static boolean isSimOrNwCountryAvailable() {
        return sLocationAvailable;
    }

    /*
     * This method is added for SetupWizard, to force an update of the suggested locales
     * when the SIM is initialized.
@@ -463,6 +471,7 @@ public class LocaleStore {
        }

        Set<String> simCountries = getSimCountries(context);
        sLocationAvailable = !simCountries.isEmpty();

        final boolean isInDeveloperMode = Settings.Global.getInt(context.getContentResolver(),
                Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;