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

Skip to content
Commit 282ac82a authored by Venkata Jagadeesh Garaga's avatar Venkata Jagadeesh Garaga Committed by Bruno Martins
Browse files

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: default avatarVolodymyr Zhdanov <wight554@gmail.com>
parent 408ffd13
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment