Reset original task surface after reparenting to PiP
Currently if the shell transitions are disabled (default), the auto-enter pip will trigger an animation via Recents, animating the original task surface and populating the mLastRecentsAnimationTransaction. As we reparent that activity into the pip window, we also reset the state of the original task surface in clearLastRecentsAnimationTransaction. When shell transitions are enabled, the auto-enter pip does not animate via the same mechanism and the mLastRecentsAnimationTransaction is null. We still animate the original task surface but nothing resets it after the activity is being reparented. This CL fixes that second scenario by applying a reset transform to the original task surface even if there was no recents animation transaction. Bug: 232981505 Test: manual, open ApiDemos, autoenter pip, return to full screen via pip menu Change-Id: Ibc42c1277e045bf5042678340b9d68428cb2e626
This commit is contained in:
@@ -2048,6 +2048,9 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
task.mLastRecentsAnimationTransaction,
|
||||
task.mLastRecentsAnimationOverlay);
|
||||
task.clearLastRecentsAnimationTransaction(false /* forceRemoveOverlay */);
|
||||
} else {
|
||||
// Reset the original task surface
|
||||
task.resetSurfaceControlTransforms();
|
||||
}
|
||||
|
||||
// The organized TaskFragment is becoming empty because this activity is reparented
|
||||
|
||||
@@ -5985,8 +5985,13 @@ class Task extends TaskFragment {
|
||||
mLastRecentsAnimationTransaction = null;
|
||||
mLastRecentsAnimationOverlay = null;
|
||||
// reset also the crop and transform introduced by mLastRecentsAnimationTransaction
|
||||
getPendingTransaction().setMatrix(mSurfaceControl, Matrix.IDENTITY_MATRIX, new float[9])
|
||||
resetSurfaceControlTransforms();
|
||||
}
|
||||
|
||||
void resetSurfaceControlTransforms() {
|
||||
getSyncTransaction().setMatrix(mSurfaceControl, Matrix.IDENTITY_MATRIX, new float[9])
|
||||
.setWindowCrop(mSurfaceControl, null)
|
||||
.setShadowRadius(mSurfaceControl, 0)
|
||||
.setCornerRadius(mSurfaceControl, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user