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

Commit 6f4103ea authored by Todd Lee's avatar Todd Lee
Browse files

Ensure that default transition animations use rounded corners on round displays

Bug: b/394632734
Flag: NONE exempt trivial wear-only change
Test: presubmits
Change-Id: I8072b58893c9f6502c8c4222440bd577164a419c
parent 165a8a55
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -451,6 +451,17 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
            final int type = getTransitionTypeFromInfo(info);
            Animation a = loadAnimation(type, info, change, wallpaperTransit, isDreamTransition);
            if (a != null) {
                final int displayId = isTask ? change.getTaskInfo().displayId
                        : info.getRoot(TransitionUtil.rootIndexFor(change, info))
                                .getDisplayId();
                final Context displayContext =
                        mDisplayController.getDisplayContext(displayId);
                if (displayContext != null
                        && displayContext.getResources().getConfiguration().isScreenRound()) {
                    // ensure that any animation on a round display is using rounded corners
                    a.setHasRoundedCorners(true);
                }

                if (isTask) {
                    final boolean isTranslucent = (change.getFlags() & FLAG_TRANSLUCENT) != 0;
                    if (!isTranslucent && TransitionUtil.isOpenOrCloseMode(mode)
@@ -504,11 +515,6 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {

                final float cornerRadius;
                if (a.hasRoundedCorners()) {
                    final int displayId = isTask ? change.getTaskInfo().displayId
                            : info.getRoot(TransitionUtil.rootIndexFor(change, info))
                                    .getDisplayId();
                    final Context displayContext =
                            mDisplayController.getDisplayContext(displayId);
                    cornerRadius = displayContext == null ? 0
                            : ScreenDecorationsUtils.getWindowCornerRadius(displayContext);
                } else {