aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2017-07-05 21:36:48 -0700
committerTyler Gunn <tgunn@google.com>2017-07-07 21:46:55 +0000
commit4a31f55999ff45ac56ab1156a86c0804d788faaa (patch)
treef2a177f65de6ede49b8f0efaeb1e247b670ae340
parentd911029c9e4f8fc3048414ace454f49ccf1ba969 (diff)
downloadims-4a31f55999ff45ac56ab1156a86c0804d788faaa.tar.gz
Change how unpause of video is detected.
ImsVideoCallProviderWrapper was modified recently to check for the case where the video is paused, and the video state changes to an unpaused state. It used this to trigger a clear of the video pause tracker. It did this by checking if the video pause tracker thought the video was paused. In reality, it makes more sense for a change in the videostate from paused to unpaused to be detected, and THAT used as a basis to clear the video pause tracker. The previous functionality caused a problem when the user, in quick succession: 1. Turned off the camera 2. Went to the background. The two requests would hit the framework, causing the video pause tracker to record the current video state as paused (as requested by the user). Shortly thereafter, the modem reports the fact that the camera is off with a state of Audio RX. This would be misinterpreted and cause the pause tracker to be cleared. Test: Manually tested the bug, as well as regression tested b/62784036. Change-Id: Iaa736e93e05ef3ae5dec21cd8ebc18be464f18ae Fixes: 63410964
-rw-r--r--src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java b/src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java
index d6da824f..859ba371 100644
--- a/src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java
+++ b/src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java
@@ -69,6 +69,7 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider {
new ConcurrentHashMap<ImsVideoProviderWrapperCallback, Boolean>(8, 0.9f, 1));
private VideoPauseTracker mVideoPauseTracker = new VideoPauseTracker();
private boolean mUseVideoPauseWorkaround = false;
+ private int mCurrentVideoState;
private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() {
@Override
@@ -544,10 +545,18 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider {
* @param newVideoState The new video state.
*/
public void onVideoStateChanged(int newVideoState) {
- if (mVideoPauseTracker.isPaused() && !VideoProfile.isPaused(newVideoState)) {
- Log.i(this, "onVideoStateChanged: newVideoState=%s, clearing pending pause requests.",
+ if (VideoProfile.isPaused(mCurrentVideoState) && !VideoProfile.isPaused(newVideoState)) {
+ // New video state is un-paused, so clear any pending pause requests.
+ Log.i(this, "onVideoStateChanged: currentVideoState=%s, newVideoState=%s, "
+ + "clearing pending pause requests.",
+ VideoProfile.videoStateToString(mCurrentVideoState),
VideoProfile.videoStateToString(newVideoState));
mVideoPauseTracker.clearPauseRequests();
+ } else {
+ Log.d(this, "onVideoStateChanged: currentVideoState=%s, newVideoState=%s",
+ VideoProfile.videoStateToString(mCurrentVideoState),
+ VideoProfile.videoStateToString(newVideoState));
}
+ mCurrentVideoState = newVideoState;
}
}