AudioService: RecordActivityMonitor: fix unbounded list growth

This CL fixes the growing list of Dispatchers in
RecordActivityMonitor by comparing dispatcher callback
via asBinder() method of the interface.

Bug: 242056995
Test: use the repro app from the bug
Change-Id: I3a2674dd339b84ecff609eef042ca41484a43255
This commit is contained in:
Mikhail Naganov
2022-08-11 00:05:09 +00:00
parent 621c7b6946
commit 1c9ea30bd7

View File

@@ -337,7 +337,7 @@ public final class RecordingActivityMonitor implements AudioSystem.AudioRecordin
boolean hasPublicClients = false;
while (clientIterator.hasNext()) {
RecMonitorClient rmc = clientIterator.next();
if (rcdb.equals(rmc.mDispatcherCb)) {
if (rcdb.asBinder().equals(rmc.mDispatcherCb.asBinder())) {
rmc.release();
clientIterator.remove();
} else {