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

Skip to content
Commit e57bb8ce authored by Yasin Kilicdere's avatar Yasin Kilicdere
Browse files

Prevent deadlock on BluetoothManagerService during a user switch.

During a user switch, BluetoothManagerService restarts its profiles
via BMS.unbindAllBluetoothProfileServices method. This method calls
mContext.unbindService(psc) for each bound bluetooth profile while
holding mProfileServices lock.

But unbinding the bluetooth profile eventually gets
BMS.onServiceDisconnected method to be called, where the same
mProfileServices lock will be tried to get acquired, on a different
thread, which will cause a deadlock.

This CL makes necessary changes to prevent the deadlock.
Detailed analysis document is attached to the bug.

Bug: 300421828
Test: Manual comparison of perfetto traces
Test: atest ServiceBluetoothTests
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9fe127742e2d1d9d37b89cb606733ff310c31149)
Merged-In: I289b1bea610c24f8d39a1b5e39221721152219d1
Change-Id: I289b1bea610c24f8d39a1b5e39221721152219d1
parent 84daa526
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