summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2014-09-03 00:08:56 +0200
committerAdrian Roos <roosa@google.com>2014-09-03 16:46:55 +0200
commitbe47b07bef0596dd9bf7137ea08cc1112328c6e8 (patch)
tree40c259434e5c9ef088125c5b706cc7aeb5c4b065 /packages/SystemUI/src/com/android
parent9dc3209913cf3bcb6b46b6481321a054667be9a3 (diff)
downloadframeworks_base-be47b07bef0596dd9bf7137ea08cc1112328c6e8.zip
frameworks_base-be47b07bef0596dd9bf7137ea08cc1112328c6e8.tar.gz
frameworks_base-be47b07bef0596dd9bf7137ea08cc1112328c6e8.tar.bz2
Auto dismiss lockscreen when switching to guest
Bug: 16659674 Change-Id: I8d24a3997ac7493cd8a8317f8a35532eaf5c3cfe
Diffstat (limited to 'packages/SystemUI/src/com/android')
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index f4d0669..8180265 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -27,6 +27,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.pm.UserInfo;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Bundle;
@@ -302,6 +303,13 @@ public class KeyguardViewMediator extends SystemUI {
@Override
public void onUserSwitchComplete(int userId) {
mSwitchingUser = false;
+ if (userId != UserHandle.USER_OWNER) {
+ UserInfo info = UserManager.get(mContext).getUserInfo(userId);
+ if (info != null && info.isGuest()) {
+ // If we just switched to a guest, try to dismiss keyguard.
+ dismiss();
+ }
+ }
}
@Override