Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: device/bluetooth/bluetooth_device.cc

Issue 2377513004: bluetooth:android: Return the advertised name if advertising (Closed)
Patch Set: Format' Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index d4e072bbc4b4b3a404de2931ea3d6bff6b4e2d18..285bf3ab8b8bcab19770bb91c923138ae7e70909 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -417,14 +417,22 @@ std::string BluetoothDevice::CanonicalizeAddress(const std::string& address) {
std::string BluetoothDevice::GetIdentifier() const { return GetAddress(); }
-void BluetoothDevice::UpdateAdvertisementData(int8_t rssi,
- UUIDList advertised_uuids,
- ServiceDataMap service_data,
- const int8_t* tx_power) {
+void BluetoothDevice::UpdateAdvertisementData(
+ int8_t rssi,
+ const std::string* advertised_name,
+ UUIDList advertised_uuids,
+ ServiceDataMap service_data,
+ const int8_t* tx_power) {
UpdateTimestamp();
inquiry_rssi_ = rssi;
+ if (advertised_name != nullptr) {
+ advertised_name_ = *advertised_name;
+ } else {
+ advertised_name_ = base::nullopt;
+ }
+
device_uuids_.ReplaceAdvertisedUUIDs(std::move(advertised_uuids));
service_data_ = std::move(service_data);
@@ -437,6 +445,7 @@ void BluetoothDevice::UpdateAdvertisementData(int8_t rssi,
void BluetoothDevice::ClearAdvertisementData() {
inquiry_rssi_ = base::nullopt;
+ advertised_name_ = base::nullopt;
device_uuids_.ClearAdvertisedUUIDs();
service_data_.clear();
inquiry_tx_power_ = base::nullopt;
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698