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

Commit 7098dbd4 authored by Robert Carr's avatar Robert Carr Committed by Rob Carr
Browse files

Allow saving child surfaces.

We can and should save child surfaces as the client side window
state hasn't been torn down in the case where we would otherwise save.
So, if we destroy the Surface, the client will continue to render
and crash.

Bug: 26793431
Bug: 25780116
Bug: 26777815
Change-Id: Ia043b7af24b9370fc17a5b57226566f94c08ba4e
parent d11c15d4
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -120,6 +120,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    static final int DRAG_RESIZE_MODE_FREEFORM = 0;
    static final int DRAG_RESIZE_MODE_DOCKED_DIVIDER = 1;

    static final boolean DEBUG_DISABLE_SAVING_SURFACES = false;

    final WindowManagerService mService;
    final WindowManagerPolicy mPolicy;
    final Context mContext;
@@ -1795,10 +1797,6 @@ final class WindowState implements WindowManagerPolicy.WindowState {
            return false;
        }

        if (isChildWindow()) {
            return false;
        }

        Task task = getTask();
        if (task == null || task.inHomeStack()) {
            // Don't save surfaces for home stack apps. These usually resume and draw
@@ -1812,6 +1810,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
            return false;
        }

        if (DEBUG_DISABLE_SAVING_SURFACES) {
            return false;
        }

        return mAppToken.shouldSaveSurface();
    }