Delay computing of PhoneNumber as much as possible.
Computing PhoneNumber is an expensive operation. We want to make that
asynchronous and it is currently only used together with the offline
geocoder, which also needs to be asynchronous.
Therefore, delay the call to generate a PhoneNumer until it is actually
needed, i.e., at the same time as computing the geocode. This means we
only need to make one call asynchronous instead of many.
Change-Id: Iebebf098be713281b2976c72506e480466fb65d4
diff --git a/src/com/android/contacts/PhoneCallDetailsHelper.java b/src/com/android/contacts/PhoneCallDetailsHelper.java
index db3928e..2c36cec 100644
--- a/src/com/android/contacts/PhoneCallDetailsHelper.java
+++ b/src/com/android/contacts/PhoneCallDetailsHelper.java
@@ -118,7 +118,9 @@
mPhoneNumberHelper.getDisplayNumber(details.number, details.formattedNumber);
if (TextUtils.isEmpty(details.name)) {
nameText = displayNumber;
- numberText = mPhoneNumberHelper.getGeocodeForNumber(details.structuredPhoneNumber);
+ numberText = mPhoneNumberHelper.getGeocodeForNumber(
+ mPhoneNumberHelper.parsePhoneNumber(
+ details.number.toString(), details.countryIso));
} else {
nameText = details.name;
if (numberFormattedLabel != null) {