release-request-767e2998-9243-43e0-b656-1acb30ac5115-for-git_oc-release-4124637 snap... rel-29-o-partner rel-29-r3-o-partner rel-30-r2-o-partner rel-30-r3-o-partner
android-build-team Robot [Thu, 22 Jun 2017 07:10:28 +0000 (07:10 +0000)]
Change-Id: I60116c2c4e42bf72105caa32af9424015a4c5ad9

src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java
src/java/com/android/ims/internal/VideoPauseTracker.java

index 1aae533..d6da824 100644 (file)
@@ -535,4 +535,19 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider {
     public void setUseVideoPauseWorkaround(boolean useVideoPauseWorkaround) {
         mUseVideoPauseWorkaround = useVideoPauseWorkaround;
     }
+
+    /**
+     * Called by {@code ImsPhoneConnection} when there is a change to the video state of the call.
+     * Informs the video pause tracker that the video is no longer paused.  This ensures that
+     * subsequent pause requests are not filtered out.
+     *
+     * @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.",
+                    VideoProfile.videoStateToString(newVideoState));
+            mVideoPauseTracker.clearPauseRequests();
+        }
+    }
 }
index d37f7fa..a23c590 100644 (file)
@@ -150,6 +150,15 @@ public class VideoPauseTracker {
     }
 
     /**
+     * Clears pending pause requests for the tracker.
+     */
+    public void clearPauseRequests() {
+        synchronized (mPauseRequestsLock) {
+            mPauseRequests.clear();
+        }
+    }
+
+    /**
      * Returns a string equivalent of a {@code SOURCE_*} constant.
      *
      * @param source A {@code SOURCE_*} constant.