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

Unified Diff: components/proximity_auth/remote_device_life_cycle_impl.cc

Issue 2841743003: [EasyUnlock] Update BluetoothLowEnergyConnectionFinder to look for EIDs. (Closed)
Patch Set: [EasyUnlock] Update BluetoothLowEnergyConnectionFinder to look for EIDs. 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/remote_device_life_cycle_impl.cc
diff --git a/components/proximity_auth/remote_device_life_cycle_impl.cc b/components/proximity_auth/remote_device_life_cycle_impl.cc
index f6b5a78d913936ff7113efd05ec54dd2114ecc61..a5ed451bd6d009518ea5b30abc83e37c2cd45180 100644
--- a/components/proximity_auth/remote_device_life_cycle_impl.cc
+++ b/components/proximity_auth/remote_device_life_cycle_impl.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -16,13 +17,13 @@
#include "components/cryptauth/device_to_device_authenticator.h"
#include "components/cryptauth/secure_context.h"
#include "components/cryptauth/secure_message_delegate.h"
-#include "components/proximity_auth/ble/bluetooth_low_energy_connection.h"
-#include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h"
#include "components/proximity_auth/bluetooth_connection.h"
#include "components/proximity_auth/bluetooth_connection_finder.h"
+#include "components/proximity_auth/bluetooth_low_energy_connection_finder.h"
#include "components/proximity_auth/logging/logging.h"
#include "components/proximity_auth/messenger_impl.h"
#include "components/proximity_auth/proximity_auth_client.h"
+#include "components/proximity_auth/switches.h"
namespace proximity_auth {
@@ -32,9 +33,6 @@ namespace {
const char kClassicBluetoothServiceUUID[] =
"704EE561-3782-405A-A14B-2D47A2DDCDDF";
-// The UUID of the Bluetooth Low Energy service.
-const char kBLESmartLockServiceUUID[] = "b3b7e28e-a000-3e17-bd86-6e97b9e28c11";
-
// The time to wait, in seconds, after authentication fails, before retrying
// another connection.
const int kAuthenticationRecoveryTimeSeconds = 10;
@@ -82,11 +80,13 @@ void RemoteDeviceLifeCycleImpl::RemoveObserver(Observer* observer) {
std::unique_ptr<cryptauth::ConnectionFinder>
RemoteDeviceLifeCycleImpl::CreateConnectionFinder() {
- if (remote_device_.bluetooth_address.empty()) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)) {
return base::MakeUnique<BluetoothLowEnergyConnectionFinder>(
- remote_device_, kBLESmartLockServiceUUID,
- BluetoothLowEnergyConnectionFinder::FinderStrategy::FIND_PAIRED_DEVICE,
- nullptr, bluetooth_throttler_, 3);
+ remote_device_,
+ base::MakeUnique<cryptauth::RemoteBeaconSeedFetcher>(
+ proximity_auth_client_->GetCryptAuthDeviceManager()),
+ bluetooth_throttler_);
} else {
return base::MakeUnique<BluetoothConnectionFinder>(
remote_device_, device::BluetoothUUID(kClassicBluetoothServiceUUID),

Powered by Google App Engine
This is Rietveld 408576698