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

Commit 2eb15342 authored by Craig Mautner's avatar Craig Mautner
Browse files

Destroy surfaces when display is removed.

Fixes bug 10226153.

Change-Id: I4eb8b14258985768d36745260ad4e62ba6c78844
parent 7a2de061
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -427,6 +427,12 @@ class DisplayContent {
        }
    }

    void close() {
        for (int stackBoxNdx = mStackBoxes.size() - 1; stackBoxNdx >= 0; --stackBoxNdx) {
            mStackBoxes.get(stackBoxNdx).close();
        }
    }

    public void dump(String prefix, PrintWriter pw) {
        pw.print(prefix); pw.print("Display: mDisplayId="); pw.println(mDisplayId);
        final String subPrefix = "  " + prefix;
+10 −0
Original line number Diff line number Diff line
@@ -380,6 +380,16 @@ public class StackBox {
        mSecond.switchUserStacks(userId);
    }

    void close() {
        if (mStack != null) {
            mStack.mDimLayer.mDimSurface.destroy();
            mStack.mAnimationBackgroundSurface.mDimSurface.destroy();
            return;
        }
        mFirst.close();
        mSecond.close();
    }

    public void dump(String prefix, PrintWriter pw) {
        pw.print(prefix); pw.print("mParent="); pw.println(mParent);
        pw.print(prefix); pw.print("mBounds="); pw.print(mBounds.toShortString());
+1 −1
Original line number Diff line number Diff line
@@ -10818,7 +10818,7 @@ public class WindowManagerService extends IWindowManager.Stub
        final DisplayContent displayContent = getDisplayContentLocked(displayId);
        if (displayContent != null) {
            mDisplayContents.delete(displayId);

            displayContent.close();
            if (displayId == Display.DEFAULT_DISPLAY) {
                unregisterPointerEventListener(displayContent.mTapDetector);
            }