From 188b42fd10644373175fc204b48da98125004985 Mon Sep 17 00:00:00 2001 From: twyen Date: Thu, 11 Jan 2018 16:03:11 -0800 Subject: 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 --- java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java') diff --git a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java index 7482efdea..5b526b49d 100644 --- a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java +++ b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java @@ -20,6 +20,7 @@ import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.provider.CallLog.Calls; +import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.View; @@ -134,13 +135,18 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder { ContactPhotoManager.getInstance(context) .loadDialerThumbnailOrPhoto( quickContactBadge, - TextUtils.isEmpty(row.lookupUri()) ? null : Uri.parse(row.lookupUri()), - row.photoId(), - TextUtils.isEmpty(row.photoUri()) ? null : Uri.parse(row.photoUri()), + parseUri(row.numberAttributes().getLookupUri()), + row.numberAttributes().getPhotoId(), + parseUri(row.numberAttributes().getPhotoUri()), CallLogEntryText.buildPrimaryText(context, row).toString(), CallLogContactTypes.getContactType(row)); } + @Nullable + private static Uri parseUri(@Nullable String uri) { + return TextUtils.isEmpty(uri) ? null : Uri.parse(uri); + } + private void setPrimaryCallTypes(CoalescedRow row) { primaryCallTypeIconsView.setShowHd( (row.features() & Calls.FEATURES_HD_CALL) == Calls.FEATURES_HD_CALL); -- cgit v1.2.3