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

Commit 51ae378d authored by Robert Carr's avatar Robert Carr
Browse files

ActivityRecordInputSink: Ensure timely release of SurfaceControl

Relying on the garbage collector to release SurfaceControl and trigger
destruction of server-side layers has proven to be unreliable in
monkey testing. In this case it may cause the accumulation of
a large number of InputWindowInfo, leading to oneway binder spam.

Bug: 228810413
Test: Existing tests pass
Change-Id: If961767a1209674f202518f8b8be8f930d1a43e3
parent a710d8fe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3967,6 +3967,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        } else {
            onRemovedFromDisplay();
        }
        mActivityRecordInputSink.releaseSurfaceControl();

        super.removeImmediately();
    }

+7 −0
Original line number Diff line number Diff line
@@ -99,4 +99,11 @@ class ActivityRecordInputSink {
        return inputWindowHandle;
    }

    void releaseSurfaceControl() {
        if (mSurfaceControl != null) {
            mSurfaceControl.release();
            mSurfaceControl = null;
        }
    }

}