summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorAnne Rong <annerong@google.com>2015-09-17 15:03:23 -0700
committerAnne Rong <annerong@google.com>2015-09-17 15:03:23 -0700
commit126d3d065a88c7c01bc9fa38f9eecf09716fb6a2 (patch)
tree20bb2645e5ea35507bc8956ecb4a503d1e7d91f0 /InCallUI
parentad9a5f36ed22b45c31fce53f98ce3af00a4df020 (diff)
Move CallerInfo.getGeoDescription to PhoneNumberUtil in Dialer.
Bug: 23350280 Change-Id: I531bde77a0d9eeb26d3a803c006317e99b13f99b
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallerInfo.java38
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 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);
}
/**