summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/calllog/CallLogAdapter.java
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-08-26 15:46:10 -0700
committerYorke Lee <yorkelee@google.com>2013-08-28 10:02:45 -0700
commit034a2b329e469bf6888fbbcf91992f974015c2a8 (patch)
tree98b175320a6b1e3ce21aaae21a0e37def986407d /src/com/android/dialer/calllog/CallLogAdapter.java
parent0baa98b5163f83a715b37e3cffe1488ac88ab049 (diff)
Use contacts cache in call log adapter
Bug: 10490038 Change-Id: I4c7fc5094f76dfaaa321bc69d595f37bb72f87ad
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogAdapter.java')
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 15c9b05a6..da29bbd87 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -372,7 +372,8 @@ public class CallLogAdapter extends GroupingListAdapter
// view.
NumberWithCountryIso numberCountryIso = new NumberWithCountryIso(number, countryIso);
ContactInfo existingInfo = mContactInfoCache.getPossiblyExpired(numberCountryIso);
- boolean updated = (existingInfo != ContactInfo.EMPTY) && !info.equals(existingInfo);
+
+ boolean updated = !info.equals(existingInfo);
// Store the data in the cache so that the UI thread can use to display it. Store it
// even if it has not changed so that it is marked as not expired.
@@ -587,6 +588,7 @@ public class CallLogAdapter extends GroupingListAdapter
final int ntype = info.type;
final String label = info.label;
final long photoId = info.photoId;
+ final Uri photoUri = info.photoUri;
CharSequence formattedNumber = info.formattedNumber;
final int[] callTypes = getCallTypes(c, count);
final String geocode = c.getString(CallLogQuery.GEOCODED_LOCATION);
@@ -607,7 +609,12 @@ public class CallLogAdapter extends GroupingListAdapter
final boolean isHighlighted = isNew;
mCallLogViewsHelper.setPhoneCallDetails(views, details, isHighlighted,
mUseCallAsPrimaryAction);
- setPhoto(views, photoId, lookupUri);
+
+ if (photoId == 0 && photoUri != null) {
+ setPhoto(views, photoUri, lookupUri);
+ } else {
+ setPhoto(views, photoId, lookupUri);
+ }
// Listen for the first draw
if (mViewTreeObserver == null) {
@@ -731,6 +738,13 @@ public class CallLogAdapter extends GroupingListAdapter
mContactPhotoManager.loadThumbnail(views.quickContactView, photoId, false /* darkTheme */);
}
+ private void setPhoto(CallLogListItemViews views, Uri photoUri, Uri contactUri) {
+ views.quickContactView.assignContactUri(contactUri);
+ mContactPhotoManager.loadDirectoryPhoto(views.quickContactView, photoUri,
+ false /* darkTheme */);
+ }
+
+
/**
* Sets whether processing of requests for contact details should be enabled.
* <p>