Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a766c62f authored by Riddle Hsu's avatar Riddle Hsu
Browse files

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
parent f7c4dc87
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -329,7 +329,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {


        @ColorInt int backgroundColorForTransition = 0;
        @ColorInt int backgroundColorForTransition = 0;
        final int wallpaperTransit = getWallpaperTransitType(info);
        final int wallpaperTransit = getWallpaperTransitType(info);
        boolean isDisplayRotationAnimationStarted = false;
        int animatingDisplayId = Integer.MIN_VALUE;
        final boolean isDreamTransition = isDreamTransition(info);
        final boolean isDreamTransition = isDreamTransition(info);
        final boolean isOnlyTranslucent = isOnlyTranslucent(info);
        final boolean isOnlyTranslucent = isOnlyTranslucent(info);
        final boolean isActivityLevel = isActivityLevelOnly(info);
        final boolean isActivityLevel = isActivityLevelOnly(info);
@@ -361,7 +361,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
                                ? ScreenRotationAnimation.FLAG_HAS_WALLPAPER : 0;
                                ? ScreenRotationAnimation.FLAG_HAS_WALLPAPER : 0;
                        startRotationAnimation(startTransaction, change, info, anim, flags,
                        startRotationAnimation(startTransaction, change, info, anim, flags,
                                animations, onAnimFinish);
                                animations, onAnimFinish);
                        isDisplayRotationAnimationStarted = true;
                        animatingDisplayId = change.getEndDisplayId();
                        continue;
                        continue;
                    }
                    }
                } else {
                } else {
@@ -426,8 +426,11 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {


            // Hide the invisible surface directly without animating it if there is a display
            // Hide the invisible surface directly without animating it if there is a display
            // rotation animation playing.
            // rotation animation playing.
            if (isDisplayRotationAnimationStarted && TransitionUtil.isClosingType(mode)) {
            if (animatingDisplayId == change.getEndDisplayId()) {
                if (TransitionUtil.isClosingType(mode)) {
                    startTransaction.hide(change.getLeash());
                    startTransaction.hide(change.getLeash());
                }
                // Only need to play display level animation.
                continue;
                continue;
            }
            }