GAP: Handle the race condition cases in auto connect logic
Issue:
Auto connection failing when onUuidChanged and onBondingStateChanged
triggered in race condition.
Steps:
1.Turn on BT
2.Scan the remote headset from DUT
3.Initiating pairing to remote device
4.unpair the remote from DUT UI
Repeat steps from 2 to 4. Some times auto connection not
getting initiated from DUT.
Root Cause:
if mProfiles accessed simultaneously from onUuidChanged and
connectAllEnabledProfiles with two different process context.
mProfiles not reflecting latest value in connectAllEnabledProfiles,
Settings not able to initiate Auto connection as mProfiles
list shown as empty.
onBondingStateChanged getting triggered multiple times from settings
with different process contexts and BondingInitiatedLocally resets in first
instance when no profiles added, its leading auto connection failure
FIX:
- mProfiles accessed inside onUuidChanged without syncronization,also
mProfiles empty check already there in connectWithoutResettingTimer
- Hence remove redundant mProfiles empty check in onUuidChanged
- Reset BondingInitiatedLocally flag while initiating connection.
[wight554: updated code from LA.QSSI.11.0.r1-05600-qssi.0]
Conflicts:
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
Change-Id: I88aa6a6cd46d264f4dd32db71e413079bbd40779
CRs-Fixed: 2630956
Signed-off-by:
Volodymyr Zhdanov <wight554@gmail.com>
Loading
Please register or sign in to comment