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

Commit 27e49907 authored by jorgegil@google.com's avatar jorgegil@google.com Committed by Jorge Gil
Browse files

Allow overridding the exitPip destination bounds

Allows vendors to choose to restore to bounds other than the display
bounds on exit PIP. This is specially useful in freeform enabled
desktops where the previous windowing mode was freeform and PIP should
return to its original freeform bounds.

Bug: 225294296
Test: atest PinnedStackTests
Merged-In: Id25906c4b11e5f3c8351ba96cff80c63a6a5cf4e
Change-Id: Id25906c4b11e5f3c8351ba96cff80c63a6a5cf4e
(cherry picked from commit 2a68fc0b)
parent 36398057
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            }
        }

        final Rect destinationBounds = mPipBoundsState.getDisplayBounds();
        final Rect destinationBounds = getExitDestinationBounds();
        final int direction = syncWithSplitScreenBounds(destinationBounds, requestEnterSplit)
                ? TRANSITION_DIRECTION_LEAVE_PIP_TO_SPLIT_SCREEN
                : TRANSITION_DIRECTION_LEAVE_PIP;
@@ -485,6 +485,11 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
        });
    }

    /** Returns the bounds to restore to when exiting PIP mode. */
    public Rect getExitDestinationBounds() {
        return mPipBoundsState.getDisplayBounds();
    }

    private void exitLaunchIntoPipTask(WindowContainerTransaction wct) {
        wct.startTask(mTaskInfo.launchIntoPipHostTaskId, null /* ActivityOptions */);
        mTaskOrganizer.applyTransaction(wct);