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

Commit a35b10dd authored by Evan Rosky's avatar Evan Rosky
Browse files

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
parent 1a1cc48d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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");
                        }
                    }