summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-12-12 22:23:16 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-12-12 22:23:16 +0000
commit4a03ca6ad1adec1a75a43de1b2f3779746c33d77 (patch)
tree90b157913c2550c0b420e5c4e1382a54ec1ffc5f
parent4274934c016705176018140d984f21f2280801dc (diff)
parent65664b2909e9bd85bcf2978c4205f4c32e9e5b3b (diff)
Merge "Check screenlock for unlock dialog" into qt-qpr1-dev
-rw-r--r--packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java13
1 files changed, 10 insertions, 3 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 f74dbe925349..92834e8cd085 100644
--- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
+++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
@@ -34,6 +34,7 @@ import android.view.ViewStub;
import androidx.recyclerview.widget.GridLayoutManager;
+import com.android.internal.widget.LockPatternUtils;
import com.android.systemui.CarSystemUIFactory;
import com.android.systemui.R;
import com.android.systemui.SystemUIFactory;
@@ -117,8 +118,9 @@ public class FullscreenUserSwitcher {
/* isAddUser= */ false,
/* isForeground= */ true);
- // If the initial user has trusted device, display the unlock dialog on the keyguard.
- if (hasTrustedDevice(initialUser)) {
+ // If the initial user has screen lock and trusted device, display the unlock dialog on the
+ // keyguard.
+ if (hasScreenLock(initialUser) && hasTrustedDevice(initialUser)) {
mUnlockDialogHelper.showUnlockDialogAfterDelay(initialUser,
mOnHideListener);
} else {
@@ -160,7 +162,7 @@ public class FullscreenUserSwitcher {
*/
private void onUserSelected(UserGridRecyclerView.UserRecord record) {
mSelectedUser = record;
- if (hasTrustedDevice(record.mInfo.id)) {
+ if (hasScreenLock(record.mInfo.id) && hasTrustedDevice(record.mInfo.id)) {
mUnlockDialogHelper.showUnlockDialog(record.mInfo.id, mOnHideListener);
return;
}
@@ -198,6 +200,11 @@ public class FullscreenUserSwitcher {
}
+ private boolean hasScreenLock(int uid) {
+ LockPatternUtils lockPatternUtils = new LockPatternUtils(mContext);
+ return lockPatternUtils.isSecure(uid);
+ }
+
private boolean hasTrustedDevice(int uid) {
if (mEnrollmentManager == null) { // car service not ready, so it cannot be available.
return false;