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

Commit af7c86ad authored by Winson Chung's avatar Winson Chung
Browse files

Skip setting up ui if the handler is already invalidated

- Also unregister the task stack listener in case the restart
  message comes in right before the animation is finished

Bug: 186760990
Test: Swipe up/quickswitch repeatedly
Change-Id: I5af7a26f05e7c15e099d6666e4662fd1af9aa861
parent 4ff2f769
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1518,6 +1518,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    protected abstract void finishRecentsControllerToHome(Runnable callback);

    private void setupLauncherUiAfterSwipeUpToRecentsAnimation() {
        if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) {
            return;
        }
        endLauncherTransitionController();
        mActivityInterface.onSwipeUpToRecentsComplete();
        mRecentsView.onSwipeUpAnimationSuccess();
+5 −0
Original line number Diff line number Diff line
@@ -57,6 +57,11 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
        @Override
        public void onActivityRestartAttempt(ActivityManager.RunningTaskInfo task,
                boolean homeTaskVisible, boolean clearedTask, boolean wasVisible) {
            if (mLastGestureState == null) {
                ActivityManagerWrapper.getInstance().unregisterTaskStackListener(
                        mLiveTileRestartListener);
                return;
            }
            BaseActivityInterface activityInterface = mLastGestureState.getActivityInterface();
            if (LIVE_TILE.get() && activityInterface.isInLiveTileMode()
                    && activityInterface.getCreatedActivity() != null) {