From 6939a5ec25be640f97d8be5ef4fe999182cdf2f6 Mon Sep 17 00:00:00 2001 From: linyuh Date: Thu, 12 Oct 2017 14:32:53 -0700 Subject: 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 --- .../app/calllog/CallLogListItemViewHolder.java | 35 ++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'java') 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. -- cgit v1.2.3