Fix regressions with reparenting task am: 27475c6e0c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14914910 Change-Id: I65b524a55c36f841af362d07d6ecee48ce9562a7
This commit is contained in:
@@ -6614,17 +6614,23 @@ class Task extends TaskFragment {
|
|||||||
void clearLastRecentsAnimationTransaction() {
|
void clearLastRecentsAnimationTransaction() {
|
||||||
mLastRecentsAnimationTransaction = null;
|
mLastRecentsAnimationTransaction = null;
|
||||||
mLastRecentsAnimationOverlay = null;
|
mLastRecentsAnimationOverlay = null;
|
||||||
// reset also the transform introduced by mLastRecentsAnimationTransaction
|
// reset also the crop and transform introduced by mLastRecentsAnimationTransaction
|
||||||
getPendingTransaction().setMatrix(mSurfaceControl, Matrix.IDENTITY_MATRIX, new float[9]);
|
Rect bounds = getBounds();
|
||||||
|
getPendingTransaction().setMatrix(mSurfaceControl, Matrix.IDENTITY_MATRIX, new float[9])
|
||||||
|
.setWindowCrop(mSurfaceControl, bounds.width(), bounds.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void maybeApplyLastRecentsAnimationTransaction() {
|
void maybeApplyLastRecentsAnimationTransaction() {
|
||||||
if (mLastRecentsAnimationTransaction != null) {
|
if (mLastRecentsAnimationTransaction != null) {
|
||||||
|
final SurfaceControl.Transaction tx = getPendingTransaction();
|
||||||
if (mLastRecentsAnimationOverlay != null) {
|
if (mLastRecentsAnimationOverlay != null) {
|
||||||
getPendingTransaction().reparent(mLastRecentsAnimationOverlay, mSurfaceControl);
|
tx.reparent(mLastRecentsAnimationOverlay, mSurfaceControl);
|
||||||
}
|
}
|
||||||
PictureInPictureSurfaceTransaction.apply(mLastRecentsAnimationTransaction,
|
PictureInPictureSurfaceTransaction.apply(mLastRecentsAnimationTransaction,
|
||||||
mSurfaceControl, getPendingTransaction());
|
mSurfaceControl, tx);
|
||||||
|
// If we are transferring the transform from the root task entering PIP, then also show
|
||||||
|
// the new task immediately
|
||||||
|
tx.show(mSurfaceControl);
|
||||||
mLastRecentsAnimationTransaction = null;
|
mLastRecentsAnimationTransaction = null;
|
||||||
mLastRecentsAnimationOverlay = null;
|
mLastRecentsAnimationOverlay = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user