From 126d3d065a88c7c01bc9fa38f9eecf09716fb6a2 Mon Sep 17 00:00:00 2001 From: Anne Rong Date: Thu, 17 Sep 2015 15:03:23 -0700 Subject: Move CallerInfo.getGeoDescription to PhoneNumberUtil in Dialer. Bug: 23350280 Change-Id: I531bde77a0d9eeb26d3a803c006317e99b13f99b --- InCallUI/src/com/android/incallui/CallerInfo.java | 38 +---------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'InCallUI/src/com/android/incallui') diff --git a/InCallUI/src/com/android/incallui/CallerInfo.java b/InCallUI/src/com/android/incallui/CallerInfo.java index c7f032345..54cee0f05 100644 --- a/InCallUI/src/com/android/incallui/CallerInfo.java +++ b/InCallUI/src/com/android/incallui/CallerInfo.java @@ -461,43 +461,7 @@ public class CallerInfo { */ public void updateGeoDescription(Context context, String fallbackNumber) { String number = TextUtils.isEmpty(phoneNumber) ? fallbackNumber : phoneNumber; - geoDescription = getGeoDescription(context, number); - } - - /** - * @return a geographical description string for the specified number. - * @see com.android.i18n.phonenumbers.PhoneNumberOfflineGeocoder - */ - private static String getGeoDescription(Context context, String number) { - Log.v(TAG, "getGeoDescription('" + number + "')..."); - - if (TextUtils.isEmpty(number)) { - return null; - } - - PhoneNumberUtil util = PhoneNumberUtil.getInstance(); - PhoneNumberOfflineGeocoder geocoder = PhoneNumberOfflineGeocoder.getInstance(); - - Locale locale = context.getResources().getConfiguration().locale; - String countryIso = TelephonyManagerUtils.getCurrentCountryIso(context, locale); - PhoneNumber pn = null; - try { - Log.v(TAG, "parsing '" + number - + "' for countryIso '" + countryIso + "'..."); - pn = util.parse(number, countryIso); - Log.v(TAG, "- parsed number: " + pn); - } catch (NumberParseException e) { - Log.v(TAG, "getGeoDescription: NumberParseException for incoming number '" + - number + "'"); - } - - if (pn != null) { - String description = geocoder.getDescriptionForNumber(pn, locale); - Log.v(TAG, "- got description: '" + description + "'"); - return description; - } - - return null; + geoDescription = com.android.dialer.util.PhoneNumberUtil.getGeoDescription(context, number); } /** -- cgit v1.2.3