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

Commit cef37fb4 authored by satok's avatar satok
Browse files

Fix a bug where surface crashes when the enter animation starts while the exit...

Fix a bug where surface crashes when the enter animation starts while the exit animation has not yet finished

Bug: 5446482
Change-Id: I2e9f2e91ab5e8b22896d12e08fac76c72c997274
parent be25d5b0
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -2578,11 +2578,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    (win.mAppToken == null || !win.mAppToken.clientHidden)) {
                displayed = !win.isVisibleLw();
                if (win.mExiting) {
                    win.mExiting = false;
                    if (win.mAnimation != null) {
                        win.mAnimation.cancel();
                        win.mAnimation = null;
                    }
                    win.cancelExitAnimationForNextAnimationLocked();
                }
                if (win.mDestroying) {
                    win.mDestroying = false;
+13 −1
Original line number Diff line number Diff line
@@ -596,6 +596,18 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }
    }

    // TODO: Fix and call finishExit() instead of cancelExitAnimationForNextAnimationLocked()
    // for avoiding the code duplication.
    void cancelExitAnimationForNextAnimationLocked() {
        if (!mExiting) return;
        if (mAnimation != null) {
            mAnimation.cancel();
            mAnimation = null;
            destroySurfaceLocked();
        }
        mExiting = false;
    }

    Surface createSurfaceLocked() {
        if (mSurface == null) {
            mReportDestroySurface = false;