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

Commit 5c99f3a4 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "Make sure preserved surface is removed when it\'s no longer needed" into nyc-dev

am: 0a872f0b

* commit '0a872f0b':
  Make sure preserved surface is removed when it's no longer needed

Change-Id: Ic9c34c83bfe3892ad96d9f1f3b5578ebf8325224
parents b71bf2f0 0a872f0b
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -329,11 +329,14 @@ class AppWindowToken extends WindowToken {
        final DisplayContentList displayList = new DisplayContentList();
        for (int i = allWindows.size() - 1; i >= 0; i--) {
            final WindowState win = allWindows.get(i);
            if (!win.mDestroying) {

            if (!(mAppStopped || win.mWindowRemovalAllowed)) {
                continue;
            }

            if (!(mAppStopped || win.mWindowRemovalAllowed)) {
            win.mWinAnimator.destroyPreservedSurfaceLocked();

            if (!win.mDestroying) {
                continue;
            }

+8 −3
Original line number Diff line number Diff line
@@ -659,6 +659,13 @@ class WindowStateAnimator {
        mDestroyPreservedSurfaceUponRedraw = false;
    }

    void markPreservedSurfaceForDestroy() {
        if (mDestroyPreservedSurfaceUponRedraw
                && !mService.mDestroyPreservedSurface.contains(mWin)) {
            mService.mDestroyPreservedSurface.add(mWin);
        }
    }

    WindowSurfaceController createSurfaceLocked() {
        final WindowState w = mWin;
        if (w.hasSavedSurface()) {
@@ -1518,9 +1525,7 @@ class WindowStateAnimator {

            if (prepared && mLastHidden && mDrawState == HAS_DRAWN) {
                if (showSurfaceRobustlyLocked()) {
                    if (mDestroyPreservedSurfaceUponRedraw) {
                        mService.mDestroyPreservedSurface.add(mWin);
                    }
                    markPreservedSurfaceForDestroy();
                    mAnimator.requestRemovalOfReplacedWindows(w);
                    mLastHidden = false;
                    if (mIsWallpaper) {