diff options
author | twyen <twyen@google.com> | 2018-01-11 16:03:11 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-11 17:02:52 -0800 |
commit | 188b42fd10644373175fc204b48da98125004985 (patch) | |
tree | 9f7434fe8cb3bbf3cffc513225288e9946851745 /java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java | |
parent | 98280255db8824cb58caac596cb4f9febcf57306 (diff) |
Merge PhoneLookupDataSource results into a proto in annotated call log.
This allow extra information from PhoneLookup to be more easily added. Only PhoneLookupSelector and the proto will be affected for new attributes.
Test: Unit tests.
PiperOrigin-RevId: 181675568
Change-Id: I4e0bc1c6005b58a9b684b030b55bea6223af9ce3
Diffstat (limited to 'java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java')
-rw-r--r-- | java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java index 90581580d..46e29956d 100644 --- a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java +++ b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java @@ -27,6 +27,7 @@ import android.graphics.Typeface; import android.net.Uri; import android.provider.VoicemailContract.Voicemails; import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import android.support.annotation.WorkerThread; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; @@ -205,13 +206,18 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On ContactPhotoManager.getInstance(context) .loadDialerThumbnailOrPhoto( quickContactBadge, - voicemailEntry.lookupUri() == null ? null : Uri.parse(voicemailEntry.lookupUri()), - voicemailEntry.photoId(), - voicemailEntry.photoUri() == null ? null : Uri.parse(voicemailEntry.photoUri()), - voicemailEntry.name(), + parseUri(voicemailEntry.numberAttributes().getLookupUri()), + voicemailEntry.numberAttributes().getPhotoId(), + parseUri(voicemailEntry.numberAttributes().getPhotoUri()), + VoicemailEntryText.buildPrimaryVoicemailText(context, voicemailEntry), LetterTileDrawable.TYPE_DEFAULT); } + @Nullable + private static Uri parseUri(@Nullable String string) { + return TextUtils.isEmpty(string) ? null : Uri.parse(string); + } + void collapseViewHolder() { LogUtil.i( "NewVoicemailViewHolder.collapseViewHolder", |