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

Commit 4cc5518c authored by Winson Chung's avatar Winson Chung Committed by android-build-merger
Browse files

Use vsync choreographer when moving PIP.

am: 487737b8

Change-Id: Ifc6c5a57748432bf1173b27d5377ed573c70ba65
parents 03dbae24 487737b8
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);