summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnne Rong <annerong@google.com>2015-09-18 17:33:29 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-18 17:33:29 +0000
commit63d137e93ed0eed4af5e9197a6137bb31a00cccc (patch)
treee4b7535700b2e71034b441e28d95907158eadec2
parent29bc5e515a857b7b9cd804c7dc841f1148509647 (diff)
parent3cf50edd29f372657192ebdaf9ca197c74fe94ad (diff)
am 3a5e1d8d: Merge "Move CallerInfo.getGeoDescription to PhoneNumberUtil in Dialer." into ub-contactsdialer-a-dev
* commit '3a5e1d8dab007dd1dcd6c7344b26240c0824a85a': Move CallerInfo.getGeoDescription to PhoneNumberUtil in Dialer.
-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 d3a79c9c8..585bb04b2 100644
--- a/InCallUI/src/com/android/incallui/CallerInfo.java
+++ b/InCallUI/src/com/android/incallui/CallerInfo.java
@@ -472,43 +472,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);
}
/**