| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 583 |
| 584 DCHECK(devices_.find(device_bluez->GetAddress()) == devices_.end()); | 584 DCHECK(devices_.find(device_bluez->GetAddress()) == devices_.end()); |
| 585 devices_.set(device_bluez->GetAddress(), | 585 devices_.set(device_bluez->GetAddress(), |
| 586 std::unique_ptr<BluetoothDevice>(device_bluez)); | 586 std::unique_ptr<BluetoothDevice>(device_bluez)); |
| 587 NotifyDeviceAddressChanged(device_bluez, old_address); | 587 NotifyDeviceAddressChanged(device_bluez, old_address); |
| 588 break; | 588 break; |
| 589 } | 589 } |
| 590 } | 590 } |
| 591 } | 591 } |
| 592 | 592 |
| 593 if (property_name == properties->service_data.name()) |
| 594 device_bluez->UpdateServiceData(); |
| 595 |
| 593 if (property_name == properties->bluetooth_class.name() || | 596 if (property_name == properties->bluetooth_class.name() || |
| 594 property_name == properties->appearance.name() || | 597 property_name == properties->appearance.name() || |
| 595 property_name == properties->address.name() || | 598 property_name == properties->address.name() || |
| 596 property_name == properties->alias.name() || | 599 property_name == properties->alias.name() || |
| 597 property_name == properties->paired.name() || | 600 property_name == properties->paired.name() || |
| 598 property_name == properties->trusted.name() || | 601 property_name == properties->trusted.name() || |
| 599 property_name == properties->connected.name() || | 602 property_name == properties->connected.name() || |
| 600 property_name == properties->uuids.name() || | 603 property_name == properties->uuids.name() || |
| 601 property_name == properties->rssi.name() || | 604 property_name == properties->rssi.name() || |
| 602 property_name == properties->tx_power.name()) { | 605 property_name == properties->tx_power.name() || |
| 606 property_name == properties->service_data.name()) { |
| 603 NotifyDeviceChanged(device_bluez); | 607 NotifyDeviceChanged(device_bluez); |
| 604 } | 608 } |
| 605 | 609 |
| 606 if (property_name == properties->services_resolved.name() && | 610 if (property_name == properties->services_resolved.name() && |
| 607 properties->services_resolved.value()) { | 611 properties->services_resolved.value()) { |
| 608 device_bluez->UpdateGattServices(object_path); | 612 device_bluez->UpdateGattServices(object_path); |
| 609 NotifyGattServicesDiscovered(device_bluez); | 613 NotifyGattServicesDiscovered(device_bluez); |
| 610 } | 614 } |
| 611 | 615 |
| 612 // When a device becomes paired, mark it as trusted so that the user does | 616 // When a device becomes paired, mark it as trusted so that the user does |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) { | 1698 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) { |
| 1695 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS; | 1699 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS; |
| 1696 } else if (error_name == bluetooth_adapter::kErrorNotReady) { | 1700 } else if (error_name == bluetooth_adapter::kErrorNotReady) { |
| 1697 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY; | 1701 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY; |
| 1698 } | 1702 } |
| 1699 | 1703 |
| 1700 error_callback.Run(code); | 1704 error_callback.Run(code); |
| 1701 } | 1705 } |
| 1702 | 1706 |
| 1703 } // namespace bluez | 1707 } // namespace bluez |
| OLD | NEW |