summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2012-09-21 20:07:46 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-21 20:07:46 -0700
commit1cd5522fcc16b6a7d38f7f4d2997359759196856 (patch)
tree9ff423505c705a7fb33a53dd910ea3794575e7e8
parent8e586f61dd4f7fa53b01e63ac779ffc7cde05bdd (diff)
parent3fd47af32d6be8971445f4da8deba0fadae688d3 (diff)
downloadframeworks_base-1cd5522fcc16b6a7d38f7f4d2997359759196856.zip
frameworks_base-1cd5522fcc16b6a7d38f7f4d2997359759196856.tar.gz
frameworks_base-1cd5522fcc16b6a7d38f7f4d2997359759196856.tar.bz2
Merge "Send USER_PRESENT for keyguard choice "None"" into jb-mr1-dev
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java20
1 files changed, 19 insertions, 1 deletions
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 416a0bb..212a6bb 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
@@ -339,7 +339,7 @@ public class KeyguardViewMediator {
@Override
public void onDeviceProvisioned() {
- mContext.sendBroadcast(mUserPresentIntent);
+ sendUserPresentBroadcast();
}
@Override
@@ -511,6 +511,9 @@ public class KeyguardViewMediator {
mUpdateMonitor.registerCallback(mUpdateCallback);
doKeyguardLocked();
}
+ // Most services aren't available until the system reaches the ready state, so we
+ // send it here when the device first boots.
+ maybeSendUserPresentBroadcast();
}
/**
@@ -606,6 +609,17 @@ public class KeyguardViewMediator {
notifyScreenOnLocked(showListener);
}
}
+ maybeSendUserPresentBroadcast();
+ }
+
+ private void maybeSendUserPresentBroadcast() {
+ if (mSystemReady && mLockPatternUtils.isLockScreenDisabled()
+ && mUserManager.getUsers(true).size() == 1) {
+ // Lock screen is disabled because the user has set the preference to "None".
+ // In this case, send out ACTION_USER_PRESENT here instead of in
+ // handleKeyguardDone()
+ sendUserPresentBroadcast();
+ }
}
/**
@@ -1093,6 +1107,10 @@ public class KeyguardViewMediator {
}
mWakeLock.release();
+ sendUserPresentBroadcast();
+ }
+
+ private void sendUserPresentBroadcast() {
if (!(mContext instanceof Activity)) {
final UserHandle currentUser = new UserHandle(mLockPatternUtils.getCurrentUser());
mContext.sendBroadcastAsUser(mUserPresentIntent, currentUser);