summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jovana Knezevic <jovanak@google.com> 2019-11-22 15:45:30 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-11-22 15:45:30 +0000
commitda15855d8ca22e33a88b47fee048e399518b5d42 (patch)
tree061e87c3303f7c8f862c9b1ebfa0ecc5d48d3ee1
parentdbaa2157530e8149083469b58804550eafeb1fd0 (diff)
parentff3328346db3938e08f84b62e42627dd2106149b (diff)
Merge "Keyguard should be dismissed if there is no trusted device."
-rw-r--r--packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java22
1 files changed, 5 insertions, 17 deletions
diff --git a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
index b188dc3949f2..45430197fdd8 100644
--- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
+++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
@@ -50,9 +50,6 @@ import javax.inject.Singleton;
@Singleton
public class FullscreenUserSwitcher {
private static final String TAG = FullscreenUserSwitcher.class.getSimpleName();
- // Because user 0 is headless, user count for single user is 2
- private static final int NUMBER_OF_BACKGROUND_USERS = 1;
-
private final Context mContext;
private final Resources mResources;
private final UserManager mUserManager;
@@ -137,27 +134,18 @@ public class FullscreenUserSwitcher {
/* isStartGuestSession= */ false,
/* isAddUser= */ false,
/* isForeground= */ true);
- // For single user without trusted device, hide the user switcher.
- if (!hasMultipleUsers() && !hasTrustedDevice(initialUser)) {
- dismissUserSwitcher();
- return;
- }
- // Show unlock dialog for initial user
+
+ // If the initial user has trusted device, display the unlock dialog on the keyguard.
if (hasTrustedDevice(initialUser)) {
mUnlockDialogHelper.showUnlockDialogAfterDelay(initialUser,
mOnHideListener);
+ } else {
+ // If no trusted device, dismiss the keyguard.
+ dismissUserSwitcher();
}
}
/**
- * Check if there is only one possible user to login in.
- * In a Multi-User system there is always one background user (user 0)
- */
- private boolean hasMultipleUsers() {
- return mUserManager.getUserCount() > NUMBER_OF_BACKGROUND_USERS + 1;
- }
-
- /**
* Makes user grid visible.
*/
public void show() {