summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2016-02-09 16:40:53 +0000
committer Paul Duffin <paulduffin@google.com> 2016-02-09 16:40:53 +0000
commitc2884fe2597e4db2879c62f101da9c40d3cb2435 (patch)
tree7e07a5be4a10a4625280c075b40bdd8f13274231
parent857b65657d453801e9b73f998043603456dac813 (diff)
Replace usages of ShortNumberUtil with ShortNumberInfo
The ShortNumberInfo class appears to support the exact same methods as the ShortNumberUtil class (at least in terms of the methods used by this project) but is a singleton and so instances cannot be created directly but instead must be retrieved using the static getInstance() method. The ShortNumberUtil class was deprecated in version 5.8 and removed in 7.2.3 of libphonenumber. This change is required in order to allow libphonenumber to be upgraded to 7.2.4. Bug: 26975810 Change-Id: Ide40c65d12cb44453f84600fc4b5ad1ee1088470
-rw-r--r--telephony/java/android/telephony/PhoneNumberUtils.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index b430340a8963..6ca9a1590dd1 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -20,7 +20,7 @@ import com.android.i18n.phonenumbers.NumberParseException;
import com.android.i18n.phonenumbers.PhoneNumberUtil;
import com.android.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat;
import com.android.i18n.phonenumbers.Phonenumber.PhoneNumber;
-import com.android.i18n.phonenumbers.ShortNumberUtil;
+import com.android.i18n.phonenumbers.ShortNumberInfo;
import android.content.Context;
import android.content.Intent;
@@ -1918,11 +1918,11 @@ public class PhoneNumberUtils
// No ecclist system property, so use our own list.
if (defaultCountryIso != null) {
- ShortNumberUtil util = new ShortNumberUtil();
+ ShortNumberInfo info = ShortNumberInfo.getInstance();
if (useExactMatch) {
- return util.isEmergencyNumber(number, defaultCountryIso);
+ return info.isEmergencyNumber(number, defaultCountryIso);
} else {
- return util.connectsToEmergencyNumber(number, defaultCountryIso);
+ return info.connectsToEmergencyNumber(number, defaultCountryIso);
}
}