[CrOS MultiDevice] Fix BLE scan result handling.
Previously, we would attempt a BLE scan any time that we got a DeviceChanged() or DeviceAdded() callback. However, the DeviceChanged() callback was invoked when a device was in the process of disconnecting, meaning that we would see a disconnecting device, then try to start a connection immediately. This resulted in spurious connection requests which could sometime cause a deadlock in underlying Bluetooth code. Additionally, we would rely on the DeviceChanged() and DeviceRemoved() callbacks to listen for Bluetooth disconnections, which also resulted in error-prone disconnections. This CL updates both call sites to use the updated DeviceAdvertisementReceived() and DeviceConnectedStateChanged() callbacks instead. Bug: 898334 Change-Id: I743e51e6e47194649ab6852966b9d892c3ef334d Reviewed-on: https://chromium-review.googlesource.com/c/1359478 Commit-Queue: Kyle Horimoto <khorimoto@chromium.org> Reviewed-by:Giovanni Ortuño Urquidi <ortuno@chromium.org> Cr-Commit-Position: refs/heads/master@{#613358}
Showing
Please register or sign in to comment