diff options
author | Jason Monk <jmonk@google.com> | 2014-09-18 16:12:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-18 16:12:06 +0000 |
commit | 2bc75f0821a509e22b23f6718cb5f0543bc4ad4d (patch) | |
tree | ae0c848b477799d5a8ed6a5f50088e819dd54afb /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | 72cc3702d252db7440c1d1fa63e7d81c8d0e8ffd (diff) | |
parent | cf5a9530f7ded49e830a064526f4290f3a81062c (diff) | |
download | frameworks_base-2bc75f0821a509e22b23f6718cb5f0543bc4ad4d.zip frameworks_base-2bc75f0821a509e22b23f6718cb5f0543bc4ad4d.tar.gz frameworks_base-2bc75f0821a509e22b23f6718cb5f0543bc4ad4d.tar.bz2 |
Merge "Fix crash from USER_PRESENT broadcast in sysui" into lmp-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 18 |
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 9af893d..4af8499 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. @@ -1145,8 +1147,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; + } + } } /** @@ -1406,6 +1414,12 @@ public class KeyguardViewMediator extends SystemUI { public void onBootCompleted() { mUpdateMonitor.dispatchBootCompleted(); + synchronized (this) { + mBootCompleted = true; + if (mBootSendUserPresent) { + sendUserPresentBroadcast(); + } + } } public StatusBarKeyguardViewManager registerStatusBar(PhoneStatusBar phoneStatusBar, |