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

Commit a7fdc397 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role)
Browse files

[automerger] Use SyncRtSurfaceTransactionApplier for recents enter/exit am: 80b93147

Change-Id: I4a179cde85e81fa971982c6d0087a57bfe513596
parents 65456764 80b93147
Loading
Loading
Loading
Loading
+238 B (129 KiB)

File changed.

No diff preview for this file type.

+5 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.LatencyTrackerCompat;
import com.android.systemui.shared.system.PackageManagerWrapper;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplier;
import com.android.systemui.shared.system.TransactionCompat;

import java.util.ArrayList;
@@ -350,11 +351,14 @@ public class OverviewCommandHelper {
            clipHelper.updateTargetRect(targetRect);
            clipHelper.prepareAnimation(false /* isOpening */);

            SyncRtSurfaceTransactionApplier syncTransactionApplier =
                    new SyncRtSurfaceTransactionApplier(rootView);
            ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1);
            valueAnimator.setDuration(RECENTS_LAUNCH_DURATION);
            valueAnimator.setInterpolator(TOUCH_RESPONSE_INTERPOLATOR);
            valueAnimator.addUpdateListener((v) ->
                    clipHelper.applyTransform(targetSet, (float) v.getAnimatedValue()));
                    clipHelper.applyTransform(targetSet, (float) v.getAnimatedValue(),
                            syncTransactionApplier));

            if (targetSet.isAnimatingHome()) {
                // If we are animating home, fade in the opening targets
+6 −18
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplier;

import java.util.List;

@@ -144,6 +145,8 @@ public class TaskUtils {
     */
    public static ValueAnimator getRecentsWindowAnimator(TaskView v, boolean skipViewChanges,
            RemoteAnimationTargetCompat[] targets, final ClipAnimationHelper inOutHelper) {
        SyncRtSurfaceTransactionApplier syncTransactionApplier =
                new SyncRtSurfaceTransactionApplier(v);
        final ValueAnimator appAnimator = ValueAnimator.ofFloat(0, 1);
        appAnimator.setInterpolator(TOUCH_RESPONSE_INTERPOLATOR);
        appAnimator.addUpdateListener(new MultiValueUpdateListener() {
@@ -155,18 +158,10 @@ public class TaskUtils {
            final RemoteAnimationTargetSet mTargetSet;

            final RectF mThumbnailRect;
            private Surface mSurface;
            private long mFrameNumber;

            {
                mTargetSet = new RemoteAnimationTargetSet(targets, MODE_OPENING);
                inOutHelper.setTaskTransformCallback((t, app) -> {
                    t.setAlpha(app.leash, mTaskAlpha.value);

                    if (!skipViewChanges) {
                        t.deferTransactionUntil(app.leash, mSurface, mFrameNumber);
                    }
                });
                inOutHelper.setTaskAlphaCallback((t, alpha) -> mTaskAlpha.value);

                inOutHelper.prepareAnimation(true /* isOpening */);
                inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(),
@@ -179,15 +174,8 @@ public class TaskUtils {

            @Override
            public void onUpdate(float percent) {
                mSurface = getSurface(v);
                mFrameNumber = mSurface != null ? getNextFrameNumber(mSurface) : -1;
                if (mFrameNumber == -1) {
                    // Booo, not cool! Our surface got destroyed, so no reason to animate anything.
                    Log.w(TAG, "Failed to animate, surface got destroyed.");
                    return;
                }

                RectF taskBounds = inOutHelper.applyTransform(mTargetSet, 1 - percent);
                RectF taskBounds = inOutHelper.applyTransform(mTargetSet, 1 - percent,
                        syncTransactionApplier);
                if (!skipViewChanges) {
                    float scale = taskBounds.width() / mThumbnailRect.width();
                    v.setScaleX(scale);
+2 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.ChoreographerCompat;
import com.android.systemui.shared.system.NavigationBarCompat.HitTarget;

/**
@@ -406,6 +407,6 @@ public class TouchInteractionService extends Service {
            sRemoteUiThread.start();
        }
        new Handler(sRemoteUiThread.getLooper()).post(() ->
                mBackgroundThreadChoreographer = Choreographer.getInstance());
                mBackgroundThreadChoreographer = ChoreographerCompat.getSfInstance());
    }
}
+8 −1
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import com.android.systemui.shared.system.InputConsumerController;
import com.android.systemui.shared.system.LatencyTrackerCompat;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplier;
import com.android.systemui.shared.system.WindowCallbacksCompat;
import com.android.systemui.shared.system.WindowManagerWrapper;

@@ -181,6 +182,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
    private T mActivity;
    private LayoutListener mLayoutListener;
    private RecentsView mRecentsView;
    private SyncRtSurfaceTransactionApplier mSyncTransactionApplier;
    private QuickScrubController mQuickScrubController;
    private AnimationFactory mAnimationFactory = (t, i) -> { };

@@ -347,6 +349,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
        }

        mRecentsView = activity.getOverviewPanel();
        mSyncTransactionApplier = new SyncRtSurfaceTransactionApplier(mRecentsView);
        mQuickScrubController = mRecentsView.getQuickScrubController();
        mLayoutListener = mActivityControlHelper.createLayoutListener(mActivity);

@@ -504,7 +507,11 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {

        RecentsAnimationControllerCompat controller = mRecentsAnimationWrapper.getController();
        if (controller != null) {
            mClipAnimationHelper.applyTransform(mRecentsAnimationWrapper.targetSet, shift);

            mClipAnimationHelper.applyTransform(mRecentsAnimationWrapper.targetSet, shift,
                    Looper.myLooper() == mMainThreadHandler.getLooper()
                            ? mSyncTransactionApplier
                            : null);

            // TODO: This logic is spartanic!
            boolean passedThreshold = shift > 0.12f;
Loading