diff options
author | Tyler Gunn <tgunn@google.com> | 2016-05-10 21:42:37 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-05-10 21:42:37 +0000 |
commit | a474c857fa71b0eea9a56296368e6a3c0b2f0055 (patch) | |
tree | 3dab12545103a71cce0178b52d85c4261d279adb /InCallUI/src/com/android | |
parent | 8f8d7f99d82dd58a76dd9af72ed3deb1e65bd822 (diff) | |
parent | 6f10f26b628d0ae477d599e3ee153a4a336254fe (diff) |
Cleanup of video pause button. am: ebef6b9403
am: 6f10f26b62
* commit '6f10f26b628d0ae477d599e3ee153a4a336254fe':
Cleanup of video pause button.
Change-Id: I06ca4dd53a57ab0d06457e01345595d5fd333fa3
Diffstat (limited to 'InCallUI/src/com/android')
3 files changed, 24 insertions, 9 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 5a25b6a7b..6b633eaf3 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -65,7 +65,6 @@ public class CallButtonFragment implements CallButtonPresenter.CallButtonUi, OnMenuItemClickListener, OnDismissListener, View.OnClickListener { - private static final int INVALID_INDEX = -1; private int mButtonMaxVisible; // The button is currently visible in the UI private static final int BUTTON_VISIBLE = 1; @@ -182,7 +181,7 @@ public class CallButtonFragment super.onActivityCreated(savedInstanceState); // set the buttons - updateAudioButtons(getPresenter().getSupportedAudio()); + updateAudioButtons(); } @Override @@ -425,8 +424,14 @@ public class CallButtonFragment } @Override - public void setVideoPaused(boolean isPaused) { - mPauseVideoButton.setSelected(isPaused); + public void setVideoPaused(boolean isVideoPaused) { + mPauseVideoButton.setSelected(isVideoPaused); + + if (isVideoPaused) { + mPauseVideoButton.setContentDescription(getText(R.string.onscreenTurnOnCameraText)); + } else { + mPauseVideoButton.setContentDescription(getText(R.string.onscreenTurnOffCameraText)); + } } @Override @@ -505,7 +510,7 @@ public class CallButtonFragment @Override public void setAudio(int mode) { - updateAudioButtons(getPresenter().getSupportedAudio()); + updateAudioButtons(); refreshAudioModePopup(); if (mPrevAudioMode != mode) { @@ -516,7 +521,7 @@ public class CallButtonFragment @Override public void setSupportedAudio(int modeMask) { - updateAudioButtons(modeMask); + updateAudioButtons(); refreshAudioModePopup(); } @@ -555,7 +560,7 @@ public class CallButtonFragment public void onDismiss(PopupMenu menu) { Log.d(this, "- onDismiss: " + menu); mAudioModePopupVisible = false; - updateAudioButtons(getPresenter().getSupportedAudio()); + updateAudioButtons(); } /** @@ -600,7 +605,7 @@ public class CallButtonFragment * Updates the audio button so that the appriopriate visual layers * are visible based on the supported audio formats. */ - private void updateAudioButtons(int supportedModes) { + private void updateAudioButtons() { final boolean bluetoothSupported = isSupported(CallAudioState.ROUTE_BLUETOOTH); final boolean speakerSupported = isSupported(CallAudioState.ROUTE_SPEAKER); diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index e8c2d4b13..df1cd6645 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -366,7 +366,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto private void updateButtonsState(Call call) { Log.v(this, "updateButtonsState"); final CallButtonUi ui = getUi(); - final boolean isVideo = VideoUtils.isVideoCall(call); // Common functionality (audio, hold, etc). @@ -398,6 +397,9 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto ui.showButton(BUTTON_DOWNGRADE_TO_AUDIO, showDowngradeToAudio); ui.showButton(BUTTON_SWITCH_CAMERA, isVideo); ui.showButton(BUTTON_PAUSE_VIDEO, isVideo); + if (isVideo) { + getUi().setVideoPaused(!VideoUtils.isTransmissionEnabled(call)); + } ui.showButton(BUTTON_DIALPAD, true); ui.showButton(BUTTON_MERGE, showMerge); diff --git a/InCallUI/src/com/android/incallui/VideoUtils.java b/InCallUI/src/com/android/incallui/VideoUtils.java index 8641d60ec..a2eb8bcf2 100644 --- a/InCallUI/src/com/android/incallui/VideoUtils.java +++ b/InCallUI/src/com/android/incallui/VideoUtils.java @@ -45,6 +45,14 @@ public class VideoUtils { return VideoProfile.isBidirectional(call.getVideoState()); } + public static boolean isTransmissionEnabled(Call call) { + if (!CompatUtils.isVideoCompatible()) { + return false; + } + + return VideoProfile.isTransmissionEnabled(call.getVideoState()); + } + public static boolean isIncomingVideoCall(Call call) { if (!VideoUtils.isVideoCall(call)) { return false; |