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

Commit c3d101b0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Clear recents animation controllers and recents animation snapshots...

Merge "Clear recents animation controllers and recents animation snapshots synchronously." into tm-dev am: 6ac4f9e8

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18243102



Change-Id: Iebe6f43284fe7651ef683d490c1c5056a6124bb5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 319520c1 6ac4f9e8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,

    // Null if the recents animation hasn't started yet or has been canceled or finished.
    protected @Nullable RecentsAnimationController mRecentsAnimationController;
    protected @Nullable RecentsAnimationController mDeferredCleanupRecentsAnimationController;
    protected RecentsAnimationTargets mRecentsAnimationTargets;
    protected T mActivity;
    protected Q mRecentsView;
@@ -435,6 +436,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                    mRecentsView.switchToScreenshot(snapshots, () -> {
                        if (mRecentsAnimationController != null) {
                            mRecentsAnimationController.cleanupScreenshot();
                        } else if (mDeferredCleanupRecentsAnimationController != null) {
                            mDeferredCleanupRecentsAnimationController.cleanupScreenshot();
                            mDeferredCleanupRecentsAnimationController = null;
                        }
                    });
                    mRecentsView.onRecentsAnimationComplete();
@@ -839,6 +843,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    public void onRecentsAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas) {
        ActiveGestureLog.INSTANCE.addLog("cancelRecentsAnimation");
        mActivityInitListener.unregister();
        // Cache the recents animation controller so we can defer its cleanup to after having
        // properly cleaned up the screenshot without accidentally using it.
        mDeferredCleanupRecentsAnimationController = mRecentsAnimationController;
        mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED);

        if (mRecentsAnimationTargets != null) {