OSDN Git Service

Fix race condition when doing GATT discovery
authorJakub Pawlowski <jpawlowski@google.com>
Sat, 12 Dec 2015 06:35:01 +0000 (22:35 -0800)
committerJakub Pawlowski <jpawlowski@google.com>
Sat, 12 Dec 2015 06:51:36 +0000 (22:51 -0800)
commitbac1f06eeded99fa43e00ac4114846a96c22e03c
treeecfec2f5c5dfb2fc318d002c33aa44b650f0b5b2
parent12322a0f8069c920f08860ee3b53909a7a69934f
Fix race condition when doing GATT discovery

Right now if discovery to multiple GATT clients is happening
simultaneously, onSearchComplete will be run only for device that
finishes discovery last, while it should be run for each device.

mSearchQueue is one for all discovery sessions. Instead of checking if
it's empty, we must check if there are no elements for given connId.

Bug: 26038939
Change-Id: I9417cd7be8cab4b808ce7f045861e1adc2055629
src/com/android/bluetooth/gatt/GattService.java
src/com/android/bluetooth/gatt/SearchQueue.java