diff options
Diffstat (limited to 'InCallUI/src/com/android')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index b327ed64c..9a7c9855d 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -251,11 +251,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> maybeShowManageConferenceCallButton(); maybeShowProgressSpinner(); - final boolean enableEndCallButton = Call.State.isConnectingOrConnected(callState) && - callState != Call.State.INCOMING && mPrimary != null; // Hide the end call button instantly if we're receiving an incoming call. - getUi().setEndCallButtonEnabled( - enableEndCallButton, callState != Call.State.INCOMING /* animate */); + getUi().setEndCallButtonEnabled(shouldShowEndCallButton(mPrimary, callState), + callState != Call.State.INCOMING /* animate */); } @Override @@ -741,6 +739,20 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return photo; } + private boolean shouldShowEndCallButton(Call primary, int callState) { + if (primary == null) { + return false; + } + if (!Call.State.isConnectingOrConnected(callState) || callState == Call.State.INCOMING) { + return false; + } + if (mPrimary.getSessionModificationState() + == Call.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) { + return false; + } + return true; + } + public interface CallCardUi extends Ui { void setVisible(boolean on); void setCallCardVisible(boolean visible); |