diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java index fe018115408a8..3362d2a1ad349 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java @@ -22,6 +22,7 @@ import android.animation.RectEvaluator; import android.animation.ValueAnimator; import android.annotation.IntDef; import android.graphics.Rect; +import android.view.Choreographer; import android.view.SurfaceControl; import com.android.internal.annotations.VisibleForTesting; @@ -327,8 +328,14 @@ public class PipAnimationController { mEndValue = endValue; } - SurfaceControl.Transaction newSurfaceControlTransaction() { - return mSurfaceControlTransactionFactory.getTransaction(); + /** + * @return {@link SurfaceControl.Transaction} instance with vsync-id. + */ + protected SurfaceControl.Transaction newSurfaceControlTransaction() { + final SurfaceControl.Transaction tx = + mSurfaceControlTransactionFactory.getTransaction(); + tx.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId()); + return tx; } @VisibleForTesting diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java index 7f280cd124d21..d30fa3830cf3d 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java @@ -196,6 +196,11 @@ public class PipAnimationControllerTest extends ShellTestCase { return this; } + @Override + public SurfaceControl.Transaction setFrameTimelineVsync(long frameTimelineVsyncId) { + return this; + } + @Override public void apply() {} }