From c2884fe2597e4db2879c62f101da9c40d3cb2435 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 9 Feb 2016 16:40:53 +0000 Subject: [PATCH] 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 --- telephony/java/android/telephony/PhoneNumberUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index b430340a89634..6ca9a1590dd13 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); } }