Commit 69176c66 authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[SmartLock] Begin initial scan UI before attempting connection.

When scanning begins, a yellow icon with the tooltip "cannot connect..."
briefly pops up and is then replaced again by the spinner. This CL
prevents that visual jank by making sure |is_performing_initial_scan_|
is set to true before fetching lock screen state.

Bug: 890047, 921766
Change-Id: Ib41d4744f1eddcb510497b303a8a220716123f09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716156
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680547}
parent 06a9a44f
......@@ -164,8 +164,8 @@ void UnlockManagerImpl::SetRemoteDeviceLifeCycle(
attempt_secure_connection_start_time_ =
base::DefaultClock::GetInstance()->Now();
AttemptToStartRemoteDeviceLifecycle();
SetIsPerformingInitialScan(true /* is_performing_initial_scan */);
AttemptToStartRemoteDeviceLifecycle();
} else {
ResetPerformanceMetricsTimestamps();
......
......@@ -557,9 +557,12 @@ TEST_F(ProximityAuthUnlockManagerImplTest,
FindingConnection_UpdatesScreenlockState) {
CreateUnlockManager(ProximityAuthSystem::SESSION_LOCK);
// TODO(crbug.com/890047): Remove this once the bug is resolved.
// Regression test for https://crbug.com/890047, ensuring that the NO_PHONE
// status doesn't incorrectly appear for a brief moment before the
// BLUETOOTH_CONNECTING spinner.
EXPECT_CALL(proximity_auth_client_,
UpdateScreenlockState(ScreenlockState::NO_PHONE));
UpdateScreenlockState(ScreenlockState::NO_PHONE))
.Times(0);
EXPECT_CALL(proximity_auth_client_,
UpdateScreenlockState(ScreenlockState::BLUETOOTH_CONNECTING));
......@@ -571,9 +574,12 @@ TEST_F(ProximityAuthUnlockManagerImplTest,
Authenticating_UpdatesScreenlockState) {
CreateUnlockManager(ProximityAuthSystem::SESSION_LOCK);
// TODO(crbug.com/890047): Remove this once the bug is resolved.
// Regression test for https://crbug.com/890047, ensuring that the NO_PHONE
// status doesn't incorrectly appear for a brief moment before the
// BLUETOOTH_CONNECTING spinner.
EXPECT_CALL(proximity_auth_client_,
UpdateScreenlockState(ScreenlockState::NO_PHONE));
UpdateScreenlockState(ScreenlockState::NO_PHONE))
.Times(0);
EXPECT_CALL(proximity_auth_client_,
UpdateScreenlockState(ScreenlockState::BLUETOOTH_CONNECTING));
......
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