Commit efe4158e authored by xiyuan's avatar xiyuan Committed by Commit bot

easy-unlock: Do not show icon for online auth type.

BUG=433912

Review URL: https://codereview.chromium.org/749563002

Cr-Commit-Position: refs/heads/master@{#305106}
parent bebcbc64
......@@ -119,6 +119,12 @@ void EasyUnlockScreenlockStateHandler::ChangeState(State new_state) {
if (!screenlock_bridge_->IsLocked())
return;
// Do nothing when auth type is online.
if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) ==
ScreenlockBridge::LockHandler::ONLINE_SIGN_IN) {
return;
}
// No hardlock UI for trial run.
if (!is_trial_run_ && hardlock_state_ != NO_HARDLOCK) {
ShowHardlockUI();
......@@ -313,8 +319,7 @@ void EasyUnlockScreenlockStateHandler::UpdateScreenlockAuthType() {
// Do not override online signin.
const ScreenlockBridge::LockHandler::AuthType existing_auth_type =
screenlock_bridge_->lock_handler()->GetAuthType(user_email_);
if (existing_auth_type == ScreenlockBridge::LockHandler::ONLINE_SIGN_IN)
return;
DCHECK_NE(ScreenlockBridge::LockHandler::ONLINE_SIGN_IN, existing_auth_type);
if (state_ == STATE_AUTHENTICATED) {
if (existing_auth_type != ScreenlockBridge::LockHandler::USER_CLICK) {
......
......@@ -768,6 +768,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, NoOverrideOnlineSignin) {
state_handler_->ChangeState(states[i]);
EXPECT_EQ(ScreenlockBridge::LockHandler::ONLINE_SIGN_IN,
lock_handler_->GetAuthType(user_email_));
EXPECT_FALSE(lock_handler_->HasCustomIcon());
}
std::vector<EasyUnlockScreenlockStateHandler::HardlockState> hardlock_states;
......@@ -782,6 +783,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, NoOverrideOnlineSignin) {
state_handler_->SetHardlockState(hardlock_states[i]);
EXPECT_EQ(ScreenlockBridge::LockHandler::ONLINE_SIGN_IN,
lock_handler_->GetAuthType(user_email_));
EXPECT_FALSE(lock_handler_->HasCustomIcon());
}
}
......
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