Merge "Preserve the leash reference in PipTaskOrganizer" into udc-dev am: 36f3373f7d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23617718 Change-Id: I49afc18b43b9df28c02a7c2a4db9d2a37914f714 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1018,24 +1018,17 @@ public class PipTransition extends PipTransitionController {
|
|||||||
private void resetPrevPip(@NonNull TransitionInfo.Change prevPipTaskChange,
|
private void resetPrevPip(@NonNull TransitionInfo.Change prevPipTaskChange,
|
||||||
@NonNull SurfaceControl.Transaction startTransaction) {
|
@NonNull SurfaceControl.Transaction startTransaction) {
|
||||||
final SurfaceControl leash = prevPipTaskChange.getLeash();
|
final SurfaceControl leash = prevPipTaskChange.getLeash();
|
||||||
final Rect bounds = prevPipTaskChange.getEndAbsBounds();
|
startTransaction.remove(leash);
|
||||||
final Point offset = prevPipTaskChange.getEndRelOffset();
|
|
||||||
bounds.offset(-offset.x, -offset.y);
|
|
||||||
|
|
||||||
startTransaction.setWindowCrop(leash, null);
|
|
||||||
startTransaction.setMatrix(leash, 1, 0, 0, 1);
|
|
||||||
startTransaction.setCornerRadius(leash, 0);
|
|
||||||
startTransaction.setPosition(leash, bounds.left, bounds.top);
|
|
||||||
|
|
||||||
if (mHasFadeOut && prevPipTaskChange.getTaskInfo().isVisible()) {
|
|
||||||
if (mPipAnimationController.getCurrentAnimator() != null) {
|
|
||||||
mPipAnimationController.getCurrentAnimator().cancel();
|
|
||||||
}
|
|
||||||
startTransaction.setAlpha(leash, 1);
|
|
||||||
}
|
|
||||||
mHasFadeOut = false;
|
mHasFadeOut = false;
|
||||||
mCurrentPipTaskToken = null;
|
mCurrentPipTaskToken = null;
|
||||||
mPipOrganizer.onExitPipFinished(prevPipTaskChange.getTaskInfo());
|
|
||||||
|
// clean-up the state in PipTaskOrganizer if the PipTaskOrganizer#onTaskAppeared() hasn't
|
||||||
|
// been called yet with its leash reference now pointing to a new SurfaceControl not
|
||||||
|
// matching the leash of the pip we are removing.
|
||||||
|
if (mPipOrganizer.getSurfaceControl() == leash) {
|
||||||
|
mPipOrganizer.onExitPipFinished(prevPipTaskChange.getTaskInfo());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user