forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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}
- Loading branch information
ortuno
authored and
Commit bot
committed
Sep 27, 2016
1 parent
21ffea6
commit 154da84
Showing
8 changed files
with
42 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters