From edd32b881780e52b4ecc43f8df3b6b091e70a863 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 23 Jun 2015 22:05:58 -0400 Subject: [PATCH] Fixed a bug with encryption where the keyguard was never shown with PIN This led to the network being unusable. We now ensure that the Keyguard is not notified of the SIM PIN changes until after the initial dismissal logic is done. In addition, the fullscreen PIN is now always shown immediately and not until the user swipes up, which was an error before. Also made sure that the Keyguard Scrim is correctly visible when shown. Bug: 21850021 Change-Id: I81804124bae30adf0e17e26cc42f67e48fc446e8 --- .../systemui/keyguard/KeyguardViewMediator.java | 3 +-- .../statusbar/phone/KeyguardBouncer.java | 1 + .../statusbar/phone/ScrimController.java | 16 +++++++++++++--- .../phone/StatusBarKeyguardViewManager.java | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 80761d80fa995..7f61fc1d29c65 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -622,9 +622,8 @@ public class KeyguardViewMediator extends SystemUI { synchronized (this) { if (DEBUG) Log.d(TAG, "onSystemReady"); mSystemReady = true; - mUpdateMonitor.registerCallback(mUpdateCallback); - doKeyguardLocked(null); + mUpdateMonitor.registerCallback(mUpdateCallback); } // Most services aren't available until the system reaches the ready state, so we // send it here when the device first boots. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index a3bb1296dccd0..a7afec4c3fc6e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -200,6 +200,7 @@ public class KeyguardBouncer { * notifications on Keyguard, like SIM PIN/PUK. */ public boolean needsFullscreenBouncer() { + ensureView(); if (mKeyguardView != null) { SecurityMode mode = mKeyguardView.getSecurityMode(); return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index c3719d42ed638..bacf89052a95e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -137,6 +137,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, scheduleUpdate(); } + public void abortKeyguardFadingOut() { + if (mAnimateKeyguardFadingOut) { + endAnimateKeyguardFadingOut(); + } + } + public void animateGoingToFullShade(long delay, long duration) { mDurationOverride = duration; mAnimationDelay = delay; @@ -321,17 +327,21 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this); mUpdatePending = false; updateScrims(); - mAnimateKeyguardFadingOut = false; mDurationOverride = -1; mAnimationDelay = 0; // Make sure that we always call the listener even if we didn't start an animation. + endAnimateKeyguardFadingOut(); + mAnimationStarted = false; + return true; + } + + private void endAnimateKeyguardFadingOut() { + mAnimateKeyguardFadingOut = false; if (!mAnimationStarted && mOnAnimationFinished != null) { mOnAnimationFinished.run(); mOnAnimationFinished = null; } - mAnimationStarted = false; - return true; } public void setBackDropView(BackDropView backDropView) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index a7e8406f1cf36..a69416a60dfe8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -100,6 +100,7 @@ public class StatusBarKeyguardViewManager { public void show(Bundle options) { mShowing = true; mStatusBarWindowManager.setKeyguardShowing(true); + mScrimController.abortKeyguardFadingOut(); reset(); }