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

Commit 1c9ea30b authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

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
parent 621c7b69
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {