diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-12-15 22:15:38 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-15 22:15:38 +0000 |
commit | 1f9a42626218934ec68926b5553ff387c5f0bf21 (patch) | |
tree | f60094677bd3449691253e42be1fc3bddce50009 /java/com/android/dialer/app/calllog | |
parent | 35770d48c3f62667a40c110bb8ddadb34080b379 (diff) | |
parent | 72cb3fd79471c8193b3b54b83653200852aae5d0 (diff) |
Merge "Hide "Invite" and "Set up" Duo buttons for spam and voicemail calls"
Diffstat (limited to 'java/com/android/dialer/app/calllog')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 0aa46c561..babf1f8ca 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -359,15 +359,15 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } public static CallLogListItemViewHolder createForTest(Context context) { - return createForTest(context, null, null); + return createForTest(context, null, null, new CallLogCache(context)); } public static CallLogListItemViewHolder createForTest( Context context, View.OnClickListener expandCollapseListener, - VoicemailPlaybackPresenter voicemailPlaybackPresenter) { + VoicemailPlaybackPresenter voicemailPlaybackPresenter, + CallLogCache callLogCache) { Resources resources = context.getResources(); - CallLogCache callLogCache = new CallLogCache(context); PhoneCallDetailsHelper phoneCallDetailsHelper = new PhoneCallDetailsHelper(context, resources, callLogCache); @@ -661,6 +661,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder callButtonView.setVisibility(View.VISIBLE); } + boolean isVoicemailNumber = mCallLogCache.isVoicemailNumber(accountHandle, number); + switch (callbackAction) { case CallbackAction.IMS_VIDEO: case CallbackAction.DUO: @@ -677,13 +679,21 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder && (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall())) { videoCallButtonView.setTag(IntentProvider.getReturnVideoCallIntentProvider(number)); videoCallButtonView.setVisibility(View.VISIBLE); - } else if (duo.isReachable(mContext, number)) { + break; + } + + if (isVoicemailNumber) { + break; + } + + boolean identifiedSpamCall = isSpamFeatureEnabled && isSpam; + if (duo.isReachable(mContext, number)) { videoCallButtonView.setTag(IntentProvider.getDuoVideoIntentProvider(number)); videoCallButtonView.setVisibility(View.VISIBLE); - } else if (duo.isActivated(mContext)) { + } else if (duo.isActivated(mContext) && !identifiedSpamCall) { inviteVideoButtonView.setTag(IntentProvider.getDuoInviteIntentProvider(number)); inviteVideoButtonView.setVisibility(View.VISIBLE); - } else if (duo.isEnabled(mContext)) { + } else if (duo.isEnabled(mContext) && !identifiedSpamCall) { if (!duo.isInstalled(mContext)) { setUpVideoButtonView.setTag(IntentProvider.getInstallDuoIntentProvider()); } else { @@ -730,7 +740,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } boolean isBlockedOrSpam = blockId != null || (isSpamFeatureEnabled && isSpam); - + if (!isBlockedOrSpam && info != null && UriUtils.isEncodedContactUri(info.lookupUri)) { createNewContactButtonView.setTag( IntentProvider.getAddContactIntentProvider( @@ -746,7 +756,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder addToExistingContactButtonView.setVisibility(View.GONE); } - boolean isVoicemailNumber = mCallLogCache.isVoicemailNumber(accountHandle, number); if (canPlaceCallToNumber && !isBlockedOrSpam && !isVoicemailNumber) { sendMessageView.setTag(IntentProvider.getSendSmsIntentProvider(number)); sendMessageView.setVisibility(View.VISIBLE); |