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

Commit 931e3dbf authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Always make final activity leash crop null

When expanding from PiP into the app in multi-activity
case, sometimes the parentBeforePip can still be null
if the previous task before PiP was not deemed a transition
target as it's already up front and visible.

Hence, parentBeforePip != null isn't a good indicator of whether
an activity leash was being animated during a multi-activity expand
from PiP case. Check for TaskInfo presence instead to make sure
the final crop of the activity surface is set to NULL.

Bug: 433977292
Flag: EXEMPT bugfix
Test: manually enter PiP in multi-activity case,
  and open the previous parent task before expanding;
  then rotate the device.
Change-Id: Icec137a11b1c22621e294e623902b57b29e9fe2d
parent f2ea0531
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -237,10 +237,11 @@ public class PipExpandHandler implements Transitions.TransitionHandler {

        final TransitionInfo.Change finalPipChange = pipChange;
        animator.setAnimationEndCallback(() -> {
            if (parentBeforePip != null) {
                // TODO b/377362511: Animate local leash instead to also handle letterbox case.
            if (finalPipChange.getTaskInfo() == null) {
                // For multi-activity, set the crop to be null
                finishTransaction.setCrop(pipLeash, null);
            }
            if (parentBeforePip != null) {
                setupMultiActivityAnimationFinalState(finishTransaction, finalPipChange, pipLeash,
                        parentBeforePip);
            }