Index: device/bluetooth/bluez/bluetooth_service_record_bluez.cc |
diff --git a/device/bluetooth/bluez/bluetooth_service_record_bluez.cc b/device/bluetooth/bluez/bluetooth_service_record_bluez.cc |
index 5a3178f2616d169524f084900ccbf6120becb4ae..262e4e1c3254c2305397df6c91e110adee555ab2 100644 |
--- a/device/bluetooth/bluez/bluetooth_service_record_bluez.cc |
+++ b/device/bluetooth/bluez/bluetooth_service_record_bluez.cc |
@@ -4,13 +4,13 @@ |
#include "device/bluetooth/bluez/bluetooth_service_record_bluez.h" |
+#include <utility> |
+ |
#include "base/values.h" |
namespace bluez { |
-BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ( |
- const std::map<uint16_t, BluetoothServiceAttributeValueBlueZ>& attributes) |
- : attributes_(attributes) {} |
+BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ() {} |
BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ( |
const BluetoothServiceRecordBlueZ& record) { |
@@ -35,4 +35,14 @@ BluetoothServiceRecordBlueZ::GetAttributeValue(uint16_t attribute_id) const { |
return it->second; |
} |
+void BluetoothServiceRecordBlueZ::AddRecordEntry( |
+ uint16_t id, |
+ const BluetoothServiceAttributeValueBlueZ& value) { |
+ auto it = attributes_.find(id); |
+ if (it != attributes_.end()) |
+ attributes_.erase(it); |
+ attributes_.insert( |
+ std::pair<uint16_t, BluetoothServiceAttributeValueBlueZ>(id, value)); |
+} |
+ |
} // namespace bluez |