summaryrefslogtreecommitdiff
path: root/InCallUI/src
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-05-27 15:55:36 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-05-27 15:55:36 +0000
commita87d642f626ffb4764a2565faf78f67673a28ac3 (patch)
tree7fae6f0db0ba0840aff179c5910696e8c7a9219b /InCallUI/src
parenta5c41b1e225a98b37ca150478e54c963c044d1b2 (diff)
parentb337d1f4a970f7e7f5b596804089367a6948350b (diff)
Merge "IMS-VT: Bring UI to foreground once video call is accepted" into nyc-mr1-dev am: 7febc2b7bc
am: b337d1f4a9 * commit 'b337d1f4a970f7e7f5b596804089367a6948350b': IMS-VT: Bring UI to foreground once video call is accepted Change-Id: I403c60ee23369e0e5c2433e7b806e55a3edc79f3
Diffstat (limited to 'InCallUI/src')
-rw-r--r--InCallUI/src/com/android/incallui/VideoPauseController.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/VideoPauseController.java b/InCallUI/src/com/android/incallui/VideoPauseController.java
index 01b6b0dea..fb873500e 100644
--- a/InCallUI/src/com/android/incallui/VideoPauseController.java
+++ b/InCallUI/src/com/android/incallui/VideoPauseController.java
@@ -248,26 +248,27 @@ class VideoPauseController implements InCallStateListener, IncomingCallListener
*/
public void onUiShowing(boolean showing) {
// Only send pause/unpause requests if we are in the INCALL state.
- if (mInCallPresenter == null || mInCallPresenter.getInCallState() != InCallState.INCALL) {
+ if (mInCallPresenter == null) {
return;
}
-
+ final boolean isInCall = mInCallPresenter.getInCallState() == InCallState.INCALL;
if (showing) {
- onResume();
+ onResume(isInCall);
} else {
- onPause();
+ onPause(isInCall);
}
}
/**
* Called when UI is brought to the foreground. Sends a session modification request to resume
* the outgoing video.
+ * @param isInCall true if phone state is INCALL, false otherwise
*/
- private void onResume() {
+ private void onResume(boolean isInCall) {
log("onResume");
mIsInBackground = false;
- if (canVideoPause(mPrimaryCallContext)) {
+ if (canVideoPause(mPrimaryCallContext) && isInCall) {
sendRequest(mPrimaryCallContext.getCall(), true);
} else {
log("onResume. Ignoring...");
@@ -277,12 +278,13 @@ class VideoPauseController implements InCallStateListener, IncomingCallListener
/**
* Called when UI is sent to the background. Sends a session modification request to pause the
* outgoing video.
+ * @param isInCall true if phone state is INCALL, false otherwise
*/
- private void onPause() {
+ private void onPause(boolean isInCall) {
log("onPause");
mIsInBackground = true;
- if (canVideoPause(mPrimaryCallContext)) {
+ if (canVideoPause(mPrimaryCallContext) && isInCall) {
sendRequest(mPrimaryCallContext.getCall(), false);
} else {
log("onPause, Ignoring...");