summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorBrian Colonna <bcolonna@google.com>2011-09-28 12:08:58 -0400
committerBrian Colonna <bcolonna@google.com>2011-09-28 12:08:58 -0400
commit4284e9d19a3f917b85e5eac4d6e304fc9b866139 (patch)
treee782884fef0ec1c0e2934ae7828fe6750fb59603 /policy
parent9a3d51ed1090d459666c3257923b16eca842bb10 (diff)
downloadframeworks_base-4284e9d19a3f917b85e5eac4d6e304fc9b866139.zip
frameworks_base-4284e9d19a3f917b85e5eac4d6e304fc9b866139.tar.gz
frameworks_base-4284e9d19a3f917b85e5eac4d6e304fc9b866139.tar.bz2
Pulled out part of onScreenTurnedOn() into show() function
The onScreenTurnedOn() function in LockPatternKeyguardView was actually being called in two cases - when the screen was turned on, AND when the show() function was called in KeyguardViewManager, which actually happens just before the screen is turned off. Face Unlock functionality was added to the onScreenTurnedOn() function, not expecting that the function was also being called just before the screen turns off. This causes Face Unlock to run when the screen is turned off, preventing it from running when the screen is turned on. This was not obvious during testing because it's not a problem when testing from the lock screen. To reproduce the problem you must log in successfully, then turn the screen off, wait, and turn it back on. The solution was to pull the non-face unlock functionality from onScreenTurnedOn() into its own function called show(), which is called from the KeyguardViewManager show() function and also called from onScreenTurnedOn(). In this way, the onScreenTurnedOn() functionality is not changed, but the show() function can be used for the onScreenTurnedOn() functionality minus the Face Unlock stuff. One exception to note - I left setting mScreenOn inside of onScreenTurnedOn() and didn't pull it into show()...that seems like the correct thing to do. Change-Id: I9dcc144c7842112c4d35eb3f8b4ab1cd42c05675
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/KeyguardViewBase.java5
-rw-r--r--policy/src/com/android/internal/policy/impl/KeyguardViewManager.java2
-rw-r--r--policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java15
3 files changed, 16 insertions, 6 deletions
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
index 74dde9c..59b546d 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
@@ -99,6 +99,11 @@ public abstract class KeyguardViewBase extends FrameLayout {
abstract public void onScreenTurnedOn();
/**
+ * Called when the view needs to be shown.
+ */
+ abstract public void show();
+
+ /**
* Called when a key has woken the device to give us a chance to adjust our
* state according the the key. We are responsible for waking the device
* (by poking the wake lock) once we are ready.
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
index f15812b..90972da 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
@@ -167,7 +167,7 @@ public class KeyguardViewManager implements KeyguardWindowController {
mKeyguardHost.addView(mKeyguardView, lp);
if (mScreenOn) {
- mKeyguardView.onScreenTurnedOn();
+ mKeyguardView.show();
}
}
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index f24991c..325dfd3 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -512,11 +512,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
@Override
public void onScreenTurnedOn() {
mScreenOn = true;
- if (mMode == Mode.LockScreen) {
- ((KeyguardScreen) mLockScreen).onResume();
- } else {
- ((KeyguardScreen) mUnlockScreen).onResume();
- }
+ show();
// When screen is turned on, need to bind to FaceLock service if we are using FaceLock
// But only if not dealing with a call
@@ -527,6 +523,15 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
}
}
+ @Override
+ public void show() {
+ if (mMode == Mode.LockScreen) {
+ ((KeyguardScreen) mLockScreen).onResume();
+ } else {
+ ((KeyguardScreen) mUnlockScreen).onResume();
+ }
+ }
+
private void recreateLockScreen() {
if (mLockScreen != null) {
((KeyguardScreen) mLockScreen).onPause();