Remove starting destination bounds on BOUNDS PIP Shell Transition.

We don't need to set any starting bounds on non-alpha animations.
Also fixed a potential possibility where swipeToHome gets reset too
early by PipTaskOrganizer, and moved it to PipTransition instead.

Bug: 165793917
Bug: 193565745
Test: atest EnterPipTest
Change-Id: Icd579b1165a62cb61a6c1eed0d659d788c16608c
This commit is contained in:
Ben Lin
2021-08-11 17:22:01 -07:00
parent a0b5327e14
commit 4462de5dfd
2 changed files with 7 additions and 4 deletions

View File

@@ -613,7 +613,6 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
private void onEndOfSwipePipToHomeTransition() {
if (Transitions.ENABLE_SHELL_TRANSITIONS) {
mPipTransitionState.setInSwipePipToHomeTransition(false);
mSwipePipToHomeOverlay = null;
return;
}

View File

@@ -170,9 +170,12 @@ public class PipTransition extends PipTransitionController {
if (request.getType() == TRANSIT_PIP) {
WindowContainerTransaction wct = new WindowContainerTransaction();
mPipTransitionState.setTransitionState(PipTransitionState.ENTRY_SCHEDULED);
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
wct.setActivityWindowingMode(request.getTriggerTask().token, WINDOWING_MODE_UNDEFINED);
wct.setBounds(request.getTriggerTask().token, destinationBounds);
if (mOneShotAnimationType == ANIM_TYPE_ALPHA) {
wct.setActivityWindowingMode(request.getTriggerTask().token,
WINDOWING_MODE_UNDEFINED);
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
wct.setBounds(request.getTriggerTask().token, destinationBounds);
}
return wct;
} else {
return null;
@@ -243,6 +246,7 @@ public class PipTransition extends PipTransitionController {
onFinishResize(taskInfo, destinationBounds, TRANSITION_DIRECTION_TO_PIP, tx);
sendOnPipTransitionFinished(TRANSITION_DIRECTION_TO_PIP);
mFinishCallback = null;
mPipTransitionState.setInSwipePipToHomeTransition(false);
return true;
}