Commit 29133557 authored by shuchen's avatar shuchen Committed by Commit bot

Make SetState be called later when screen is unlocking.

The bug's root cause is SetState is called too early when screen is
unlocking and IMF thinks the current UI session is still LOCK screen so
it won't persist the active input method.

BUG=409500
TEST=Verified on Pixel.

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

Cr-Commit-Position: refs/heads/master@{#292891}
parent 46343cfc
...@@ -205,17 +205,14 @@ void ScreenLocker::OnAuthSuccess(const UserContext& user_context) { ...@@ -205,17 +205,14 @@ void ScreenLocker::OnAuthSuccess(const UserContext& user_context) {
const user_manager::User* user = const user_manager::User* user =
user_manager::UserManager::Get()->FindUser(user_context.GetUserID()); user_manager::UserManager::Get()->FindUser(user_context.GetUserID());
if (user) { if (user) {
if (user->is_active()) { if (!user->is_active()) {
DCHECK(saved_ime_state_); saved_ime_state_ = NULL;
input_method::InputMethodManager::Get()->SetState(saved_ime_state_);
} else {
user_manager::UserManager::Get()->SwitchActiveUser( user_manager::UserManager::Get()->SwitchActiveUser(
user_context.GetUserID()); user_context.GetUserID());
} }
} else { } else {
NOTREACHED() << "Logged in user not found."; NOTREACHED() << "Logged in user not found.";
} }
saved_ime_state_ = NULL;
authentication_capture_.reset(new AuthenticationParametersCapture()); authentication_capture_.reset(new AuthenticationParametersCapture());
authentication_capture_->user_context = user_context; authentication_capture_->user_context = user_context;
...@@ -463,6 +460,10 @@ ScreenLocker::~ScreenLocker() { ...@@ -463,6 +460,10 @@ ScreenLocker::~ScreenLocker() {
VLOG(1) << "Calling session manager's HandleLockScreenDismissed D-Bus method"; VLOG(1) << "Calling session manager's HandleLockScreenDismissed D-Bus method";
DBusThreadManager::Get()->GetSessionManagerClient()-> DBusThreadManager::Get()->GetSessionManagerClient()->
NotifyLockScreenDismissed(); NotifyLockScreenDismissed();
if (saved_ime_state_) {
input_method::InputMethodManager::Get()->SetState(saved_ime_state_);
}
} }
void ScreenLocker::SetAuthenticator(Authenticator* authenticator) { void ScreenLocker::SetAuthenticator(Authenticator* authenticator) {
......
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