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

Commit 55149303 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Only create surface when showing window if it destroys it when hiding.

The visibility of a window might be toggled to true even when it doesn't
have a surface, which is a case for windows under the lock screen. We
can't blindly create surfaces in that case, but only do it for the
windows that destroy their surfaces when they are hidden.

Bug: 25879215
Change-Id: I6cf2c6810ce02fba0d2207a56de9924c0270dfeb
parent e38bdf6b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ public final class InputWindowHandle {
                .append(", frame=[").append(frameLeft).append(",").append(frameTop).append(",")
                        .append(frameRight).append(",").append(frameBottom).append("]")
                .append(", touchableRegion=").append(touchableRegion)
                .append(", visible=").append(visible)
                .toString();

    }
+3 −2
Original line number Diff line number Diff line
@@ -1605,8 +1605,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
            // Already showing.
            return false;
        }
        if (!mHasSurface) {
            mDestroying = false;
        if (!mHasSurface && mDestroySurfaceWhenHidden) {
            // This is a window that doesn't retain the surface when it's hidden, so immediately
            // when we want to show it again, we need to create the surface for it.
            mWinAnimator.createSurfaceLocked();
        }
        if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility true: " + this);