diff options
author | Gilles Franck Mevaa <gillesd@google.com> | 2016-03-03 01:13:26 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-03-03 01:13:26 +0000 |
commit | ee9552eca9cd2692124f4eb0aea628871992910e (patch) | |
tree | 6f249766fc953dc7f832ce830fb597a2b32735e5 | |
parent | 7210993449b31ee80e56e77bd0acbc1dceea2494 (diff) | |
parent | 79e26069d22c0951eb12682ad6ced19b8576dc14 (diff) |
Merge "CallLogListItemViewHolder distinguishes block/spam numbers" into nyc-dev
am: 79e26069d2
* commit '79e26069d22c0951eb12682ad6ced19b8576dc14':
CallLogListItemViewHolder distinguishes block/spam numbers
-rw-r--r-- | src/com/android/dialer/calllog/CallLogListItemViewHolder.java | 19 | ||||
-rw-r--r-- | src/com/android/dialer/service/ExtendedBlockingButtonRenderer.java | 13 |
2 files changed, 21 insertions, 11 deletions
diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java index 1c2744073..6c252758a 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java +++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java @@ -27,11 +27,9 @@ import android.provider.ContactsContract.CommonDataKinds.Phone; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.telecom.PhoneAccountHandle; -import android.telephony.PhoneNumberUtils; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; import android.text.TextUtils; -import android.util.Log; import android.view.ContextMenu; import android.view.MenuItem; import android.view.View; @@ -66,8 +64,6 @@ import com.android.dialerbind.ObjectFactory; import com.google.common.collect.Lists; import java.util.List; -import java.util.Map; -import java.util.Set; /** * This is an object containing references to views contained by the call log list item. This @@ -625,13 +621,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder public void updatePhoto() { quickContactView.assignContactUri(info.lookupUri); - if (isBlocked && !TextUtils.isEmpty(number) /* maybe a private number ? */) { - quickContactView.setImageDrawable(mContext.getDrawable(R.drawable.blocked_contact)); - phoneCallDetailsViews.callLocationAndDate.setText( - mContext.getString(R.string.blocked_number_call_log_label)); - return; - } - final boolean isVoicemail = mCallLogCache.isVoicemailNumber(accountHandle, number); int contactType = ContactPhotoManager.TYPE_DEFAULT; if (isVoicemail) { @@ -653,6 +642,14 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder ContactPhotoManager.getInstance(mContext).loadThumbnail(quickContactView, info.photoId, false /* darkTheme */, true /* isCircular */, request); } + + if (mExtendedBlockingButtonRenderer != null) { + mExtendedBlockingButtonRenderer.updatePhotoAndLabelIfNecessary( + number, + countryIso, + quickContactView, + phoneCallDetailsViews.callLocationAndDate); + } } @Override diff --git a/src/com/android/dialer/service/ExtendedBlockingButtonRenderer.java b/src/com/android/dialer/service/ExtendedBlockingButtonRenderer.java index 5ff373288..f8d5ea048 100644 --- a/src/com/android/dialer/service/ExtendedBlockingButtonRenderer.java +++ b/src/com/android/dialer/service/ExtendedBlockingButtonRenderer.java @@ -19,6 +19,8 @@ package com.android.dialer.service; import android.support.annotation.Nullable; import android.view.View; import android.view.ViewStub; +import android.widget.QuickContactBadge; +import android.widget.TextView; import java.util.List; @@ -70,4 +72,15 @@ public interface ExtendedBlockingButtonRenderer { void render(ViewStub viewStub); void setViewHolderInfo(ViewHolderInfo info); + + /** + * Updates the photo and label for the given phone number and country iso. + * + * @param number Phone number for which the rendering occurs. + * @param countryIso Two-letter country code. + * @param badge {@link QuickContactBadge} in which the photo should be rendered. + * @param view Textview that will hold the new label. + */ + void updatePhotoAndLabelIfNecessary( + String number, String countryIso, QuickContactBadge badge, TextView view); } |