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

Skip to content
Commit 1145987a authored by Jakub Rotkiewicz's avatar Jakub Rotkiewicz
Browse files

A2dpStateMachine: ignore connect events in connecting state

After bonding the enabled profiles are connected automatically:

BluetoothAdapterService: connectEnabledProfiles: Connecting A2dp

and this may happen multiple times. Additionally during testing
A2dpService::connect() may be invoked causing 2 redundant connect calls
that happen in Connecting state of the A2DP state machine. The events are
then deferred, and on any failure and the state change to Disconnected
they are being invoked again in Disconnected state...

While trying to handle collisions in AVDTP this is problematic, hence
this change neglects connect events when in Connecting state,
but only if there are no disconnect events already deferred. This helped as now
we allow the peer device to proceed with the connection as initiator and
we do not collide again.

Bug: 329809288
Flag: com.android.bluetooth.flags.a2dp_sm_ignore_connect_events_in_connecting_state
Test: atest A2dpStateMachine
Change-Id: I956c3a2a0bd8382654fdbdd0ffc593083b6d100f
parent cfae36f8
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