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

Commit 325e6c45 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Clean up usage of CountryDetector in PhoneNumberUtils" am: 7790a360 am: ae9f5960

Change-Id: Ic127ceb09609b793e9515400d1be06818d2df43d
parents 9c741338 ae9f5960
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.location.CountryDetector;
import android.net.Uri;
import android.os.PersistableBundle;
import android.provider.Contacts;
@@ -2032,6 +2031,7 @@ public class PhoneNumberUtils {
    private static boolean isEmergencyNumberInternal(int subId, String number,
                                                     String defaultCountryIso,
                                                     boolean useExactMatch) {
        // TODO: clean up all the callers that pass in a defaultCountryIso, since it's ignored now.
        try {
            if (useExactMatch) {
                return TelephonyManager.getDefault().isEmergencyNumber(number);
@@ -2193,18 +2193,7 @@ public class PhoneNumberUtils {
    private static boolean isLocalEmergencyNumberInternal(int subId, String number,
                                                          Context context,
                                                          boolean useExactMatch) {
        String countryIso;
        CountryDetector detector = (CountryDetector) context.getSystemService(
                Context.COUNTRY_DETECTOR);
        if (detector != null && detector.detectCountry() != null) {
            countryIso = detector.detectCountry().getCountryIso();
        } else {
            Locale locale = context.getResources().getConfiguration().locale;
            countryIso = locale.getCountry();
            Rlog.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: "
                    + countryIso);
        }
        return isEmergencyNumberInternal(subId, number, countryIso, useExactMatch);
        return isEmergencyNumberInternal(subId, number, null /* unused */, useExactMatch);
    }

    /**