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

Commit 4113ffac authored by Chong Zhang's avatar Chong Zhang
Browse files

Make sure mExiting is cleared when app is set to visible

Reset mExiting even if we are not going to do enter animation.

Also make sure has surface state is set correctly if restoring.

bug: 27235356

Change-Id: Ie6e78baefc8242015ed9c37ab221c39860682ab2
parent a2cc0c2c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -393,7 +393,9 @@ class AppWindowToken extends WindowToken {
        int numDrawn = 0;
        for (int i = windows.size() - 1; i >= 0; i--) {
            WindowState w = windows.get(i);
            if (w.hasSavedSurface()) {
                w.restoreSavedSurface();
            }
            if (w != startingWindow && !w.mAppDied
                    && (!mAppAnimator.freezingScreen || !w.mAppFreezing)) {
                numInteresting++;
@@ -403,7 +405,7 @@ class AppWindowToken extends WindowToken {
            }
        }

        allDrawn |= (numInteresting == numDrawn);
        allDrawn |= (numInteresting > 0) && (numInteresting == numDrawn);

        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.d(TAG,
                "restoreSavedSurfaces: " + appWindowToken + " allDrawn=" + allDrawn);
+1 −1
Original line number Diff line number Diff line
@@ -4224,6 +4224,7 @@ public class WindowManagerService extends IWindowManager.Stub
                wtoken.removeAllWindows();
            } else if (visible) {
                wtoken.mAppStopped = false;
                wtoken.setWindowsExiting(false);
            }

            // If we are preparing an app transition, then delay changing
@@ -4241,7 +4242,6 @@ public class WindowManagerService extends IWindowManager.Stub
                }
                wtoken.inPendingTransaction = true;
                if (visible) {
                    wtoken.setWindowsExiting(false);
                    mOpeningApps.add(wtoken);
                    wtoken.startingMoved = false;
                    wtoken.mEnteringAnimation = true;
+3 −0
Original line number Diff line number Diff line
@@ -1868,6 +1868,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    }

    public void restoreSavedSurface() {
        if (!mSurfaceSaved) {
            return;
        }
        mSurfaceSaved = false;
        setHasSurface(true);
        mWinAnimator.mDrawState = WindowStateAnimator.READY_TO_SHOW;