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

Commit b8bb3f71 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "WindowManager: Take care with Surface lifetime during relayout to invisible." into oc-dev

parents 26ba9f88 89a28ab0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -674,7 +674,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> {
                if (win.getDisplayContent().mWallpaperController.isWallpaperTarget(win)) {
                    wallpaperDestroyed = true;
                }
                win.destroyOrSaveSurface();
                win.destroyOrSaveSurfaceUnchecked();
            } while (i > 0);
            mService.mDestroySurface.clear();
        }
+6 −1
Original line number Diff line number Diff line
@@ -2141,7 +2141,12 @@ public class WindowManagerService extends IWindowManager.Stub
            if (mInputMethodWindow == win) {
                setInputMethodWindowLocked(null);
            }
            win.destroyOrSaveSurface();
            boolean stopped = win.mAppToken != null ? win.mAppToken.mAppStopped : false;
            // We set mDestroying=true so AppWindowToken#notifyAppStopped in-to destroy surfaces
            // will later actually destroy the surface if we do not do so here. Normally we leave
            // this to the exit animation.
            win.mDestroying = true;
            win.destroySurface(false, stopped);
        }
        // TODO(multidisplay): Magnification is supported only for the default display.
        if (mAccessibilityController != null && win.getDisplayId() == DEFAULT_DISPLAY) {
+5 −2
Original line number Diff line number Diff line
@@ -2710,7 +2710,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    + " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed
                    + " win.mRemoveOnExit=" + mRemoveOnExit);
            if (!cleanupOnResume || mRemoveOnExit) {
                destroyOrSaveSurface();
                destroyOrSaveSurfaceUnchecked();
            }
            if (mRemoveOnExit) {
                removeImmediately();
@@ -2725,7 +2725,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        return destroyedSomething;
    }

    void destroyOrSaveSurface() {
    // Destroy or save the application surface without checking
    // various indicators of whether the client has released the surface.
    // This is in general unsafe, and most callers should use {@link #destroySurface}
    void destroyOrSaveSurfaceUnchecked() {
        mSurfaceSaved = shouldSaveSurface();
        if (mSurfaceSaved) {
            if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ class WindowStateAnimator {
            mAnimation.cancel();
            mAnimation = null;
            mLocalAnimating = false;
            mWin.destroyOrSaveSurface();
            mWin.destroyOrSaveSurfaceUnchecked();
        }
    }