diff options
| author | 2023-05-22 11:53:14 -0700 | |
|---|---|---|
| committer | 2023-05-22 11:53:14 -0700 | |
| commit | 9cc74e288fff53f2cdcea669a1697684a01745d8 (patch) | |
| tree | 27d6f42497a385cc4b3805cbe49dbecf1e2c7e8a | |
| parent | b03c480d4baa2deb47c50aa27e7edc5f0e2e67b6 (diff) | |
Attach PipSnapshotContentOverlay in PipTransition
Similar to what's in PipTaskOrganizer, we try to apply the snapshot
overlay when entering PiP, which was missing in PipTransition with
shell-transition being on.
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cII9Y55L2gdPRhhweur6KT
Bug: 283822454
Test: manual, see Video
Change-Id: I9041a808f0842e005659f59327a56802a02168a4
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java index bfc1fb905ade..dac4850da8ae 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java @@ -53,6 +53,7 @@ import android.os.SystemProperties; import android.view.Surface; import android.view.SurfaceControl; import android.view.WindowManager; +import android.window.TaskSnapshot; import android.window.TransitionInfo; import android.window.TransitionRequestInfo; import android.window.WindowContainerToken; @@ -880,6 +881,14 @@ public class PipTransition extends PipTransitionController { } else { animator.setColorContentOverlay(mContext); } + } else { + final TaskSnapshot snapshot = PipUtils.getTaskSnapshot( + taskInfo.launchIntoPipHostTaskId, false /* isLowResolution */); + if (snapshot != null) { + // use the task snapshot during the animation, this is for + // launch-into-pip aka. content-pip use case. + animator.setSnapshotContentOverlay(snapshot, sourceHintRect); + } } } else if (enterAnimationType == ANIM_TYPE_ALPHA) { animator = mPipAnimationController.getAnimator(taskInfo, leash, destinationBounds, |