| Index: components/proximity_auth/proximity_auth_system.cc
|
| diff --git a/components/proximity_auth/proximity_auth_system.cc b/components/proximity_auth/proximity_auth_system.cc
|
| index 2a30b472e9263a2b95d27c400bd977e798ae240b..c95eae138a2e98ad0e6706fbd1b47e26707b7f0e 100644
|
| --- a/components/proximity_auth/proximity_auth_system.cc
|
| +++ b/components/proximity_auth/proximity_auth_system.cc
|
| @@ -44,12 +44,13 @@ ProximityAuthSystem::~ProximityAuthSystem() {
|
|
|
| void ProximityAuthSystem::Start() {
|
| ScreenlockBridge::Get()->AddObserver(this);
|
| - if (remote_device_.user_id == ScreenlockBridge::Get()->focused_user_id())
|
| - OnFocusedUserChanged(ScreenlockBridge::Get()->focused_user_id());
|
| + if (remote_device_.user_id ==
|
| + ScreenlockBridge::Get()->focused_account_id().GetUserEmail())
|
| + OnFocusedUserChanged(ScreenlockBridge::Get()->focused_account_id());
|
| }
|
|
|
| -void ProximityAuthSystem::OnAuthAttempted(const std::string& user_id) {
|
| - // TODO(tengs): There is no reason to pass the |user_id| argument anymore.
|
| +void ProximityAuthSystem::OnAuthAttempted(const AccountId& /* account_id */) {
|
| + // TODO(tengs): There is no reason to pass the |account_id| argument anymore.
|
| unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK);
|
| }
|
|
|
| @@ -82,7 +83,7 @@ void ProximityAuthSystem::ResumeAfterWakeUpTimeout() {
|
| PA_LOG(INFO) << "Resume after suspend";
|
| suspended_ = false;
|
| if (ScreenlockBridge::Get()->IsLocked())
|
| - OnFocusedUserChanged(ScreenlockBridge::Get()->focused_user_id());
|
| + OnFocusedUserChanged(ScreenlockBridge::Get()->focused_account_id());
|
| }
|
|
|
| void ProximityAuthSystem::OnLifeCycleStateChanged(
|
| @@ -93,7 +94,7 @@ void ProximityAuthSystem::OnLifeCycleStateChanged(
|
|
|
| void ProximityAuthSystem::OnScreenDidLock(
|
| ScreenlockBridge::LockHandler::ScreenType screen_type) {
|
| - OnFocusedUserChanged(ScreenlockBridge::Get()->focused_user_id());
|
| + OnFocusedUserChanged(ScreenlockBridge::Get()->focused_account_id());
|
| }
|
|
|
| void ProximityAuthSystem::OnScreenDidUnlock(
|
| @@ -102,8 +103,9 @@ void ProximityAuthSystem::OnScreenDidUnlock(
|
| remote_device_life_cycle_.reset();
|
| }
|
|
|
| -void ProximityAuthSystem::OnFocusedUserChanged(const std::string& user_id) {
|
| - if (!user_id.empty() && remote_device_.user_id != user_id) {
|
| +void ProximityAuthSystem::OnFocusedUserChanged(const AccountId& account_id) {
|
| + if (account_id.is_valid() &&
|
| + remote_device_.user_id != account_id.GetUserEmail()) {
|
| PA_LOG(INFO) << "Different user focused, destroying RemoteDeviceLifeCycle.";
|
| unlock_manager_->SetRemoteDeviceLifeCycle(nullptr);
|
| remote_device_life_cycle_.reset();
|
|
|