AudioDeviceBroker: avoid acquiring mDeviceStateLock when not necessary

Do not lock mDeviceStateLock whne calling BtHelper.getCodecWithFallback()
to void cross deadlocks with BT service.

Also make mBluetoothA2dpEnabled an atomic boolean and do not lock
mDeviceStateLock when accessing it.

Also remove dead code isAvrcpAbsoluteVolumeSupported()

Bug: 324420709
Bug: 329911879
Test: make
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a4a848f58b0c7f1cc19a0d8dd537929467da1d17)
Merged-In: Ie8d824e53fd4076e90a81076f1974354fef4dd13
Change-Id: Ie8d824e53fd4076e90a81076f1974354fef4dd13
2 files changed