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

Commit e390cbd9 authored by chaviw's avatar chaviw
Browse files

Don't start Window enter animation as a result of AWT becoming visible.

There are some cases where AWT becomes visible without an animation. It
will then start a WindowState enter animation if WS is not visible yet.
However, this is problematic since the WS may not be ready to become
visible yet. For example, relayout may not have been called yet to
create a surface and the size of the surface is not yet set. This causes
problems when determining the position of the leash when the animation
is created. Instead allow the WS relayout to handle starting the
enter animation so the WS is set properly.
As for the case where AWT is becoming not visible without an animation, but
WS is still visible, create an exit animation for the WS. This is
because there won't be a client to trigger this animation.

Change-Id: Ic9215a0c96f219f5bc87b16067755af582883a5d
Fixes: 77447982
Test: Issue from bug
parent 167032ab
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1701,12 +1701,17 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            return changed;
        }

        if (visible != isVisibleNow()) {
            if (!runningAppAnimation) {
        final boolean isVisibleNow = isVisibleNow();
        if (visible != isVisibleNow) {
            // Run exit animation if:
            // 1. App visibility and WS visibility are different
            // 2. App is not running an animation
            // 3. WS is currently visible
            if (!runningAppAnimation && isVisibleNow) {
                final AccessibilityController accessibilityController =
                        mService.mAccessibilityController;
                final int winTransit = visible ? TRANSIT_ENTER : TRANSIT_EXIT;
                mWinAnimator.applyAnimationLocked(winTransit, visible);
                final int winTransit = TRANSIT_EXIT;
                mWinAnimator.applyAnimationLocked(winTransit, false /* isEntrance */);
                //TODO (multidisplay): Magnification is supported only for the default
                if (accessibilityController != null && getDisplayId() == DEFAULT_DISPLAY) {
                    accessibilityController.onWindowTransitionLocked(this, winTransit);