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 d7d5508c09ed42754222837ce1a8f9776a431551..a9d2538b0eda6321cd2ac804bbf49dd8733adcff 100644 |
--- a/components/proximity_auth/remote_device_life_cycle_impl.cc |
+++ b/components/proximity_auth/remote_device_life_cycle_impl.cc |
@@ -43,7 +43,6 @@ |
: remote_device_(remote_device), |
proximity_auth_client_(proximity_auth_client), |
state_(RemoteDeviceLifeCycle::State::STOPPED), |
- observers_(base::ObserverList<Observer>::NOTIFY_EXISTING_ONLY), |
bluetooth_throttler_(new BluetoothThrottlerImpl( |
make_scoped_ptr(new base::DefaultTickClock()))), |
weak_ptr_factory_(this) {} |
@@ -74,7 +73,9 @@ |
scoped_ptr<ConnectionFinder> |
RemoteDeviceLifeCycleImpl::CreateConnectionFinder() { |
- if (remote_device_.bluetooth_type == RemoteDevice::BLUETOOTH_LE) { |
+ // TODO(tengs): We should not rely on the assumption that an empty Bluetooth |
+ // address means that the device is BLE. |
+ if (remote_device_.bluetooth_address.empty()) { |
return make_scoped_ptr(new BluetoothLowEnergyConnectionFinder( |
remote_device_, kBLESmartLockServiceUUID, |
BluetoothLowEnergyConnectionFinder::FinderStrategy::FIND_PAIRED_DEVICE, |
@@ -125,7 +126,6 @@ |
Authenticator::Result result, |
scoped_ptr<SecureContext> secure_context) { |
DCHECK(state_ == RemoteDeviceLifeCycle::State::AUTHENTICATING); |
- authenticator_.reset(); |
if (result != Authenticator::Result::SUCCESS) { |
PA_LOG(WARNING) << "Waiting " << kAuthenticationRecoveryTimeSeconds |
<< " seconds to retry after authentication failure."; |
@@ -139,8 +139,9 @@ |
} |
// Create the MessengerImpl asynchronously. |messenger_| registers itself as |
- // an observer of |connection_|, so creating it synchronously would trigger |
- // |OnSendCompleted()| as an observer call for |messenger_|. |
+ // an |
+ // observer of |connection_|, so creating it synchronously would |
+ // trigger |OnSendComplete()| as an observer call for |messenger_|. |
secure_context_ = secure_context.Pass(); |
base::ThreadTaskRunnerHandle::Get()->PostTask( |
FROM_HERE, base::Bind(&RemoteDeviceLifeCycleImpl::CreateMessenger, |
@@ -159,7 +160,6 @@ |
void RemoteDeviceLifeCycleImpl::OnDisconnected() { |
DCHECK(state_ == RemoteDeviceLifeCycle::State::SECURE_CHANNEL_ESTABLISHED); |
- messenger_.reset(); |
FindConnection(); |
} |