OSDN Git Service

Call BTA_GATTS_AddService on correct thread
authorJakub Pawlowski <jpawlowski@google.com>
Wed, 7 Feb 2018 19:37:18 +0000 (11:37 -0800)
committerJakub Pawlowski <jpawlowski@google.com>
Wed, 7 Feb 2018 20:48:17 +0000 (20:48 +0000)
commit541862ce72d4203f015acb0956541767fa2470f1
tree01457a18ed76a22b7d9fe7264f1df3abd285640f
parent0c0d2975d752289f53bf18a4b74c94b2f74c1235
Call BTA_GATTS_AddService on correct thread

Right now BTA_GATTS_AddService is incorrectly called on btif thread.
This might lead to situations where it is executed while bta thread is
already cleaning up, and deleted the control blocks, resulting in crashes.
From now on, execute it on bta thread. This ensures that it is executed
before control blocks are freed.

Test: sl4a GattClientTest
Bug: 73054849
Change-Id: Ie2bf80414bceba2590c21d3825c78fbb58449520
bta/gatt/bta_gatts_api.cc
bta/include/bta_gatt_api.h
btif/src/btif_gatt_server.cc