Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 80127567 authored by Jack He's avatar Jack He
Browse files

LeAudioService: Use ReentrantReadWriteLock

Currently, in LeAudioService we use synchronized blocks to acces
mGroupDescriptors list. Gradually, as we wrapped more and more code in
synchronized blocks, deadlocks and TimeoutExceptions started popping
around.

Examples include BT stack calling AF from synchronized block, and
then AF calling BT stack back, to check some property of LE Audio
device.

mGroupDescriptors are modified just in 3 places, so accessing it is
perfect candidate for usage of ReentrantReadWriteLock - it should solve
all the deadlocks.

Bug: 325674688
Bug: 326295400
Test: atest BluetoothInstrumentationTests
Test:
  1. Bond, unbond, reconnect LE Audio device, preferably one using CSIP.
  2. Observe logcat output and verify no TimeoutException is thrown from LeAudioService
Change-Id: Icdb944981ddceca39df95694933d05ffe78ee72e
parent bc75e6fa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment