Commit 7e31e972 authored by Venkata Jagadeesh Garaga's avatar Venkata Jagadeesh Garaga Committed by venkata Jagadeesh garaga
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.

Change-Id: I88aa6a6cd46d264f4dd32db71e413079bbd40779
CRs-Fixed: 2630956
parent 20eb3d03
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment