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

Commit 44b00555 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"...

Merge "Make sure preserved surface is removed when it\'s no longer needed" into nyc-dev am: 0a872f0b
am: 5c99f3a4

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

Change-Id: I65b9b588836f283eda56b196b7b15f0dd9fb73d5
parents 5afb48ad 5c99f3a4
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) {