Use Contact URIs instead of contact ids.
Contact ids are not guaranteed to be stable.
Instead use a contact URI (which contains both a lookup key and a
contact id, used only as a hint).
This change is needed for caching, since we do not what to cache the
unstable contact ids.
Bug: 5101753
Change-Id: I34814c8935e706ee898adcedc39c4baeea147d67
diff --git a/src/com/android/contacts/PhoneCallDetails.java b/src/com/android/contacts/PhoneCallDetails.java
index 5718091..78ac9b3 100644
--- a/src/com/android/contacts/PhoneCallDetails.java
+++ b/src/com/android/contacts/PhoneCallDetails.java
@@ -48,10 +48,10 @@
public final int numberType;
/** The custom label associated with the phone number in the contact, or the empty string. */
public final CharSequence numberLabel;
- /** The id of the contact associated with this phone call. */
- public final long personId;
+ /** The URI of the contact associated with this phone call. */
+ public final Uri contactUri;
/**
- * The photo uri of the picture of the contact that is associated with this phone call or
+ * The photo URI of the picture of the contact that is associated with this phone call or
* null if there is none.
*/
public final Uri photoUri;
@@ -60,13 +60,13 @@
public PhoneCallDetails(CharSequence number, CharSequence formattedNumber,
String countryIso, String geocode, int[] callTypes, long date, long duration) {
this(number, formattedNumber, countryIso, geocode, callTypes, date, duration, "", 0, "",
- -1L, null);
+ null, null);
}
/** Create the details for a call with a number associated with a contact. */
public PhoneCallDetails(CharSequence number, CharSequence formattedNumber,
String countryIso, String geocode, int[] callTypes, long date, long duration,
- CharSequence name, int numberType, CharSequence numberLabel, long personId,
+ CharSequence name, int numberType, CharSequence numberLabel, Uri contactUri,
Uri photoUri) {
this.number = number;
this.formattedNumber = formattedNumber;
@@ -78,7 +78,7 @@
this.name = name;
this.numberType = numberType;
this.numberLabel = numberLabel;
- this.personId = personId;
+ this.contactUri = contactUri;
this.photoUri = photoUri;
}
}