Use CopyOnWriteArrayList in RecordingController.

Previously there's nothing preventing recording callback to be removed
when it is called. This creates cocurrent problems and would crashes
system ui. This patch replaces the ArrayList with CopyOnWriteArrayList
to avoid this issue.

Bug: b/189216310
Test: test by triggering screen record in quick settings
Test: test by quickly toggling screen record
Change-Id: I6e82f92689b45c92cdad6a811e3e5ddc96a10530
1 file changed