diff options
author | Eric Erfanian <erfanian@google.com> | 2017-03-21 10:11:17 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-03-21 10:11:17 -0700 |
commit | fc37b02f5d3381a7882770941e461b13b679b6ef (patch) | |
tree | 23ce96100a89f1cf8847a4967efd35e56b6f8092 /java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | |
parent | 30ccc4f3aa6da94f0bb8a01a880a6353b883b263 (diff) |
Update AOSP Dialer source from internal google3 repository at
cl/150756069
Test: make, treehugger
This CL updates the AOSP Dialer source with all the changes that have
gone into the private google3 repository. This includes all the
changes from cl/150392808 (3/16/2017) to cl/150756069 (3/21/2017).
This goal of these drops is to keep the AOSP source in sync with the
internal google3 repository. Currently these sync are done by hand
with very minor modifications to the internal source code.
See the Android.mk file for list of modifications.
Our current goal is to do frequent drops (daily if possible) and
eventually switched to an automated process.
Change-Id: I0888b5db52efb28eb8194600e0c7804592f975f3
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 89ed95c0b..6a3187fa8 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -769,21 +769,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder quickContactView.setImageDrawable(mContext.getDrawable(R.drawable.blocked_contact)); return; } - final boolean isVoicemail = mCallLogCache.isVoicemailNumber(accountHandle, number); - int contactType = ContactPhotoManager.TYPE_DEFAULT; - if (isVoicemail) { - contactType = ContactPhotoManager.TYPE_VOICEMAIL; - } else if (isBusiness) { - contactType = ContactPhotoManager.TYPE_BUSINESS; - } else if (numberPresentation == TelecomManager.PRESENTATION_RESTRICTED) { - contactType = ContactPhotoManager.TYPE_GENERIC_AVATAR; - } 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 */); + new DefaultImageRequest(displayName, lookupKey, getContactType(), true /* isCircular */); if (info.photoId == 0 && info.photoUri != null) { ContactPhotoManager.getInstance(mContext) @@ -805,6 +796,18 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } } + private int getContactType() { + int contactType = ContactPhotoManager.TYPE_DEFAULT; + if (mCallLogCache.isVoicemailNumber(accountHandle, number)) { + contactType = ContactPhotoManager.TYPE_VOICEMAIL; + } else if (isBusiness) { + contactType = ContactPhotoManager.TYPE_BUSINESS; + } else if (numberPresentation == TelecomManager.PRESENTATION_RESTRICTED) { + contactType = ContactPhotoManager.TYPE_GENERIC_AVATAR; + } + return contactType; + } + @Override public void onClick(View view) { if (view.getId() == R.id.primary_action_button && !TextUtils.isEmpty(voicemailUri)) { @@ -815,14 +818,13 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder CallSubjectDialog.start( (Activity) mContext, info.photoId, - info.photoUri, info.lookupUri, (String) nameOrNumber /* top line of contact view in call subject dialog */, - isBusiness, number, TextUtils.isEmpty(info.name) ? null : displayNumber, /* second line of contact view in dialog. */ numberType, /* phone number type (e.g. mobile) in second line of contact view */ + getContactType(), accountHandle); } else if (view.getId() == R.id.block_report_action) { Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_BLOCK_REPORT_SPAM); @@ -881,7 +883,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder contact.photoUri = info.photoUri == null ? null : info.photoUri.toString(); contact.contactUri = info.lookupUri == null ? null : info.lookupUri.toString(); contact.nameOrNumber = (String) nameOrNumber; - contact.isBusiness = isBusiness; + contact.contactType = getContactType(); contact.number = number; /* second line of contact view. */ contact.displayNumber = TextUtils.isEmpty(info.name) ? null : displayNumber; |