summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2024-12-23 13:12:15 +0000
committer Riddle Hsu <riddlehsu@google.com> 2024-12-23 05:38:14 -0800
commita766c62f8f49f7c59b9f0d741e36d97dc37245b0 (patch)
treec3508d4092604076c0fd53f51baa6237ab0a3f44
parentf7c4dc872c75fe812d523f42da22d1c42851016a (diff)
Skip activity animation if its display is animating
The display animation should cover entire screen. That avoids mixing weird animations, such as reparenting other targets to transition root, e.g. ActivityWrap. Also change use display id to check in case there are multiple displays. Suppose the changes are sorted by displays. Bug: 373415266 Flag: EXEMPT bugfix Test: Declare an activity android:configChanges="uiMode" and start self FLAG_ACTIVITY_CLEAR_TASK with overridePendingTransition slide animation in onConfigurationChange. Launch it, open notification shade and toggle dark theme. Change-Id: I394c3dd0a3a262a10b053c60ea35010d896157fb
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java11
1 files changed, 7 insertions, 4 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 e80016d07f15..1689bb5778ae 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
@@ -329,7 +329,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
@ColorInt int backgroundColorForTransition = 0;
final int wallpaperTransit = getWallpaperTransitType(info);
- boolean isDisplayRotationAnimationStarted = false;
+ int animatingDisplayId = Integer.MIN_VALUE;
final boolean isDreamTransition = isDreamTransition(info);
final boolean isOnlyTranslucent = isOnlyTranslucent(info);
final boolean isActivityLevel = isActivityLevelOnly(info);
@@ -361,7 +361,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
? ScreenRotationAnimation.FLAG_HAS_WALLPAPER : 0;
startRotationAnimation(startTransaction, change, info, anim, flags,
animations, onAnimFinish);
- isDisplayRotationAnimationStarted = true;
+ animatingDisplayId = change.getEndDisplayId();
continue;
}
} else {
@@ -426,8 +426,11 @@ 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(mode)) {
- startTransaction.hide(change.getLeash());
+ if (animatingDisplayId == change.getEndDisplayId()) {
+ if (TransitionUtil.isClosingType(mode)) {
+ startTransaction.hide(change.getLeash());
+ }
+ // Only need to play display level animation.
continue;
}