summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Louis Chang <louischang@google.com> 2023-04-11 02:36:12 +0000
committer Louis Chang <louischang@google.com> 2023-04-12 13:33:04 +0000
commitc2c0c4d879c6de5361ac3d9e8ea50b3b427548af (patch)
treea20ec8f1fa6a2facdb1931d3478a375eff166a16
parent6218576ef9b605de6462f68741d2610263c2c98a (diff)
Directly hide the surface of the invisible activity if display rotates
The surface of an invisible activity was set to top-most z-ordering while playing display rotation transition animation. It was showing on top of the entire animation because the surface layer was set on top. Bug: 275470440 Test: rotate display while activity embedded Change-Id: If2467b7865ecef523867059ca15200c38ed7d650
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
index 3dd10a098310..6e9ecdaf55e7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
@@ -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)) {