Skip to content
Snippets Groups Projects
Commit 29687e21 authored by Jack He's avatar Jack He
Browse files

HFP: Fix connection colision handling

* When there is a connection collison, and remote device is trying to
  connect to HFP server channel while we try to connect to remote's
  server channel as a client. If the remote device succssfully connect
  to us, we should drop our connection request to remote device and
  accept remote device's connection request. As result, we will observe
  1. Our connection request fails, this propagate up to Java layer and
  also clean up any states in these layers
  2. Remote connection request succeeds, this propagate up to Java layer
     as well as a new incoming connection
* Added BTA_AG_COLLISION_EVT to formally handle AG collision in state
  machine
* Modified bta_ag_resume_open to re-send BTA_AG_API_OPEN_EVT instead of
  modifying the state machine state directly. State machine states
  should only be modified by state machine handler
* Ignore RFCOMM open event if PORT_CheckConnection fails
* Added StackRfcommTest.TestConnectionCollision to reproduce this
  scenario with 100% certainty
* Add static checks to HFP BTA state machine to make sure action and
  event indices match enum sizes

Bug: 77224743
Test: connect to multiple remote devices with HFP, MAP and PBAP
      StackRfcommTest.TestConnectionCollision
      btestplans/details/158641/3975
Change-Id: Ib3652784b123abe195e7bd30421ef5f4345b1d4d
parent f7873507
No related branches found
No related tags found
No related merge requests found
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