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

Commit 4d5c11e4 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias Committed by Automerger Merge Worker
Browse files

Merge "Fix NPE from getting swipe pip to home animator finish transation after...

Merge "Fix NPE from getting swipe pip to home animator finish transation after the surface has been released" into tm-qpr-dev am: 53808c3e

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



Change-Id: I11e59bae451b0c66a5222276bdad8ae8b29a4ccd
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ea13cef9 53808c3e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -324,6 +324,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    // May be set to false when mIsTransientTaskbar is true.
    private boolean mCanSlowSwipeGoHome = true;

    @Nullable
    private RemoteAnimationTargets.ReleaseCheck mSwipePipToHomeReleaseCheck = null;

    public AbsSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState,
            TaskAnimationManager taskAnimationManager, GestureState gestureState,
            long touchTimeMs, boolean continuingLastGesture,
@@ -869,6 +872,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(mContext, targets);
        mRecentsAnimationController = controller;
        mRecentsAnimationTargets = targets;
        mSwipePipToHomeReleaseCheck = new RemoteAnimationTargets.ReleaseCheck();
        mSwipePipToHomeReleaseCheck.setCanRelease(true);
        mRecentsAnimationTargets.addReleaseCheck(mSwipePipToHomeReleaseCheck);

        // Only initialize the device profile, if it has not been initialized before, as in some
        // configurations targets.homeContentInsets may not be correct.
@@ -1430,9 +1436,16 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                mSwipePipToHomeAnimator = createWindowAnimationToPip(
                        homeAnimFactory, runningTaskTarget, start);
                mSwipePipToHomeAnimators[0] = mSwipePipToHomeAnimator;
                if (mSwipePipToHomeReleaseCheck != null) {
                    mSwipePipToHomeReleaseCheck.setCanRelease(false);
                }
                windowAnim = mSwipePipToHomeAnimators;
            } else {
                mSwipePipToHomeAnimator = null;
                if (mSwipePipToHomeReleaseCheck != null) {
                    mSwipePipToHomeReleaseCheck.setCanRelease(true);
                    mSwipePipToHomeReleaseCheck = null;
                }
                windowAnim = createWindowAnimationToHome(start, homeAnimFactory);

                windowAnim[0].addAnimatorListener(new AnimationSuccessListener() {
@@ -1954,6 +1967,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            finishRecentsControllerToHome(
                    () -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
        }
        if (mSwipePipToHomeReleaseCheck != null) {
            mSwipePipToHomeReleaseCheck.setCanRelease(true);
            mSwipePipToHomeReleaseCheck = null;
        }
        doLogGesture(HOME, mRecentsView == null ? null : mRecentsView.getCurrentPageTaskView());
    }