diff options
author | Garik Badalyan <garikb@codeaurora.org> | 2016-05-12 14:14:33 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2016-05-26 17:45:46 +0000 |
commit | d72aab710bdb44ec641399b5898ab003e6611fad (patch) | |
tree | 681f04a2a6ecf1290fa92e3e0bddcf76877d638a /InCallUI/src/com/android | |
parent | f6ce2079891bdcddd9902c7254a7327e43925c56 (diff) |
IMS-VT: Bring UI to foreground once video call is accepted
- If the user pushes the UI to the background immediately
after making a video call, it stays in the background even
after the request has been accepted
- After the remote device accepts the incoming video call request,
bring the UI to the foreground
Bug: 28767075
Change-Id: Iba2ebdd3c7f7e77fc8fe7ffc68897cbb6dd8610d
Diffstat (limited to 'InCallUI/src/com/android')
-rw-r--r-- | InCallUI/src/com/android/incallui/VideoPauseController.java | 18 |
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..."); |