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

Commit dc50bb50 authored by Tiger Huang's avatar Tiger Huang
Browse files

Don't apply rounded-corner animation on non-default display

Non-default displays usually don't have rounded-corners. It doesn't
make sense to apply rounded-corner animations on them. Besides, we
don't know if an external display has rounded-corners or not.

Bug: 131040127
Test: Follow the reproduction steps in the bug.
Change-Id: I0b892bfb50875eaa59b2bf5ba07074bb3494042b
parent b09eed23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ class AppWindowThumbnail implements Animatable {
        mSurfaceAnimator.startAnimation(t, new LocalAnimationAdapter(
                new WindowAnimationSpec(anim, position,
                        mAppToken.getDisplayContent().mAppTransition.canSkipFirstFrame(),
                        mAppToken.mWmService.mWindowCornerRadius),
                        mAppToken.getWindowCornerRadiusForAnimation()),
                mAppToken.mWmService.mSurfaceAnimationRunner), false /* hidden */);
    }

+1 −3
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.pm.ActivityInfo.COLOR_MODE_DEFAULT;
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
@@ -2542,7 +2540,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                                    getDisplayContent().mAppTransition.canSkipFirstFrame(),
                                    appStackClipMode,
                                    true /* isAppAnimation */,
                                    mWmService.mWindowCornerRadius),
                                    getWindowCornerRadiusForAnimation()),
                            mWmService.mSurfaceAnimationRunner);
                    if (a.getZAdjustment() == Animation.ZORDER_TOP) {
                        mNeedsZBoost = true;
+1 −1
Original line number Diff line number Diff line
@@ -4553,7 +4553,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        anim.scaleCurrentDuration(mWmService.getWindowAnimationScaleLocked());
        final AnimationAdapter adapter = new LocalAnimationAdapter(
                new WindowAnimationSpec(anim, mSurfacePosition, false /* canSkipFirstFrame */,
                        mWmService.mWindowCornerRadius),
                        mToken.getWindowCornerRadiusForAnimation()),
                mWmService.mSurfaceAnimationRunner);
        startAnimation(mPendingTransaction, adapter);
        commitPendingTransaction();
+4 −0
Original line number Diff line number Diff line
@@ -345,4 +345,8 @@ class WindowToken extends WindowContainer<WindowState> {
                mOwnerCanManageAppTokens);
        return mOwnerCanManageAppTokens && (layer > navLayer);
    }

    float getWindowCornerRadiusForAnimation() {
        return mDisplayContent.isDefaultDisplay ? mWmService.mWindowCornerRadius : 0;
    }
}