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

Commit b65eb847 authored by Mateusz Cicheński's avatar Mateusz Cicheński
Browse files

Do not remove surface when resetting previous PiP

This was introduced in ag/23617718 and is no longer needed.

However, with this change we are now hitting ag/21485364 and the
initial activity ends up being sent to the back instead to front.

Follow up will require handling this special case setup of
activity with singleInstance launchMode.

Bug: 296071915
Bug: 285231679
Test: manually, follow steps in b/285231679 with no regression found
Test: manually, follow repro steps using modified sample app - no crash
Change-Id: I83c3a0456c8508ab470da98537d27dc1dc1b74f2
parent 84bdf480
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1047,7 +1047,21 @@ public class PipTransition extends PipTransitionController {
    private void resetPrevPip(@NonNull TransitionInfo.Change prevPipTaskChange,
            @NonNull SurfaceControl.Transaction startTransaction) {
        final SurfaceControl leash = prevPipTaskChange.getLeash();
        startTransaction.remove(leash);
        final Rect bounds = prevPipTaskChange.getEndAbsBounds();
        final Point offset = prevPipTaskChange.getEndRelOffset();
        bounds.offset(-offset.x, -offset.y);

        startTransaction.setWindowCrop(leash, null);
        startTransaction.setMatrix(leash, 1, 0, 0, 1);
        startTransaction.setCornerRadius(leash, 0);
        startTransaction.setPosition(leash, bounds.left, bounds.top);

        if (mHasFadeOut && prevPipTaskChange.getTaskInfo().isVisible()) {
            if (mPipAnimationController.getCurrentAnimator() != null) {
                mPipAnimationController.getCurrentAnimator().cancel();
            }
            startTransaction.setAlpha(leash, 1);
        }

        mHasFadeOut = false;
        mCurrentPipTaskToken = null;