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

Unified Diff: components/proximity_auth/bluetooth_low_energy_connection_finder.cc

Issue 2847233003: [EasyUnlock] Move DataWithTimestamp out of ForegroundEidGenerator so it can be shared. (Closed)
Patch Set: fixes Created 3 years, 8 months 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
Index: components/proximity_auth/bluetooth_low_energy_connection_finder.cc
diff --git a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
index 8069b2dbda25695afffaf149eba63a24b3d4c1ae..6029eb46191886a5c15511a35fda5f7ce66cbe91 100644
--- a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
+++ b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
@@ -15,9 +15,11 @@
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "components/cryptauth/background_eid_generator.h"
#include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h"
#include "components/cryptauth/bluetooth_throttler.h"
#include "components/cryptauth/connection.h"
+#include "components/cryptauth/raw_eid_generator.h"
#include "components/proximity_auth/logging/logging.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_common.h"
@@ -167,11 +169,11 @@ bool BluetoothLowEnergyConnectionFinder::IsRightDevice(
return false;
std::string service_data_string(service_data->begin(), service_data->end());
- std::vector<std::string> nearest_eids =
+ std::vector<cryptauth::DataWithTimestamp> nearest_eids =
eid_generator_->GenerateNearestEids(beacon_seeds_);
- for (const std::string& eid : nearest_eids) {
- if (eid == service_data_string) {
- PA_LOG(INFO) << "Found a matching EID: " << eid;
+ for (const cryptauth::DataWithTimestamp& eid : nearest_eids) {
+ if (eid.data == service_data_string) {
+ PA_LOG(INFO) << "Found a matching EID: " << eid.DataInHex();
return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698