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/PhoneCallDetails.java b/src/com/android/contacts/PhoneCallDetails.java
index 0672673..347a303 100644
--- a/src/com/android/contacts/PhoneCallDetails.java
+++ b/src/com/android/contacts/PhoneCallDetails.java
@@ -16,8 +16,6 @@
 
 package com.android.contacts;
 
-import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
-
 import android.net.Uri;
 import android.provider.CallLog.Calls;
 import android.provider.ContactsContract.CommonDataKinds.Phone;
@@ -30,8 +28,8 @@
     public final CharSequence number;
     /** The formatted version of {@link #number}. */
     public final CharSequence formattedNumber;
-    /** The structured phone number corresponding to {@link #number}. */
-    public final PhoneNumber structuredPhoneNumber;
+    /** The country corresponding with the phone number. */
+    public final String countryIso;
     /**
      * The type of calls, as defined in the call log table, e.g., {@link Calls#INCOMING_TYPE}.
      * <p>
@@ -58,19 +56,18 @@
 
     /** Create the details for a call with a number not associated with a contact. */
     public PhoneCallDetails(CharSequence number, CharSequence formattedNumber,
-            PhoneNumber structuredPhoneNumber, int[] callTypes, long date, long duration) {
-        this(number, formattedNumber, structuredPhoneNumber, callTypes, date, duration,
-                "", 0, "", -1L, null);
+            String countryIso, int[] callTypes, long date, long duration) {
+        this(number, formattedNumber, countryIso, callTypes, date, duration, "", 0, "", -1L, null);
     }
 
     /** Create the details for a call with a number associated with a contact. */
     public PhoneCallDetails(CharSequence number, CharSequence formattedNumber,
-            PhoneNumber structuredPhoneNumber, int[] callTypes, long date, long duration,
+            String countryIso, int[] callTypes, long date, long duration,
             CharSequence name, int numberType, CharSequence numberLabel, long personId,
             Uri photoUri) {
         this.number = number;
         this.formattedNumber = formattedNumber;
-        this.structuredPhoneNumber = structuredPhoneNumber;
+        this.countryIso = countryIso;
         this.callTypes = callTypes;
         this.date = date;
         this.duration = duration;