Skip to content
Commit 07bd4300 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioService: fix capture policy restoration

 Fix ConcurrentModificationException thrown during capture policy
restoration. The code was retrieving the list of mappings from
uid to capture policies (ALLOW_CAPTURE_*) to send them to
AudioSystem. In case of failure, the capture policy was reset
and thus modified the mapping list.
 Because the iteration happened on the same list it was trying to
modify, an exception was thrown.
 The fix consists in iterating over a copy of the list of mappings
instead of the actual list, a private field in the PlaybackMonitor
class.

Bug: 192496758
Test: atest AudioPlaybackCaptureTest, AudioPlaybackConfigurationTest
Change-Id: I80afc28e5ddd8d389803306a7fa6da8f6fec3987
parent 37e2de8f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment