diff options
-rw-r--r-- | policy/src/com/android/internal/policy/impl/KeyguardViewManager.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java index 9588a01..337881f 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java @@ -197,10 +197,10 @@ public class KeyguardViewManager implements KeyguardWindowController { mScreenOn = false; if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOff(); - } - // When screen is turned off, need to unbind from FaceLock service if we are using FaceLock - mKeyguardView.stopAndUnbindFromFaceLock(); + // When screen is turned off, need to unbind from FaceLock service if using FaceLock + mKeyguardView.stopAndUnbindFromFaceLock(); + } } public synchronized void onScreenTurnedOn() { @@ -208,10 +208,10 @@ public class KeyguardViewManager implements KeyguardWindowController { mScreenOn = true; if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOn(); - } - // When screen is turned on, need to bind to FaceLock service if we are using FaceLock - mKeyguardView.bindToFaceLock(); + // When screen is turned on, need to bind to FaceLock service if we are using FaceLock + mKeyguardView.bindToFaceLock(); + } } public synchronized void verifyUnlock() { @@ -248,9 +248,11 @@ public class KeyguardViewManager implements KeyguardWindowController { public synchronized void hide() { if (DEBUG) Log.d(TAG, "hide()"); - // When view is hidden, need to unbind from FaceLock service if we are using FaceLock - // e.g., when device becomes unlocked - mKeyguardView.stopAndUnbindFromFaceLock(); + if (mKeyguardView != null) { + // When view is hidden, need to unbind from FaceLock service if we are using FaceLock + // e.g., when device becomes unlocked + mKeyguardView.stopAndUnbindFromFaceLock(); + } if (mKeyguardHost != null) { mKeyguardHost.setVisibility(View.GONE); |