summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-10-17 20:25:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-17 20:25:12 -0700
commitc6ccb29b9a7d3d8aac37f4cd3bd5b5b134724996 (patch)
tree7f03277fd32e00dc4f4a53aa53cb200f0ea2ea20
parentc1dc37cba785d990cabfd4e27edadd18975f8751 (diff)
parent904732c4573de8aa3fa79c3d741380db2457340f (diff)
downloadframeworks_base-c6ccb29b9a7d3d8aac37f4cd3bd5b5b134724996.zip
frameworks_base-c6ccb29b9a7d3d8aac37f4cd3bd5b5b134724996.tar.gz
frameworks_base-c6ccb29b9a7d3d8aac37f4cd3bd5b5b134724996.tar.bz2
Merge "Call requestFocus and ensure that screenOn is set." into jb-mr1-dev
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java40
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java6
2 files changed, 24 insertions, 22 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
index 0ad2404..b66c883 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
@@ -43,7 +43,7 @@ import com.android.internal.widget.LockPatternUtils;
/**
* Manages creating, showing, hiding and resetting the keyguard. Calls back
- * via {@link com.android.internal.policy.impl.KeyguardViewCallback} to poke
+ * via {@link KeyguardViewMediator.ViewMediatorCallback} to poke
* the wake lock and report that the keyguard is done, which is in turn,
* reported to this class by the current {@link KeyguardViewBase}.
*/
@@ -233,6 +233,7 @@ public class KeyguardViewManager {
if (mScreenOn) {
mKeyguardView.show();
+ mKeyguardView.requestFocus();
}
}
@@ -314,22 +315,25 @@ public class KeyguardViewManager {
// Caller should wait for this window to be shown before turning
// on the screen.
- if (mKeyguardHost.getVisibility() == View.VISIBLE) {
- // Keyguard may be in the process of being shown, but not yet
- // updated with the window manager... give it a chance to do so.
- mKeyguardHost.post(new Runnable() {
- public void run() {
- if (mKeyguardHost.getVisibility() == View.VISIBLE) {
- showListener.onShown(mKeyguardHost.getWindowToken());
- } else {
- showListener.onShown(null);
+ if (showListener != null) {
+ if (mKeyguardHost.getVisibility() == View.VISIBLE) {
+ // Keyguard may be in the process of being shown, but not yet
+ // updated with the window manager... give it a chance to do so.
+ mKeyguardHost.post(new Runnable() {
+ @Override
+ public void run() {
+ if (mKeyguardHost.getVisibility() == View.VISIBLE) {
+ showListener.onShown(mKeyguardHost.getWindowToken());
+ } else {
+ showListener.onShown(null);
+ }
}
- }
- });
- } else {
- showListener.onShown(null);
+ });
+ } else {
+ showListener.onShown(null);
+ }
}
- } else {
+ } else if (showListener != null) {
showListener.onShown(null);
}
}
@@ -356,10 +360,9 @@ public class KeyguardViewManager {
if (mKeyguardView != null) {
mKeyguardView.wakeWhenReadyTq(keyCode);
return true;
- } else {
- Log.w(TAG, "mKeyguardView is null in wakeWhenReadyTq");
- return false;
}
+ Log.w(TAG, "mKeyguardView is null in wakeWhenReadyTq");
+ return false;
}
/**
@@ -382,6 +385,7 @@ public class KeyguardViewManager {
final KeyguardViewBase lastView = mKeyguardView;
mKeyguardView = null;
mKeyguardHost.postDelayed(new Runnable() {
+ @Override
public void run() {
synchronized (KeyguardViewManager.this) {
lastView.cleanUp();
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
index 92f9dfd..ceb0325 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
@@ -629,9 +629,7 @@ public class KeyguardViewMediator {
mScreenOn = true;
cancelDoKeyguardLaterLocked();
if (DEBUG) Log.d(TAG, "onScreenTurnedOn, seq = " + mDelayedShowingSequence);
- if (showListener != null) {
- notifyScreenOnLocked(showListener);
- }
+ notifyScreenOnLocked(showListener);
}
maybeSendUserPresentBroadcast();
}
@@ -1365,7 +1363,7 @@ public class KeyguardViewMediator {
/**
* Handle message sent by {@link #verifyUnlock}
- * @see #RESET
+ * @see #VERIFY_UNLOCK
*/
private void handleVerifyUnlock() {
synchronized (KeyguardViewMediator.this) {