summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/keyguard
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2014-09-17 16:22:19 -0400
committerJason Monk <jmonk@google.com>2014-09-18 11:02:19 -0400
commitcf5a9530f7ded49e830a064526f4290f3a81062c (patch)
treea7bf5951a8f8c6bb40381c55ccb80407ee3757af /packages/SystemUI/src/com/android/systemui/keyguard
parent2911b2046a7a398791623f835686f8eda60b5a78 (diff)
downloadframeworks_base-cf5a9530f7ded49e830a064526f4290f3a81062c.zip
frameworks_base-cf5a9530f7ded49e830a064526f4290f3a81062c.tar.gz
frameworks_base-cf5a9530f7ded49e830a064526f4290f3a81062c.tar.bz2
Fix crash from USER_PRESENT broadcast in sysui
Since sending the USER_PRESENT broadcast too early in the boot process can result in a SecurityException, don't do auto-unlock until after the boot has completed. Bug: 17464800 Change-Id: Iee3d0b9723ed38abddf0bdde009f95331881008b
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 50ba68e..2628b3e 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -170,6 +170,8 @@ public class KeyguardViewMediator extends SystemUI {
private boolean mSwitchingUser;
private boolean mSystemReady;
+ private boolean mBootCompleted;
+ private boolean mBootSendUserPresent;
// Whether the next call to playSounds() should be skipped. Defaults to
// true because the first lock (on boot) should be silent.
@@ -1146,8 +1148,14 @@ public class KeyguardViewMediator extends SystemUI {
}
private void sendUserPresentBroadcast() {
- final UserHandle currentUser = new UserHandle(mLockPatternUtils.getCurrentUser());
- mContext.sendBroadcastAsUser(USER_PRESENT_INTENT, currentUser);
+ synchronized (this) {
+ if (mBootCompleted) {
+ final UserHandle currentUser = new UserHandle(mLockPatternUtils.getCurrentUser());
+ mContext.sendBroadcastAsUser(USER_PRESENT_INTENT, currentUser);
+ } else {
+ mBootSendUserPresent = true;
+ }
+ }
}
/**
@@ -1407,6 +1415,12 @@ public class KeyguardViewMediator extends SystemUI {
public void onBootCompleted() {
mUpdateMonitor.dispatchBootCompleted();
+ synchronized (this) {
+ mBootCompleted = true;
+ if (mBootSendUserPresent) {
+ sendUserPresentBroadcast();
+ }
+ }
}
public StatusBarKeyguardViewManager registerStatusBar(PhoneStatusBar phoneStatusBar,