diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-10-13 00:53:28 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-13 00:53:28 +0000 |
commit | cf83cae3d3cc0d6a53498da88a9ad834fb2ab589 (patch) | |
tree | c6158cfe9b4b20045379729644be60d3da9bd128 /java/com/android/dialer | |
parent | 5f57e30484848b7b0b8d3fbdfe8b32338aa641a5 (diff) | |
parent | 6939a5ec25be640f97d8be5ef4fe999182cdf2f6 (diff) |
Merge "Set the secondary action to be a voice call when the primary action is a video call."
Diffstat (limited to 'java/com/android/dialer')
-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. |