Synchronize active bluetooth device

Ensure that we synchronize read/write on the active bluetooth device reference so that another thread doesn't modify it while it's being referenced. We were seeing instances where the active device was null even though there was an explicit NPE check before referencing it.

Bug: 382590000
Test: atest CallAudioRouteControllerTest
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f47041c250b8f9dbff3db71b7b8f4aaff97ffe67)
Merged-In: I4eddb6e696717e136771c97f5f8f89a7173e646d
Change-Id: I4eddb6e696717e136771c97f5f8f89a7173e646d
1 file changed