OSDN Git Service

HFP: Only advance BTIF queue for outgoing connections
authorJack He <siyuanh@google.com>
Thu, 24 May 2018 22:53:27 +0000 (15:53 -0700)
committerJack He <siyuanh@google.com>
Fri, 25 May 2018 23:37:08 +0000 (23:37 +0000)
commitf1466605c3cf02f2efac2ca8718f01459ab1c0f6
treeaa5890cdf681d475f7143114023a7c2b5588cc76
parentc9a04d0a3eff7b583754265e854bf72fff3cf273
HFP: Only advance BTIF queue for outgoing connections

* Modify HFP btif layer to only advance queue when there is a
  connection outcome for outgoing connections
* During an ACL collision, incoming connection may preempt outgoing
  connection and come back to the upper layer in a separate control
  block. In this case, we should not advance the btif queue until the
  outgoing connection sends callback to the btif layer
* When RFCOMM connection is successful, but SLC connection failed, we
  should also send callback to Java layer and advance the queue. We
  should only do this when transition from RFCOMM connected to
  Disconnected, not from SLC connected to Disconnected
* We should only advance the queue after sending connection state update
  to Java layer
* This prevents the crash in connect_int() where we check for any
  control block that is left in connecting state

Bug: 80251999
Test: connect HFP devices rapidly to trigger ACL collision
      testplans/details/166812/3975
Change-Id: Iba3736c77d8ef4a4701896461042466c26bc4820
(cherry picked from commit 8ced3dfacba328b1260096b93b9e9e6f65929fe3)
btif/src/btif_hf.cc
btif/src/btif_mce.cc