| Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc
|
| diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
|
| index cb133c00114cd19bf886157dff17cf9e3c4cdb34..fcb4ada4d4029ff35814bbae1f0fa55a4e70dbc5 100644
|
| --- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
|
| +++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
|
| @@ -322,6 +322,7 @@
|
| characteristic_id_to_notify_session_.clear();
|
| active_characteristic_threads_.clear();
|
| connections_.clear();
|
| + devices_with_discovered_services_.clear();
|
| }
|
|
|
| set_adapter(std::move(mock_adapter));
|
| @@ -523,6 +524,8 @@
|
| const std::string& device_id = device->GetAddress();
|
| VLOG(1) << "Services discovered for device: " << device_id;
|
|
|
| + devices_with_discovered_services_.insert(device_id);
|
| +
|
| auto iter = pending_primary_services_requests_.find(device_id);
|
| if (iter == pending_primary_services_requests_.end()) {
|
| return;
|
| @@ -785,7 +788,7 @@
|
| }
|
|
|
| // 3.
|
| - if (query_result.device->IsGattServicesDiscoveryComplete()) {
|
| + if (IsServicesDiscoveryCompleteForDevice(device_id)) {
|
| VLOG(1) << "Service not found in device.";
|
| RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome::NOT_FOUND);
|
| Send(new BluetoothMsg_GetPrimaryServiceError(
|
| @@ -1341,6 +1344,11 @@
|
| return result;
|
| }
|
|
|
| +bool BluetoothDispatcherHost::IsServicesDiscoveryCompleteForDevice(
|
| + const std::string& device_id) {
|
| + return ContainsKey(devices_with_discovered_services_, device_id);
|
| +}
|
| +
|
| void BluetoothDispatcherHost::AddToPendingPrimaryServicesRequest(
|
| const std::string& device_id,
|
| const PrimaryServicesRequest& request) {
|
|
|