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
This commit is contained in:
Evan Rosky
2023-05-02 16:14:24 -07:00
parent 1a1cc48d03
commit a35b10dd0d

View File

@@ -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");
}
}