diff options
author | roldenburg <roldenburg@google.com> | 2017-07-31 15:38:10 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-01 08:41:20 -0700 |
commit | eeed13831def91d557d10e2c8c84521b20e9271f (patch) | |
tree | 9765d4db7345ff29f72275005f80a63040e95be0 | |
parent | 37450d807ce5cd8df18acc72fb74b256fc8a58b1 (diff) |
Do not show "Call" option for Restricted / Private numbers
These numbers cannot be called back so don't show the button.
Bug: 64103891
Test: GoogleCallLogAdapter
PiperOrigin-RevId: 163758778
Change-Id: Ic5d9bd3abe38ff8a9ac84da6c453c924cb1dd6ca
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 23a00d745..01f13b975 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -551,12 +551,15 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private void bindActionButtons() { boolean canPlaceCallToNumber = PhoneNumberHelper.canPlaceCallsTo(number, numberPresentation); + // Hide the call buttons by default. We then set it to be visible when appropriate below. + // This saves us having to remember to set it to GONE in multiple places. + callButtonView.setVisibility(View.GONE); + videoCallButtonView.setVisibility(View.GONE); + if (isFullyUndialableVoicemail()) { // Sometimes the voicemail server will report the message is from some non phone number // source. If the number does not contains any dialable digit treat it as it is from a unknown // number, remove all action buttons but still show the voicemail playback layout. - callButtonView.setVisibility(View.GONE); - videoCallButtonView.setVisibility(View.GONE); detailsButtonView.setVisibility(View.GONE); createNewContactButtonView.setVisibility(View.GONE); addToExistingContactButtonView.setVisibility(View.GONE); @@ -585,11 +588,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder ((TextView) callButtonView.findViewById(R.id.call_type_or_location_text)); if (canPlaceCallToNumber) { - // Set up the call button but hide it by default (the primary action is to call so it is - // redundant). We then set it to be visible when appropriate below. This saves us having to - // remember to set it to GONE in multiple places. callButtonView.setTag(IntentProvider.getReturnCallIntentProvider(number)); - callButtonView.setVisibility(View.GONE); callTypeOrLocationView.setVisibility(View.GONE); } @@ -617,8 +616,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } else if (lightbringerReady) { videoCallButtonView.setTag(IntentProvider.getLightbringerIntentProvider(number)); videoCallButtonView.setVisibility(View.VISIBLE); - } else { - videoCallButtonView.setVisibility(View.GONE); } // For voicemail calls, show the voicemail playback layout; hide otherwise. |