From ff9b36762af49e19b47c79a9ac178a41e313db97 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Tue, 25 Oct 2022 10:22:29 -0700 Subject: [PATCH] Screenshot freeform task when going to overview When freeform tasks are visible in desktop mode, capture a screenshot of the tasks when opening overview. Also use RecentsView instead of RecentsAnimationController when finishing the recents animation. RecentsView.finishRecentsAnimation method has an extra call to onRecentsAnimationComplete() which ensures that screenshot does got used. Bug: 244348395 Test: manual, open freeform task, swipe up to go overview, observe a screenshot of the task Change-Id: I066b25ec7ae25d1e09aba0ff0a379d35bbe2b636 --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 0347c7e31a..a4f3d5b311 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1881,11 +1881,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) {