From f01ea6c6663ad57f1a2633c3581ea89c53d824da Mon Sep 17 00:00:00 2001 From: jovanak Date: Tue, 7 Aug 2018 18:28:58 -0700 Subject: Gets rid of the conditional keyguard dismissal in full screen user switcher. This logic existed to differentiate between boot and switch, at the time when we wanted to show the switcher on user boot. That's not the case any more, so the logic has become obsolete. This also resolve the issue with keyguard not being dimissed in the bug below. Bug: 112142114 Test: multiple boot/switches on mojave Change-Id: I82b55bd3d00e5ab7249347d19d804b8945c3c9fc --- .../statusbar/car/FullscreenUserSwitcher.java | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java index af0ed284847d..506d69719e82 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java @@ -40,7 +40,6 @@ public class FullscreenUserSwitcher { private final int mShortAnimDuration; private final StatusBar mStatusBar; private final UserManagerHelper mUserManagerHelper; - private int mCurrentForegroundUserId; private boolean mShowing; public FullscreenUserSwitcher(StatusBar statusBar, ViewStub containerStub, Context context) { @@ -55,7 +54,6 @@ public class FullscreenUserSwitcher { mUserGridView.setUserSelectionListener(this::onUserSelected); mUserManagerHelper = new UserManagerHelper(context); - updateCurrentForegroundUser(); mShortAnimDuration = mContainer.getResources() .getInteger(android.R.integer.config_shortAnimTime); @@ -78,22 +76,8 @@ public class FullscreenUserSwitcher { } public void onUserSwitched(int newUserId) { - // The logic for foreground user change is needed here to exclude the reboot case. On - // reboot, system fires ACTION_USER_SWITCHED change from -1 to 0 user. This is not an actual - // user switch. We only want to trigger keyguard dismissal when foreground user changes. - if (foregroundUserChanged()) { - toggleSwitchInProgress(false); - updateCurrentForegroundUser(); - mParent.post(this::dismissKeyguard); - } - } - - private boolean foregroundUserChanged() { - return mCurrentForegroundUserId != mUserManagerHelper.getForegroundUserId(); - } - - private void updateCurrentForegroundUser() { - mCurrentForegroundUserId = mUserManagerHelper.getForegroundUserId(); + toggleSwitchInProgress(false); + mParent.post(this::dismissKeyguard); } private void onUserSelected(UserGridRecyclerView.UserRecord record) { -- cgit v1.2.3-59-g8ed1b