OSDN Git Service

Support associating with an already-paired device
authorEugene Susla <eugenesusla@google.com>
Sat, 10 Jun 2017 01:03:14 +0000 (18:03 -0700)
committerEugene Susla <eugenesusla@google.com>
Mon, 12 Jun 2017 23:21:51 +0000 (16:21 -0700)
commit0c4a9266264d37e724f7372ef7ef932cf60c505c
tree063e57a2358af8c523c82eca6e3b392c5b444a77
parentffd8343ba87c7cdf84287b91972b987ffc41d4fb
Support associating with an already-paired device

This is required for migration scenario, where device(s) are already
paired(and thus no longer discoverable) but didn't go through companion
flow.
This also fixes a bug with filtering by mac address, which is also relevant to
the use-case of associating a specific device

Test: Pair with a device first, and call associate with a filter with its MAC
address and single device requested. Ensure the device is found.
Ensure only that device is ever returned when filtering by MAC address.
Bug: 62487084
Change-Id: Ic7cc6affc0648ad85b15620e8c3aba4b9fc91aa1
core/java/android/companion/BluetoothDeviceFilterUtils.java
core/java/com/android/internal/util/CollectionUtils.java
packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceDiscoveryService.java