Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c80e2df9 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Take task snapshot when entering PiP

- This is to ensure that we have valid thumbnail later after exit-PiP
- For multi-activity Task entering PiP case, the snapshot is taken on
  the original Task. It will otherwise be empty

Flag: EXEMPT bugfix
Bug: 433885996
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/qQvRRVn7qYWYLNeBzAv5f
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/duBPi2KFRDK2wkGXALGO4J
Test: Enter PiP then close, validate thumbnail in Overview, see videos
Change-Id: I1363be4e9c718b6520648b394ad9bf13aa90eea8
parent 990fdf54
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2249,6 +2249,10 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                    rootTask.getSyncTransaction().hide(task.getSurfaceControl());
                }
            }
            // Take snapshot, this is to make sure we have valid thumbnail after exit-PiP.
            // When it's a multi-activity case, the snapshot is taken for the original task,
            // it will otherwise be empty.
            mWindowManager.mTaskSnapshotController.recordSnapshot(task);

            // TODO(remove-legacy-transit): Move this to the `singleActivity` case when removing
            //                              legacy transit.
@@ -2256,10 +2260,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>

            // Set the launch bounds for launch-into-pip Activity on the root task.
            if (r.getOptions() != null && r.getOptions().isLaunchIntoPip()) {
                // Record the snapshot now, it will be later fetched for content-pip animation.
                // We do this early in the process to make sure the right snapshot is used for
                // entering content-pip animation.
                mWindowManager.mTaskSnapshotController.recordSnapshot(task);
                if (!isPip2ExperimentEnabled()) {
                    // PiP2 always supplies bounds from Shell, so we can skip this.
                    rootTask.setBounds(r.pictureInPictureArgs.getSourceRectHint());