diff options
author | qqzhou <qqzhou@codeaurora.org> | 2014-07-30 21:42:40 +0800 |
---|---|---|
committer | Xiaojing Zhang <zhangx@codeaurora.org> | 2014-11-04 20:35:33 -0800 |
commit | 107cfb041eaa05d5516f74a84f4b0d1377111f64 (patch) | |
tree | 6be6df1aa72b31153e6c7f8845c66cf204e53343 /src/com/android/dialer/calllog/CallLogAdapter.java | |
parent | 95b06497cd04f01a43c88fc4947f69d116758ce1 (diff) | |
download | android_packages_apps_Dialer-107cfb041eaa05d5516f74a84f4b0d1377111f64.tar.gz android_packages_apps_Dialer-107cfb041eaa05d5516f74a84f4b0d1377111f64.tar.bz2 android_packages_apps_Dialer-107cfb041eaa05d5516f74a84f4b0d1377111f64.zip |
Dialer: add SIM photo in call log
- add the SIM photo for call log and frequent&favorite
contacts(speed dial fragment).
Change-Id: I36f723c20a2a4279e3965f72e2f2f6424be34d30
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogAdapter.java')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index dcd2de3c0..8e5fca7d7 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -16,6 +16,7 @@ package com.android.dialer.calllog; +import android.accounts.Account; import android.content.ContentValues; import android.content.Context; import android.content.Intent; @@ -756,6 +757,9 @@ public class CallLogAdapter extends GroupingListAdapter } final PhoneCallDetails details; + final String accountName = info.accountName; + final String accountType = info.accountType; + Account contactAccount; views.reported = info.isBadData; @@ -800,10 +804,15 @@ public class CallLogAdapter extends GroupingListAdapter nameForDefaultImage = name; } + if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountType)) { + contactAccount = new Account(accountName, accountType); + } else { + contactAccount = null; + } if (photoId == 0 && photoUri != null) { - setPhoto(views, photoUri, lookupUri, nameForDefaultImage, lookupKey, contactType); + setPhoto(views, photoUri, lookupUri, nameForDefaultImage, lookupKey, contactType, contactAccount); } else { - setPhoto(views, photoId, lookupUri, nameForDefaultImage, lookupKey, contactType); + setPhoto(views, photoId, lookupUri, nameForDefaultImage, lookupKey, contactType, contactAccount); } // Listen for the first draw @@ -1205,22 +1214,22 @@ public class CallLogAdapter extends GroupingListAdapter } private void setPhoto(CallLogListItemViews views, long photoId, Uri contactUri, - String displayName, String identifier, int contactType) { + String displayName, String identifier, int contactType, Account account) { views.quickContactView.assignContactUri(contactUri); views.quickContactView.setOverlay(null); DefaultImageRequest request = new DefaultImageRequest(displayName, identifier, contactType, true /* isCircular */); - mContactPhotoManager.loadThumbnail(views.quickContactView, photoId, false /* darkTheme */, - true /* isCircular */, request); + mContactPhotoManager.loadThumbnail(views.quickContactView, photoId, account, + false /* darkTheme */, true /* isCircular */, request); } private void setPhoto(CallLogListItemViews views, Uri photoUri, Uri contactUri, - String displayName, String identifier, int contactType) { + String displayName, String identifier, int contactType, Account account) { views.quickContactView.assignContactUri(contactUri); views.quickContactView.setOverlay(null); DefaultImageRequest request = new DefaultImageRequest(displayName, identifier, contactType, true /* isCircular */); - mContactPhotoManager.loadDirectoryPhoto(views.quickContactView, photoUri, + mContactPhotoManager.loadDirectoryPhoto(views.quickContactView, photoUri, account, false /* darkTheme */, true /* isCircular */, request); } |