From 0fb921ef36a91cb25bd22d8b0809eabbd550490c Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Wed, 19 Oct 2022 08:48:45 +0000 Subject: [PATCH] Snapshot 2 tasks when swipe up split case Swipe up snapshot only capture the top one task, but for split screen case it should capture two tasks otherwise the snapshot in overview would be empty in some cases. Fix: 247420799 Test: manual Test: pass existing tests Change-Id: I3acd477eaca3cb98d86e2446dbb2dbd6295c687d --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 07ddcc8b31..7021e643fa 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1835,6 +1835,17 @@ public abstract class AbsSwipeUpHandler, if (mRecentsAnimationController == null) return; final ThumbnailData taskSnapshot = mRecentsAnimationController.screenshotTask(runningTaskId); + // If split case, we should update all split tasks snapshot + if (mIsSwipeForSplit) { + int[] splitTaskIds = TopTaskTracker.INSTANCE.get( + mContext).getRunningSplitTaskIds(); + for (int i = 0; i < splitTaskIds.length; i++) { + // Skip running one because done above. + if (splitTaskIds[i] == runningTaskId) continue; + + mRecentsAnimationController.screenshotTask(splitTaskIds[i]); + } + } MAIN_EXECUTOR.execute(() -> { mTaskSnapshot = taskSnapshot; if (!updateThumbnail(runningTaskId, false /* refreshView */)) {