Merge "Modify the deprecation of PhoneNumberUtil isEmergencyNumber"

am: b8c7afacec

Change-Id: I5a41e63ee113447f75178bf3bfd996431046799a
This commit is contained in:
Shuo Qian
2019-04-03 16:04:48 -07:00
committed by android-build-merger

View File

@@ -2016,7 +2016,16 @@ public class PhoneNumberUtils {
private static boolean isEmergencyNumberInternal(int subId, String number,
String defaultCountryIso,
boolean useExactMatch) {
return TelephonyManager.getDefault().isEmergencyNumber(number);
try {
if (useExactMatch) {
return TelephonyManager.getDefault().isEmergencyNumber(number);
} else {
return TelephonyManager.getDefault().isPotentialEmergencyNumber(number);
}
} catch (RuntimeException ex) {
Rlog.e(LOG_TAG, "isEmergencyNumberInternal: RuntimeException: " + ex);
}
return false;
}
/**