diff options
author | Anne Rong <annerong@google.com> | 2015-09-18 17:28:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-09-18 17:28:38 +0000 |
commit | 3cf50edd29f372657192ebdaf9ca197c74fe94ad (patch) | |
tree | 3e4fa3ca72b7756ea3b7d33cc4d7ab3351bf387c /InCallUI | |
parent | 78205527bd51fda09f0698afcc9654888b9da667 (diff) | |
parent | 126d3d065a88c7c01bc9fa38f9eecf09716fb6a2 (diff) |
Merge "Move CallerInfo.getGeoDescription to PhoneNumberUtil in Dialer." into ub-contactsdialer-a-dev
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallerInfo.java | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/InCallUI/src/com/android/incallui/CallerInfo.java b/InCallUI/src/com/android/incallui/CallerInfo.java index f15cb5d49..5de03d871 100644 --- a/InCallUI/src/com/android/incallui/CallerInfo.java +++ b/InCallUI/src/com/android/incallui/CallerInfo.java @@ -466,43 +466,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); } /** |