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

Commit f84d9f91 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Cleanup mAnimatingExit flag before maybeUpdateTransitToWallpaper()" into nyc-mr1-dev

parents 11fbe5ec e05bcb15
Loading
Loading
Loading
Loading
+24 −9
Original line number Diff line number Diff line
@@ -337,6 +337,30 @@ class AppWindowToken extends WindowToken {
        }
    }

    void clearAnimatingFlags() {
        for (int i = allAppWindows.size() - 1; i >= 0; i--) {
            final WindowState win = allAppWindows.get(i);
            // We don't want to clear it out for windows that get replaced, because the
            // animation depends on the flag to remove the replaced window.
            //
            // We also don't clear the mAnimatingExit flag for windows which have the
            // mRemoveOnExit flag. This indicates an explicit remove request has been issued
            // by the client. We should let animation proceed and not clear this flag or
            // they won't eventually be removed by WindowStateAnimator#finishExit.
            if (!win.mWillReplaceWindow && !win.mRemoveOnExit) {
                win.mAnimatingExit = false;
                // Clear mAnimating flag together with mAnimatingExit. When animation
                // changes from exiting to entering, we need to clear this flag until the
                // new animation gets applied, so that isAnimationStarting() becomes true
                // until then.
                // Otherwise applySurfaceChangesTransaction will faill to skip surface
                // placement for this window during this period, one or more frame will
                // show up with wrong position or scale.
                win.mWinAnimator.mAnimating = false;
            }
        }
    }

    void destroySurfaces() {
        destroySurfaces(false /*cleanupOnResume*/);
    }
@@ -363,15 +387,6 @@ class AppWindowToken extends WindowToken {

            win.mWinAnimator.destroyPreservedSurfaceLocked();

            if (cleanupOnResume) {
                // If the window has an unfinished exit animation, consider that animation
                // done and mark the window destroying so that it goes through the cleanup.
                if (win.mAnimatingExit) {
                    win.mDestroying = true;
                    win.mAnimatingExit = false;
                }
            }

            if (!win.mDestroying) {
                continue;
            }
+6 −20
Original line number Diff line number Diff line
@@ -1138,6 +1138,12 @@ class WindowSurfacePlacer {
                if (wtoken == lowerWallpaperAppToken || wtoken == upperWallpaperAppToken) {
                    openingAppHasWallpaper = true;
                }
                // Clearing the mAnimatingExit flag before entering animation. It's set to
                // true if app window is removed, or window relayout to invisible.
                // This also affects window visibility. We need to clear it *before*
                // maybeUpdateTransitToWallpaper() as the transition selection depends on
                // wallpaper target visibility.
                wtoken.clearAnimatingFlags();
            }

            voiceInteraction |= wtoken.voiceInteraction;
@@ -1262,26 +1268,6 @@ class WindowSurfacePlacer {
                int layer = -1;
                for (int j = 0; j < wtoken.allAppWindows.size(); j++) {
                    final WindowState win = wtoken.allAppWindows.get(j);
                    // Clearing the mAnimatingExit flag before entering animation. It will be set to true
                    // if app window is removed, or window relayout to invisible. We don't want to
                    // clear it out for windows that get replaced, because the animation depends on
                    // the flag to remove the replaced window.
                    //
                    // We also don't clear the mAnimatingExit flag for windows which have the
                    // mRemoveOnExit flag. This indicates an explicit remove request has been issued
                    // by the client. We should let animation proceed and not clear this flag or
                    // they won't eventually be removed by WindowStateAnimator#finishExit.
                    if (!win.mWillReplaceWindow && !win.mRemoveOnExit) {
                        win.mAnimatingExit = false;
                        // Clear mAnimating flag together with mAnimatingExit. When animation
                        // changes from exiting to entering, we need to clear this flag until the
                        // new animation gets applied, so that isAnimationStarting() becomes true
                        // until then.
                        // Otherwise applySurfaceChangesTransaction will faill to skip surface
                        // placement for this window during this period, one or more frame will
                        // show up with wrong position or scale.
                        win.mWinAnimator.mAnimating = false;
                    }
                    if (win.mWinAnimator.mAnimLayer > layer) {
                        layer = win.mWinAnimator.mAnimLayer;
                    }