Merge "Allow overridding the exitPip destination bounds" into tm-dev am: 15adfe3917

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18606671

Change-Id: Ib48fb2e5fb385b89fb672ab6b0566d401d843dfe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jorge Gil
2022-05-26 07:37:33 +00:00
committed by Automerger Merge Worker

View File

@@ -431,7 +431,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
} }
} }
final Rect destinationBounds = mPipBoundsState.getDisplayBounds(); final Rect destinationBounds = getExitDestinationBounds();
final int direction = syncWithSplitScreenBounds(destinationBounds, requestEnterSplit) final int direction = syncWithSplitScreenBounds(destinationBounds, requestEnterSplit)
? TRANSITION_DIRECTION_LEAVE_PIP_TO_SPLIT_SCREEN ? TRANSITION_DIRECTION_LEAVE_PIP_TO_SPLIT_SCREEN
: TRANSITION_DIRECTION_LEAVE_PIP; : TRANSITION_DIRECTION_LEAVE_PIP;
@@ -486,6 +486,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) { private void exitLaunchIntoPipTask(WindowContainerTransaction wct) {
wct.startTask(mTaskInfo.launchIntoPipHostTaskId, null /* ActivityOptions */); wct.startTask(mTaskInfo.launchIntoPipHostTaskId, null /* ActivityOptions */);
mTaskOrganizer.applyTransaction(wct); mTaskOrganizer.applyTransaction(wct);