OSDN Git Service

Properly disconnect GATT connection during noisy scans
authorArman Uguray <armansito@google.com>
Wed, 15 Jul 2015 23:05:32 +0000 (16:05 -0700)
committerArman Uguray <armansito@google.com>
Thu, 16 Jul 2015 18:16:18 +0000 (18:16 +0000)
commit50333a25ba3dac54033738d1e2a2688e2977ff2e
treeefd74a287254607f6e3b95cb8f19ce67600ae9b2
parent165332bc6795049754fafe35024c2c605796c96a
Properly disconnect GATT connection during noisy scans

This patch fixes an issue that is reproducible in highly noisy environments
(massive deployment of BLE beacons), through repeated connect/disconnect
attempts on a remote peripheral while scanning for beacons in the background.
The state machine in bta/gatt has a special control flow for handling disconnect
requests during discovery, which in this case failed to resolve the original
request by issuing an HCI_Disconnect command. This is now fixed by always
explicitly triggering the connection close sequence once the discovery state has
been cleaned up.

This patch also includes a fix for a crash that occurred as a side-effect of the
scenario described above.

Bug: 22350508
Change-Id: Ie9cbd3c8f54239b142bfb8dde80d9581ae70ed43
bta/gatt/bta_gattc_act.c
bta/sys/bta_sys_main.c