diff --git a/internal/platform/implementation/g3/bluetooth_adapter.cc b/internal/platform/implementation/g3/bluetooth_adapter.cc index 5ff388f3..e030a292 100644 --- a/internal/platform/implementation/g3/bluetooth_adapter.cc +++ b/internal/platform/implementation/g3/bluetooth_adapter.cc @@ -139,7 +139,7 @@ bool BluetoothAdapter::SetName(absl::string_view name, bool enabled; { absl::MutexLock lock(&mutex_); - name_ = name; + name_ = std::string(name); enabled = enabled_; mode = mode_; } diff --git a/presence/implementation/advertisement_decoder.cc b/presence/implementation/advertisement_decoder.cc index b4ade393..91f41125 100644 --- a/presence/implementation/advertisement_decoder.cc +++ b/presence/implementation/advertisement_decoder.cc @@ -111,7 +111,7 @@ AdvertisementDecoder::DecodeAdvertisement(absl::string_view advertisement) { return elem.status(); } if (elem->GetType() == DataElement::kSaltFieldType) { - salt = elem->GetValue(); + salt = std::string(elem->GetValue()); } bool need_decryption = IsIdentity(elem->GetType()) && !elem->GetValue().empty(); diff --git a/presence/implementation/base_broadcast_request.cc b/presence/implementation/base_broadcast_request.cc index 1777f567..e0aa0a1d 100644 --- a/presence/implementation/base_broadcast_request.cc +++ b/presence/implementation/base_broadcast_request.cc @@ -14,6 +14,8 @@ #include "presence/implementation/base_broadcast_request.h" +#include + #include "absl/strings/string_view.h" #include "internal/platform/logging.h" #include "presence/implementation/encryption.h" @@ -27,7 +29,7 @@ BasePresenceRequestBuilder& BasePresenceRequestBuilder::SetSalt( if (salt.size() != kSaltSize) { NEARBY_LOG(WARNING, "Unsupported salt length: %d", salt.size()); } else { - salt_ = salt; + salt_ = std::string(salt); } return *this; } diff --git a/presence/scan_request.h b/presence/scan_request.h index 7cffedb7..257221b0 100644 --- a/presence/scan_request.h +++ b/presence/scan_request.h @@ -18,14 +18,11 @@ #include #include -#include "net/proto2/util/public/message_differencer.h" #include "absl/types/variant.h" #include "internal/proto/credential.pb.h" #include "presence/data_element.h" #include "presence/power_mode.h" -using MD = proto2::util::MessageDifferencer; - namespace nearby { namespace presence { @@ -94,8 +91,8 @@ inline bool operator==(const LegacyPresenceScanFilter& a, a.extended_properties != b.extended_properties) return false; for (int i = 0; i < a.remote_public_credentials.size(); ++i) { - if (!MD::Equivalent(a.remote_public_credentials[i], - b.remote_public_credentials[i])) + if (a.remote_public_credentials[i].SerializeAsString() != + b.remote_public_credentials[i].SerializeAsString()) return false; } return true; diff --git a/presence/scan_request_builder.cc b/presence/scan_request_builder.cc index 23d21c5a..4f8f838a 100644 --- a/presence/scan_request_builder.cc +++ b/presence/scan_request_builder.cc @@ -13,8 +13,10 @@ // limitations under the License. #include "presence/scan_request_builder.h" +#include #include +#include "absl/strings/string_view.h" #include "absl/types/variant.h" #include "presence/scan_request.h" @@ -25,7 +27,7 @@ using ::nearby::internal::IdentityType; ScanRequestBuilder& ScanRequestBuilder::SetAccountName( absl::string_view account_name) { - request_.account_name = account_name; + request_.account_name = std::string(account_name); return *this; }