diff options
author | Andrew Lee <anwlee@google.com> | 2015-10-07 19:07:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-07 19:07:39 +0000 |
commit | c6720cf6692cf64e1dfb9b99d96039ca87ce41bb (patch) | |
tree | 4c36454d62c1f0389c047090a7569a820307f0fe | |
parent | 5291cf03320e6c873dcfe489fb54adc43c3b437e (diff) | |
parent | 41bf2e4c8c9793d2f218ce1d1835bfa957ba53e4 (diff) |
am 41bf2e4c: Merge "Consolidate setPhoto logic." into ub-contactsdialer-a-dev
* commit '41bf2e4c8c9793d2f218ce1d1835bfa957ba53e4':
Consolidate setPhoto logic.
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 10 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogListItemViewHolder.java | 22 |
2 files changed, 11 insertions, 21 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 90985af42..316864fe2 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -493,15 +493,7 @@ public class CallLogAdapter extends GroupingListAdapter } views.showActions(mCurrentlyExpandedPosition == position); - - String nameForDefaultImage = null; - if (TextUtils.isEmpty(info.name)) { - nameForDefaultImage = details.displayNumber; - } else { - nameForDefaultImage = info.name; - } - views.setPhoto(info.photoId, info.photoUri, info.lookupUri, nameForDefaultImage, - isVoicemailNumber, views.isBusiness); + views.updatePhoto(); mCallLogListItemHelper.setPhoneCallDetails(views, details); } diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java index 30aaee087..5b47d4477 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java +++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java @@ -527,11 +527,11 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder view.setSingleLine(!isExpanded); } - public void setPhoto(long photoId, Uri photoUri, Uri contactUri, String displayName, - boolean isVoicemail, boolean isBusiness) { - quickContactView.assignContactUri(contactUri); + public void updatePhoto() { + quickContactView.assignContactUri(info.lookupUri); quickContactView.setOverlay(null); + final boolean isVoicemail = mTelecomCallLogCache.isVoicemailNumber(accountHandle, number); int contactType = ContactPhotoManager.TYPE_DEFAULT; if (isVoicemail) { contactType = ContactPhotoManager.TYPE_VOICEMAIL; @@ -539,19 +539,17 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder contactType = ContactPhotoManager.TYPE_BUSINESS; } - String lookupKey = null; - if (contactUri != null) { - lookupKey = UriUtils.getLookupKeyFromUri(contactUri); - } - - DefaultImageRequest request = new DefaultImageRequest( + final String lookupKey = info.lookupUri != null + ? UriUtils.getLookupKeyFromUri(info.lookupUri) : null; + final String displayName = TextUtils.isEmpty(info.name) ? displayNumber : info.name; + final DefaultImageRequest request = new DefaultImageRequest( displayName, lookupKey, contactType, true /* isCircular */); - if (photoId == 0 && photoUri != null) { - ContactPhotoManager.getInstance(mContext).loadPhoto(quickContactView, photoUri, + if (info.photoId == 0 && info.photoUri != null) { + ContactPhotoManager.getInstance(mContext).loadPhoto(quickContactView, info.photoUri, mPhotoSize, false /* darkTheme */, true /* isCircular */, request); } else { - ContactPhotoManager.getInstance(mContext).loadThumbnail(quickContactView, photoId, + ContactPhotoManager.getInstance(mContext).loadThumbnail(quickContactView, info.photoId, false /* darkTheme */, true /* isCircular */, request); } } |