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
This commit is contained in:
@@ -3967,6 +3967,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
} else {
|
||||
onRemovedFromDisplay();
|
||||
}
|
||||
mActivityRecordInputSink.releaseSurfaceControl();
|
||||
|
||||
super.removeImmediately();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,4 +99,11 @@ class ActivityRecordInputSink {
|
||||
return inputWindowHandle;
|
||||
}
|
||||
|
||||
void releaseSurfaceControl() {
|
||||
if (mSurfaceControl != null) {
|
||||
mSurfaceControl.release();
|
||||
mSurfaceControl = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user