diff options
author | Jim Miller <jaggies@google.com> | 2013-11-13 15:40:48 -0800 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2013-11-13 15:40:48 -0800 |
commit | e5f17ab5a61a69aaa36b883a9abdeab9cba6c48e (patch) | |
tree | 487bce2abc43c0f6673a9198abd28502a03c3704 /packages/Keyguard/src/com/android | |
parent | c641de017ae0b15bbc13f43fd14fca6b1523ec02 (diff) | |
download | frameworks_base-e5f17ab5a61a69aaa36b883a9abdeab9cba6c48e.zip frameworks_base-e5f17ab5a61a69aaa36b883a9abdeab9cba6c48e.tar.gz frameworks_base-e5f17ab5a61a69aaa36b883a9abdeab9cba6c48e.tar.bz2 |
Report keyguard as initially showing and secure until we know
This fixes a bug where an app calls KeyguardManager.isLocked()
before keyguard has had a chance to show. The fix is to assume
keyguard is showing and secure until we know otherwise.
Fixes bug 11670159
Change-Id: Ifbe4cdf40e3b76d2069ecace940f85fa58f31187
Diffstat (limited to 'packages/Keyguard/src/com/android')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java index 49982ea..b65fcd8 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java @@ -200,7 +200,7 @@ public class KeyguardViewMediator { // cached value of whether we are showing (need to know this to quickly // answer whether the input should be restricted) - private boolean mShowing = false; + private boolean mShowing; // true if the keyguard is hidden by another window private boolean mHidden = false; @@ -508,6 +508,9 @@ public class KeyguardViewMediator { ? lockPatternUtils : new LockPatternUtils(mContext); mLockPatternUtils.setCurrentUser(UserHandle.USER_OWNER); + // Assume keyguard is showing (unless it's disabled) until we know for sure... + mShowing = !mLockPatternUtils.isLockScreenDisabled(); + WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); mKeyguardViewManager = new KeyguardViewManager(context, wm, mViewMediatorCallback, |