diff options
author | linyuh <linyuh@google.com> | 2017-10-15 03:10:21 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-15 03:10:21 +0000 |
commit | 8a6c036e9946bdbd643354450a39fdcb0de48ddd (patch) | |
tree | 25ba69efa6991e4380afc0863230102339a557b1 /java | |
parent | 957b00914c4727b03784ffef573c34fdd405b663 (diff) | |
parent | cf83cae3d3cc0d6a53498da88a9ad834fb2ab589 (diff) |
Merge "Set the secondary action to be a voice call when the primary action is a video call."
am: cf83cae3d3
Change-Id: I7a6ee2444a1a623875536bc74309a0577d9ad983
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. |