diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index d4b713b2a8..ff7c668991 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1892,11 +1892,13 @@ public abstract class AbsSwipeUpHandler, } private void finishCurrentTransitionToRecents() { - if (mRecentsAnimationController != null + if (mRecentsView != null && mActivityInterface.getDesktopVisibilityController() != null && mActivityInterface.getDesktopVisibilityController().areFreeformTasksVisible()) { - mRecentsAnimationController.finish(true /* toRecents */, - () -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED)); + mRecentsView.switchToScreenshot(() -> { + mRecentsView.finishRecentsAnimation(true /* toRecents */, false /* shouldPip */, + () -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED)); + }); } else { mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED); if (mRecentsAnimationController != null) {