diff options
| author | 2023-05-02 16:14:24 -0700 | |
|---|---|---|
| committer | 2023-05-02 16:14:24 -0700 | |
| commit | a35b10dd0d7ba6e80d1a04996b1df3ddea66db59 (patch) | |
| tree | f37898bad1c093f9513f8c119f0f6c4181eacac6 | |
| parent | 1a1cc48d03434d5c1d0321bc7f57a2a4ccaf1756 (diff) | |
Make rotation leash for rotated multi-activity pip expand
When expanding a multi-activity pip, the activity gets reparented
back to its original task. For expanding into a different rotation,
the Task is what held the new rotation, so when the activity is
reparented, it loses that transform. In this case, we need to
create a rotation leash to provide the transform in the task's
place.
Bug: 277452732
Test: play video in netflix (landscape). swipe-to-pip (portrait),
expand pip (back to landscape).
Change-Id: I70318e2808e46158d20a721e8595651ba3ac8460
| -rw-r--r-- | services/core/java/com/android/server/wm/Task.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 99d3cc0737d1..931c2580fa3f 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -4614,6 +4614,13 @@ class Task extends TaskFragment { topActivity.reparent(lastParentBeforePip, lastParentBeforePip.getChildCount() /* top */, "movePinnedActivityToOriginalTask"); + final DisplayContent dc = topActivity.getDisplayContent(); + if (dc != null && dc.isFixedRotationLaunchingApp(topActivity)) { + // Expanding pip into new rotation, so create a rotation leash + // until the display is rotated. + topActivity.getOrCreateFixedRotationLeash( + topActivity.getSyncTransaction()); + } lastParentBeforePip.moveToFront("movePinnedActivityToOriginalTask"); } } |