Merge "Keyguard should be dismissed if there is no trusted device." into qt-qpr1-dev
am: d7353d5c33
Change-Id: I37a5f7edc56db4ac33a9ad8a1ea43354c2abd655
This commit is contained in:
@@ -45,8 +45,6 @@ import com.android.systemui.statusbar.car.UserGridRecyclerView.UserRecord;
|
||||
*/
|
||||
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 UserGridRecyclerView mUserGridView;
|
||||
private final View mParent;
|
||||
private final int mShortAnimDuration;
|
||||
@@ -118,26 +116,17 @@ 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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user