diff options
author | linyuh <linyuh@google.com> | 2017-10-12 14:32:53 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-10-12 16:03:45 -0700 |
commit | 6939a5ec25be640f97d8be5ef4fe999182cdf2f6 (patch) | |
tree | c6158cfe9b4b20045379729644be60d3da9bd128 /java | |
parent | 5f57e30484848b7b0b8d3fbdfe8b32338aa641a5 (diff) |
Set the secondary action to be a voice call when the primary action is a video call.
Bug: 67717800
Test: GoogleCallLogAdapterTest
PiperOrigin-RevId: 172013208
Change-Id: I86c4ca1ef7caf1899cb9587d98233a9e707b7f3d
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index cf86ef6aa..ca846aebb 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -642,18 +642,29 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder callButtonView.setVisibility(View.VISIBLE); } - // We need to check if we are showing the Lightbringer primary button. If we are, then we should - // show the "Call" button here regardless of IMS availability. - if (showLightbringerPrimaryButton()) { - callButtonView.setVisibility(View.VISIBLE); - videoCallButtonView.setVisibility(View.GONE); - } else if (CallUtil.isVideoEnabled(mContext) - && (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall())) { - videoCallButtonView.setTag(IntentProvider.getReturnVideoCallIntentProvider(number)); - videoCallButtonView.setVisibility(View.VISIBLE); - } else if (lightbringerReady) { - videoCallButtonView.setTag(IntentProvider.getLightbringerIntentProvider(number)); - videoCallButtonView.setVisibility(View.VISIBLE); + switch (callbackAction) { + case CallbackAction.IMS_VIDEO: + case CallbackAction.LIGHTBRINGER: + // For an IMS video call or a Lightbringer call, the secondary action should always be a + // voice callback. + callButtonView.setVisibility(View.VISIBLE); + videoCallButtonView.setVisibility(View.GONE); + break; + case CallbackAction.VOICE: + // For a voice call, set the secondary callback action to be an IMS video call if it is + // available. Otherwise try to set it as a Lightbringer call. + if (CallUtil.isVideoEnabled(mContext) + && (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall())) { + videoCallButtonView.setTag(IntentProvider.getReturnVideoCallIntentProvider(number)); + videoCallButtonView.setVisibility(View.VISIBLE); + } else if (lightbringerReady) { + videoCallButtonView.setTag(IntentProvider.getLightbringerIntentProvider(number)); + videoCallButtonView.setVisibility(View.VISIBLE); + } + break; + default: + callButtonView.setVisibility(View.GONE); + videoCallButtonView.setVisibility(View.GONE); } // For voicemail calls, show the voicemail playback layout; hide otherwise. |