Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ff2dbd9 authored by Winson Chung's avatar Winson Chung Committed by android-build-merger
Browse files

Use vsync choreographer when moving PIP. am: 487737b8

am: 4cc5518c

Change-Id: I43e66e892ae3e67336e18d9a55d6074bc0e75167
parents 919f128a 4cc5518c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -37,10 +37,12 @@ import android.graphics.Rect;
import android.os.Handler;
import android.os.RemoteException;
import android.util.Log;
import android.view.Choreographer;
import android.view.animation.Interpolator;

import com.android.internal.os.BackgroundThread;
import com.android.internal.policy.PipSnapAlgorithm;
import com.android.internal.view.SurfaceFlingerVsyncChoreographer;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.statusbar.FlingAnimationUtils;

@@ -72,6 +74,7 @@ public class PipMotionHelper {

    private Context mContext;
    private IActivityManager mActivityManager;
    private SurfaceFlingerVsyncChoreographer mVsyncChoreographer;
    private Handler mHandler;

    private PipSnapAlgorithm mSnapAlgorithm;
@@ -96,6 +99,8 @@ public class PipMotionHelper {
        mActivityManager = activityManager;
        mSnapAlgorithm = snapAlgorithm;
        mFlingAnimationUtils = flingAnimationUtils;
        mVsyncChoreographer = new SurfaceFlingerVsyncChoreographer(mHandler, mContext.getDisplay(),
                Choreographer.getInstance());
        onConfigurationChanged();
    }

@@ -394,7 +399,7 @@ public class PipMotionHelper {
     */
    private void resizePipUnchecked(Rect toBounds) {
        if (!toBounds.equals(mBounds)) {
            mHandler.post(() -> {
            mVsyncChoreographer.scheduleAtSfVsync(() -> {
                try {
                    mActivityManager.resizePinnedStack(toBounds, null /* tempPinnedTaskBounds */);
                    mBounds.set(toBounds);