summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramVertexFixedFunction.java
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2019-09-13 16:08:18 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2019-09-20 16:31:24 -0700
commit17cf02f3110aba27491190e5418e0eb295dd0d23 (patch)
tree588444b9b24b302bc3aa710d3bdd087bc3cd7637 /rs/java/android/renderscript/ProgramVertexFixedFunction.java
parent681b432e8ba6edb46da7cceb272c0b855278a590 (diff)
AudioService: simplify/document locking
In AudioDeviceBroker, mDeviceStateLock was the main lock and was previously used almost as a global synchronization, present on the handling of most messages, and numerous other methods without actually protecting the only states it maintains. Note that BtHelper and AudioDeviceInventory have their own sync model, so they don't need to be protected by a lock from AudioDeviceBroker. This CL renames mDeviceStateLock to mDeviceBrokerLock specifically protecting: - "force use" setting for communication - Bluetooth A2DP enabled (coming from AudioManager API) - all management of the message queue, both for enqueueing and removal (which was exposed to race condition since commit dc552e9 for A2DP (dis)connection. It also removes the lock used to synchronize the audio mode owner with the SCO operations: the only information AudioDeviceBroker needed from AudioService regarding audio mode was the PID of the mode owner. The new code uses an atomic integer to store/provide this information, instead of relying on a shared lock amongst multiple classes. Add test for behavior where media gets unmuted if it was muted when the user connects an A2DP headset. Bug: 140200704 Test: atest AudioDeviceBrokerTest ; atest AudioManagerTest Change-Id: I555145c9673fc634ec0c2af9da718e084f3ac067
Diffstat (limited to 'rs/java/android/renderscript/ProgramVertexFixedFunction.java')
0 files changed, 0 insertions, 0 deletions