diff options
author | Jim Miller <jaggies@google.com> | 2014-10-31 17:27:13 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2014-10-31 18:06:40 -0700 |
commit | b256e4e209afd33bff360ec2652b6ca508df74de (patch) | |
tree | 41e872650446d1452b29a9ee9e78f24bdbe07431 /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | bd6fabe2ae535cf5d31fc7a1952e43ad6e653e2e (diff) | |
download | frameworks_base-b256e4e209afd33bff360ec2652b6ca508df74de.zip frameworks_base-b256e4e209afd33bff360ec2652b6ca508df74de.tar.gz frameworks_base-b256e4e209afd33bff360ec2652b6ca508df74de.tar.bz2 |
Fix SetupWizard black screen issue for EDU devices
This fixes a problem where EDU devices show a black screen if
the device is rebooted after setting a pin/pattern/password but
before completing SetupWizard.
The issue is that the system doesn't expect to see a state
where the device is not provisioned but has a pin/pattern/password
because it wasn't possible before. With the addition of the ability
for EDU devices to add a pin/pattern/password, we can now get
into this unforseen state.
The fix ignores provisioning if a password is set so that the
user can reach the security screen to unlock the device and
continue with SetupWizard.
Fixes bug 18022051
Change-Id: Ie88a75530d964c02458c25866f0629877214edf4
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 4af8499..172aaf6 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -364,7 +364,7 @@ public class KeyguardViewMediator extends SystemUI { // only force lock screen in case of missing sim if user hasn't // gone through setup wizard synchronized (this) { - if (!mUpdateMonitor.isDeviceProvisioned()) { + if (shouldWaitForProvisioning()) { if (!isShowing()) { if (DEBUG) Log.d(TAG, "ICC_ABSENT isn't showing," + " we need to show the keyguard since the " @@ -493,8 +493,7 @@ public class KeyguardViewMediator extends SystemUI { mLockPatternUtils.setCurrentUser(ActivityManager.getCurrentUser()); // Assume keyguard is showing (unless it's disabled) until we know for sure... - mShowing = (mUpdateMonitor.isDeviceProvisioned() || mLockPatternUtils.isSecure()) - && !mLockPatternUtils.isLockScreenDisabled(); + mShowing = !shouldWaitForProvisioning() && !mLockPatternUtils.isLockScreenDisabled(); mStatusBarKeyguardViewManager = new StatusBarKeyguardViewManager(mContext, mViewMediatorCallback, mLockPatternUtils); @@ -783,7 +782,7 @@ public class KeyguardViewMediator extends SystemUI { public void verifyUnlock(IKeyguardExitCallback callback) { synchronized (this) { if (DEBUG) Log.d(TAG, "verifyUnlock"); - if (!mUpdateMonitor.isDeviceProvisioned()) { + if (shouldWaitForProvisioning()) { // don't allow this api when the device isn't provisioned if (DEBUG) Log.d(TAG, "ignoring because device isn't provisioned"); try { @@ -873,7 +872,7 @@ public class KeyguardViewMediator extends SystemUI { * was suppressed by an app that disabled the keyguard or we haven't been provisioned yet. */ public boolean isInputRestricted() { - return mShowing || mNeedToReshowWhenReenabled || !mUpdateMonitor.isDeviceProvisioned(); + return mShowing || mNeedToReshowWhenReenabled || shouldWaitForProvisioning(); } /** @@ -905,14 +904,13 @@ public class KeyguardViewMediator extends SystemUI { // if the setup wizard hasn't run yet, don't show final boolean requireSim = !SystemProperties.getBoolean("keyguard.no_require_sim", false); - final boolean provisioned = mUpdateMonitor.isDeviceProvisioned(); final IccCardConstants.State state = mUpdateMonitor.getSimState(); final boolean lockedOrMissing = state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim); - if (!lockedOrMissing && !provisioned) { + if (!lockedOrMissing && shouldWaitForProvisioning()) { if (DEBUG) Log.d(TAG, "doKeyguard: not showing because device isn't provisioned" + " and the sim is not locked or missing"); return; @@ -935,6 +933,10 @@ public class KeyguardViewMediator extends SystemUI { showLocked(options); } + private boolean shouldWaitForProvisioning() { + return !mUpdateMonitor.isDeviceProvisioned() && !isSecure(); + } + /** * Dismiss the keyguard through the security layers. */ |