bluetooth: Classic Bluetooth devices are constantly being added and removed. |
|||||||
Issue descriptionThere is a bug in the way classic devices are being removed that causes BluetoothAdapter to constantly remove and add devices. It seems getLastInquiryUpdate is returning nil for classic devices which makes it look like the device should be remove because it expired but then AddPairedDevices is called and the device is added again.
,
Aug 24 2016
,
Aug 24 2016
,
Aug 30 2016
,
Aug 30 2016
,
Sep 19 2016
Is it the same as https://bugs.chromium.org/p/chromium/issues/detail?id=648120?
,
Sep 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/154da849a1f7106c4efb3b514d88eac45a39afaa commit 154da849a1f7106c4efb3b514d88eac45a39afaa Author: ortuno <ortuno@chromium.org> Date: Tue Sep 27 01:27:23 2016 bluetooth: mac: Improve classic device discovery and update There are a couple of problems with the current implementation of classic device discovery: 1. IOBluetoothDeviceInquiry's cache is never cleaned which means that only the first discovery session will find the device. (Since the device is still in the cache future discovery session will not be notified of the device being found.) We could send notifications for all devices in the cache but then we could be notifying of devices that are no longer around. 2. IOBluetoothDevice getLastInquiryUpdate returns nil even for devices that have just been discovered during an inquiry procedure. This causes us to immediately remove a device that we just discovered. 3. IOBluetoothDevice pairedDevices sometimes returns devices that are not paired which causes us to add a non paired device. Solutions: 1. Clean cache every time StartDiscovery is called. This means new sessions will be notified of previously seen. Which allows us to implement the solution for 2. 2. Now that we notify whenever we see a device, we can update our cross platform last_update_time_. Then when we are removing outdated devices we can check last_update_time_ to see if the device should be removed. 3. Check [IOBluetoothDevice isPaired] before adding a device. Also changes some VLOG(1)s to VLOG(3) since they were spamming the logs. BUG=618650, 638715 Review-Url: https://codereview.chromium.org/2282763004 Cr-Commit-Position: refs/heads/master@{#421069} [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_adapter.cc [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_adapter_mac.mm [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_classic_device_mac.h [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_classic_device_mac.mm [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_device.cc [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_device.h [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_discovery_manager_mac.mm [modify] https://crrev.com/154da849a1f7106c4efb3b514d88eac45a39afaa/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm
,
Sep 27 2016
,
Mar 3 2017
,
Mar 3 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by ortuno@chromium.org
, Aug 17 2016