Chromium Code Reviews
Descriptionbluetooth: Close and null out BluetoothGatt on the UI Thread
There was a race between posting a task to notify of disconnection and gatt
operations:
1. On Bluetooht thread, device disconnects event arrives, nulls
mBluetoothGatt and posts a task to the UI thread to notify of
disconnection.
2. Before the disconnection task runs on the UI thread, Gatt Operation
thinks device is still connected and tries to use mBluetoothGatt. This
causes a NullPointerException.
Changes OnConnectionStateChanged immediately post to the UI thread.
[1] Post a task when sending GATT events http://crrev.com/2708513002
[2.1] Close and null out BluetoothGatt on the UI Thread (This patch).
[2.2] Copy characteristic's value before posting task http://crrev.com/2707823002
BUG=691407
Review-Url: https://codereview.chromium.org/2702163002
Cr-Commit-Position: refs/heads/master@{#455038}
Committed: https://chromium.googlesource.com/chromium/src/+/1c929fc283a435c85b073e317bfb65c5957a1d81
Patch Set 1 #
Total comments: 2
Patch Set 2 : Make comment more explicit #Patch Set 3 : Fix test #
Depends on Patchset: Messages
Total messages: 26 (20 generated)
|
|||||||||||||||||||||||||||||||||||||