Capture task snapshot with initial bounds during finish transition.

In WindowOrganizerController#finishTransition, there could apply window
container transaction to modify the hierarchy of window containers.
When move a split pair to back, there will dismiss all tasks in
StageCoordinator#prepareExitSplitScreen, and the snapshot of the split
tasks will be captured after it's config become fullscreen, which is
the reason there won't use snapshot strating window when move split to
front.

Bug: 279547115
Test: manual, create a split pair, move it to back. Then verify both
tasks will show snapshot starting window when launch split to front by
quick switch or recents.

Change-Id: Ie77c97f88b0ab7ba47a1cb1771f1b61fdcf02ae2
diff --git a/services/core/java/com/android/server/wm/AbsAppSnapshotController.java b/services/core/java/com/android/server/wm/AbsAppSnapshotController.java
index 32f7b96..5c929a9 100644
--- a/services/core/java/com/android/server/wm/AbsAppSnapshotController.java
+++ b/services/core/java/com/android/server/wm/AbsAppSnapshotController.java
@@ -239,7 +239,17 @@
             }
             return null;
         }
-        source.getBounds(mTmpRect);
+        mTmpRect.setEmpty();
+        if (source.mTransitionController.inFinishingTransition(source)) {
+            final Transition.ChangeInfo changeInfo = source.mTransitionController
+                    .mFinishingTransition.mChanges.get(source);
+            if (changeInfo != null) {
+                mTmpRect.set(changeInfo.mAbsoluteBounds);
+            }
+        }
+        if (mTmpRect.isEmpty()) {
+            source.getBounds(mTmpRect);
+        }
         mTmpRect.offsetTo(0, 0);
         SurfaceControl[] excludeLayers;
         final WindowState imeWindow = source.getDisplayContent().mInputMethodWindow;