Fix discovery of Smart Lock service in Proximity Auth over Blutooth Low Energy.
commit18d21e1eccf868ec06d59e65a93314148260e749
authormsarda <msarda@chromium.org>
Wed, 29 Apr 2015 15:38:43 +0000 (29 08:38 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 29 Apr 2015 15:39:59 +0000 (29 15:39 +0000)
tree6ca1cbc46250b70fc0722e1d1d266845e539fe93
parent81531f73bc53e0079da6bb8ddebd116dee5ef853
Fix discovery of Smart Lock service in Proximity Auth over Blutooth Low Energy.

This CL adds observers Bluetooth device changed and device removed
notifications. Each time a device changes, it checks if the device advertises
the Smart Lock service UUID. If so and if there is no pending connection to
that device, then it tries to connect to it.

This CL also forgets the Bluetooth device that advertises Smart Lock. This
ensures that the device is disconnected and its entry removed fron the Bluetooth
device controller. Note that this strategy is fine as Bluetooth Low Energy
device that advertises Smart Lock service UUID is only used by the Proximity
Auth component.

TEST=On Chrome OS, turn on Smart Lock over Bluetooth Low Energy in settings.
Install a Smart Lock app on a BLE device. On Chrome OS, sign in and then lock
the screen. Start the Smart Lock app on a BLE device and observe that Chrome OS
magically unlocks.
BUG=479670

Review URL: https://codereview.chromium.org/1113793002

Cr-Commit-Position: refs/heads/master@{#327495}
components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h
components/proximity_auth/ble/proximity_auth_ble_system.cc