Commit 08aefed6 authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[SmartLock] Do not immediately clear devices if disabled.

The CL crrev.com/c/1788552 introduced logic which immediateyl cleared
Smart Lock devices from user prefs when the feature became disabled.
Unfortunately, that change did not anticipate the face that Smart Lock
goes through an intermediate step during Chrome startup in which the
feature is marked as disabled, inadvertently removing the devices even
when the feature is enabled. This CL reverts that faulty logic.

Bug: 1022651
Change-Id: I39068f5bc92f39f4109aa34dda3f2c0f35adcfcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906324
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Auto-Submit: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714350}
parent ebd5a4de
...@@ -127,7 +127,6 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() { ...@@ -127,7 +127,6 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() {
// OnFeatureStatesChanged() will call back on this method when feature state // OnFeatureStatesChanged() will call back on this method when feature state
// changes. // changes.
PA_LOG(VERBOSE) << "Smart Lock is not enabled by user; aborting."; PA_LOG(VERBOSE) << "Smart Lock is not enabled by user; aborting.";
SetStoredRemoteDevices(base::ListValue());
SetProximityAuthDevices(GetAccountId(), multidevice::RemoteDeviceRefList(), SetProximityAuthDevices(GetAccountId(), multidevice::RemoteDeviceRefList(),
base::nullopt /* local_device */); base::nullopt /* local_device */);
return; return;
...@@ -149,7 +148,6 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() { ...@@ -149,7 +148,6 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() {
} else { } else {
PA_LOG(ERROR) << "Smart Lock is enabled by user, but no unlock key is " PA_LOG(ERROR) << "Smart Lock is enabled by user, but no unlock key is "
"present; aborting."; "present; aborting.";
SetStoredRemoteDevices(base::ListValue());
SetProximityAuthDevices(GetAccountId(), multidevice::RemoteDeviceRefList(), SetProximityAuthDevices(GetAccountId(), multidevice::RemoteDeviceRefList(),
base::nullopt /* local_device */); base::nullopt /* local_device */);
......
...@@ -416,14 +416,6 @@ TEST_F(EasyUnlockServiceRegularTest, ...@@ -416,14 +416,6 @@ TEST_F(EasyUnlockServiceRegularTest,
VerifyGetRemoteDevices(true /* are_local_and_remote_devices_expected */); VerifyGetRemoteDevices(true /* are_local_and_remote_devices_expected */);
} }
TEST_F(EasyUnlockServiceRegularTest, GetRemoteDevices_SmartLockHostRemoved) {
InitializeService(true /* should_initialize_all_dependencies */);
VerifyGetRemoteDevices(true /* are_local_and_remote_devices_expected */);
SetSyncedDevices(multidevice::RemoteDeviceRefList() /* synced_devices */);
VerifyGetRemoteDevices(false /* are_local_and_remote_devices_expected */);
}
TEST_F(EasyUnlockServiceRegularTest, GetRemoteDevices_SmartLockHostChanged) { TEST_F(EasyUnlockServiceRegularTest, GetRemoteDevices_SmartLockHostChanged) {
InitializeService(true /* should_initialize_all_dependencies */); InitializeService(true /* should_initialize_all_dependencies */);
SetScreenLockState(true /* is_locked */); SetScreenLockState(true /* is_locked */);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment