diff options
Diffstat (limited to 'src/com/android/dialer/calllog')
4 files changed, 18 insertions, 5 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 8bfe0dec5..914520e84 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -1169,6 +1169,10 @@ public class CallLogAdapter extends GroupingListAdapter values.put(Calls.CACHED_PHOTO_ID, updatedInfo.photoId); needsUpdate = true; } + if (!UriUtils.areEqual(updatedInfo.photoUri, callLogInfo.photoUri)) { + values.put(Calls.CACHED_PHOTO_URI, UriUtils.uriToString(updatedInfo.photoUri)); + needsUpdate = true; + } if (!TextUtils.equals(updatedInfo.formattedNumber, callLogInfo.formattedNumber)) { values.put(Calls.CACHED_FORMATTED_NUMBER, updatedInfo.formattedNumber); needsUpdate = true; @@ -1182,6 +1186,7 @@ public class CallLogAdapter extends GroupingListAdapter values.put(Calls.CACHED_MATCHED_NUMBER, updatedInfo.number); values.put(Calls.CACHED_NORMALIZED_NUMBER, updatedInfo.normalizedNumber); values.put(Calls.CACHED_PHOTO_ID, updatedInfo.photoId); + values.put(Calls.CACHED_PHOTO_URI, UriUtils.uriToString(updatedInfo.photoUri)); values.put(Calls.CACHED_FORMATTED_NUMBER, updatedInfo.formattedNumber); needsUpdate = true; } @@ -1214,7 +1219,7 @@ public class CallLogAdapter extends GroupingListAdapter info.number = matchedNumber == null ? c.getString(CallLogQuery.NUMBER) : matchedNumber; info.normalizedNumber = c.getString(CallLogQuery.CACHED_NORMALIZED_NUMBER); info.photoId = c.getLong(CallLogQuery.CACHED_PHOTO_ID); - info.photoUri = null; // We do not cache the photo URI. + info.photoUri = UriUtils.parseUriOrNull(c.getString(CallLogQuery.CACHED_PHOTO_URI)); info.formattedNumber = c.getString(CallLogQuery.CACHED_FORMATTED_NUMBER); return info; } @@ -1352,7 +1357,7 @@ public class CallLogAdapter extends GroupingListAdapter } else { try { Cursor phonesCursor = mContext.getContentResolver().query( - Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number), + Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI, number), PhoneQuery._PROJECTION, null, null, null); if (phonesCursor != null) { try { diff --git a/src/com/android/dialer/calllog/CallLogQuery.java b/src/com/android/dialer/calllog/CallLogQuery.java index 0ae4cda33..2b43c2857 100644 --- a/src/com/android/dialer/calllog/CallLogQuery.java +++ b/src/com/android/dialer/calllog/CallLogQuery.java @@ -45,7 +45,8 @@ public final class CallLogQuery { Calls.PHONE_ACCOUNT_ID, // 19 Calls.FEATURES, // 20 Calls.DATA_USAGE, // 21 - Calls.TRANSCRIPTION // 22 + Calls.TRANSCRIPTION, // 22 + Calls.CACHED_PHOTO_URI // 23 }; public static final int ID = 0; @@ -71,4 +72,5 @@ public final class CallLogQuery { public static final int FEATURES = 20; public static final int DATA_USAGE = 21; public static final int TRANSCRIPTION = 22; + public static final int CACHED_PHOTO_URI = 23; } diff --git a/src/com/android/dialer/calllog/ContactInfo.java b/src/com/android/dialer/calllog/ContactInfo.java index 7b6014dd1..effe14270 100644 --- a/src/com/android/dialer/calllog/ContactInfo.java +++ b/src/com/android/dialer/calllog/ContactInfo.java @@ -27,6 +27,11 @@ import com.google.common.base.Objects; */ public class ContactInfo { public Uri lookupUri; + + /** + * Contact lookup key. Note this may be a lookup key for a corp contact, in which case + * "lookup by lookup key" doesn't work on the personal profile. + */ public String lookupKey; public String name; public int type; diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java index 3a1144f25..da03b072f 100644 --- a/src/com/android/dialer/calllog/ContactInfoHelper.java +++ b/src/com/android/dialer/calllog/ContactInfoHelper.java @@ -205,7 +205,7 @@ public class ContactInfoHelper { final ContactInfo info; // "contactNumber" is a SIP address, so use the PhoneLookup table with the SIP parameter. - Uri.Builder uriBuilder = PhoneLookup.CONTENT_FILTER_URI.buildUpon(); + Uri.Builder uriBuilder = PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI.buildUpon(); uriBuilder.appendPath(Uri.encode(sipAddress)); uriBuilder.appendQueryParameter(PhoneLookup.QUERY_PARAMETER_SIP_ADDRESS, "1"); return lookupContactFromUri(uriBuilder.build()); @@ -236,7 +236,8 @@ public class ContactInfoHelper { } // The "contactNumber" is a regular phone number, so use the PhoneLookup table. - Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(contactNumber)); + Uri uri = Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI, + Uri.encode(contactNumber)); ContactInfo info = lookupContactFromUri(uri); if (info != null && info != ContactInfo.EMPTY) { info.formattedNumber = formatPhoneNumber(number, null, countryIso); |