Merge "Modify the deprecation of PhoneNumberUtil isEmergencyNumber"
This commit is contained in:
@@ -2016,7 +2016,16 @@ public class PhoneNumberUtils {
|
|||||||
private static boolean isEmergencyNumberInternal(int subId, String number,
|
private static boolean isEmergencyNumberInternal(int subId, String number,
|
||||||
String defaultCountryIso,
|
String defaultCountryIso,
|
||||||
boolean useExactMatch) {
|
boolean useExactMatch) {
|
||||||
|
try {
|
||||||
|
if (useExactMatch) {
|
||||||
return TelephonyManager.getDefault().isEmergencyNumber(number);
|
return TelephonyManager.getDefault().isEmergencyNumber(number);
|
||||||
|
} else {
|
||||||
|
return TelephonyManager.getDefault().isPotentialEmergencyNumber(number);
|
||||||
|
}
|
||||||
|
} catch (RuntimeException ex) {
|
||||||
|
Rlog.e(LOG_TAG, "isEmergencyNumberInternal: RuntimeException: " + ex);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user