diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-06-05 17:27:05 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-06-18 08:33:46 +0000 |
commit | 9f4560b1027ae06fdb497023cdcaf91b8511fa74 (patch) | |
tree | f9789c1b2941956c5cc104cf03c6b6cc93759152 /chromium/device | |
parent | d17ea114e5ef69ad5d5d7413280a13e6428098aa (diff) | |
download | qtwebengine-chromium-9f4560b1027ae06fdb497023cdcaf91b8511fa74.tar.gz |
BASELINE: Update Chromium to 67.0.3396.76
Change-Id: I9a14af4efb092ab203e9364f0779fca781909a38
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/device')
-rw-r--r-- | chromium/device/bluetooth/chromeos/bluetooth_utils.cc | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/chromium/device/bluetooth/chromeos/bluetooth_utils.cc b/chromium/device/bluetooth/chromeos/bluetooth_utils.cc index 605115b4082..71f45bf0644 100644 --- a/chromium/device/bluetooth/chromeos/bluetooth_utils.cc +++ b/chromium/device/bluetooth/chromeos/bluetooth_utils.cc @@ -8,6 +8,12 @@ namespace device { namespace { +// https://www.bluetooth.com/specifications/gatt/services. +const char kHIDServiceUUID[] = "1812"; + +// https://www.bluetooth.com/specifications/assigned-numbers/16-bit-uuids-for-sdos. +const char kSecurityKeyServiceUUID[] = "FFFD"; + // Get limited number of devices from |devices| and // prioritize paired/connecting devices over other devices. BluetoothAdapter::DeviceList GetLimitedNumDevices( @@ -42,8 +48,29 @@ BluetoothAdapter::DeviceList FilterUnknownDevices( const BluetoothAdapter::DeviceList& devices) { BluetoothAdapter::DeviceList result; for (BluetoothDevice* device : devices) { - if (device->GetDeviceType() != device::BluetoothDeviceType::UNKNOWN) - result.push_back(device); + switch (device->GetType()) { + // Device with invalid bluetooth transport is filtered out. + case BLUETOOTH_TRANSPORT_INVALID: + break; + // For LE devices, check the service UUID to determine if it supports HID + // or second factor authenticator (security key). + case BLUETOOTH_TRANSPORT_LE: + if (base::ContainsKey(device->GetUUIDs(), + device::BluetoothUUID(kHIDServiceUUID)) || + base::ContainsKey(device->GetUUIDs(), + device::BluetoothUUID(kSecurityKeyServiceUUID))) { + result.push_back(device); + } + break; + // For classic and dual mode devices, only filter out if the name is empty + // because the device could have an unknown or even known type and still + // also provide audio/HID functionality. + case BLUETOOTH_TRANSPORT_CLASSIC: + case BLUETOOTH_TRANSPORT_DUAL: + if (device->GetName()) + result.push_back(device); + break; + } } return result; } |