| Index: device/bluetooth/bluetooth_device.cc
|
| diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
|
| index bac4b638a4839a3697f52ab2df3d9ecd7c1b2065..9c55a577214b21ca61bbe5aec47cd0d127f1213d 100644
|
| --- a/device/bluetooth/bluetooth_device.cc
|
| +++ b/device/bluetooth/bluetooth_device.cc
|
| @@ -243,6 +243,23 @@ bool BluetoothDevice::IsTrustable() const {
|
| return false;
|
| }
|
|
|
| +BluetoothDevice::UUIDList BluetoothDevice::GetUUIDs() const {
|
| + if (!IsGattConnected()) {
|
| + return BluetoothDevice::UUIDList(advertised_uuids_.begin(),
|
| + advertised_uuids_.end());
|
| + }
|
| +
|
| + if (IsGattServicesDiscoveryComplete()) {
|
| + std::unordered_set<BluetoothUUID, BluetoothUUIDHash> local_uuids;
|
| + for (const auto& gatt_service_pair : gatt_services_) {
|
| + local_uuids.insert(gatt_service_pair.second->GetUUID());
|
| + }
|
| + return BluetoothDevice::UUIDList(local_uuids.begin(), local_uuids.end());
|
| + }
|
| +
|
| + return BluetoothDevice::UUIDList();
|
| +}
|
| +
|
| void BluetoothDevice::CreateGattConnection(
|
| const GattConnectionCallback& callback,
|
| const ConnectErrorCallback& error_callback) {
|
| @@ -333,6 +350,7 @@ BluetoothDevice::UUIDList BluetoothDevice::GetServiceDataUUIDs() const {
|
| }
|
|
|
| void BluetoothDevice::DidConnectGatt() {
|
| + advertised_uuids_.clear();
|
| for (const auto& callback : create_gatt_connection_success_callbacks_) {
|
| callback.Run(
|
| base::WrapUnique(new BluetoothGattConnection(adapter_, GetAddress())));
|
|
|