Merge "Directly hide the surface of the invisible activity if display rotates" into udc-dev

This commit is contained in:
Louis Chang
2023-04-13 04:43:41 +00:00
committed by Android (Google) Code Review

View File

@@ -327,6 +327,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
@ColorInt int backgroundColorForTransition = 0;
final int wallpaperTransit = getWallpaperTransitType(info);
boolean isDisplayRotationAnimationStarted = false;
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
final TransitionInfo.Change change = info.getChanges().get(i);
if (change.hasAllFlags(FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY
@@ -350,6 +351,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
if (!(isSeamlessDisplayChange || anim == ROTATION_ANIMATION_JUMPCUT)) {
startRotationAnimation(startTransaction, change, info, anim, animations,
onAnimFinish);
isDisplayRotationAnimationStarted = true;
continue;
}
} else {
@@ -405,6 +407,14 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
}
}
// Hide the invisible surface directly without animating it if there is a display
// rotation animation playing.
if (isDisplayRotationAnimationStarted && TransitionUtil.isClosingType(
change.getMode())) {
startTransaction.hide(change.getLeash());
continue;
}
// The back gesture has animated this change before transition happen, so here we don't
// play the animation again.
if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) {