Merge "Screenshot freeform task when going to overview" into tm-qpr-dev

This commit is contained in:
Ats Jenk
2022-10-26 17:01:08 +00:00
committed by Android (Google) Code Review

View File

@@ -1892,11 +1892,13 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
}
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) {