Commit 550642a7 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

login: Revert account switching on focus in lock screen.

In https://codereview.chromium.org/2035753003, we started switching the
user account as soon as the user focused on a user pod in the lock
screen. This was to update parts of the "shelf user icon" based on
the focused user pod.

However, this has unintended consequences. When the screen is locked,
the system is in a special "locked" state. Switching the active user
assumes we're in interactive user session state, so it breaks this
assumption system wide.

One unintended consequence is on IMEs: The lock screen code assumes
that active user can only change after auth success, and uses this
assumption for managing the user's IME state.

This causes the IME state to be incorrectly restored in some cases,
which breaks keyboard typing for some users, breaks the virtual
keyboard, and shows an incorrect list of IMEs in the shelf.

We revert this change as it may have consequences for not just IMEs.
We need to implement this feature in a different way (without
switching the active user).

Bug: 911699, 942392, 980792, b:143235444, b:143906227, 614926
Change-Id: I0691256ecad20c683003004d99469692b4e4ac8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904558
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713697}
parent e0688713
......@@ -227,25 +227,18 @@ void ViewsScreenLocker::HandleOnFocusPod(const AccountId& account_id) {
focused_pod_account_id_ = base::Optional<AccountId>(account_id);
const user_manager::User* user =
user_manager::UserManager::Get()->FindUser(account_id);
// |user| may be null in kiosk mode or unit tests.
if (user && user->is_logged_in() && !user->is_active()) {
SessionControllerClientImpl::DoSwitchActiveUser(account_id);
} else {
lock_screen_utils::SetUserInputMethod(account_id.GetUserEmail(),
ime_state_.get());
lock_screen_utils::SetKeyboardSettings(account_id);
WallpaperControllerClient::Get()->ShowUserWallpaper(account_id);
bool use_24hour_clock = false;
if (user_manager::known_user::GetBooleanPref(
account_id, prefs::kUse24HourClock, &use_24hour_clock)) {
g_browser_process->platform_part()
->GetSystemClock()
->SetLastFocusedPodHourClockType(
use_24hour_clock ? base::k24HourClock : base::k12HourClock);
}
lock_screen_utils::SetUserInputMethod(account_id.GetUserEmail(),
ime_state_.get());
lock_screen_utils::SetKeyboardSettings(account_id);
WallpaperControllerClient::Get()->ShowUserWallpaper(account_id);
bool use_24hour_clock = false;
if (user_manager::known_user::GetBooleanPref(
account_id, prefs::kUse24HourClock, &use_24hour_clock)) {
g_browser_process->platform_part()
->GetSystemClock()
->SetLastFocusedPodHourClockType(use_24hour_clock ? base::k24HourClock
: base::k12HourClock);
}
}
......
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