am 390a3f45: Merge "Revert behavior of Lockscreen Activity Launch to KK" into lmp-dev

* commit '390a3f459bf9ba6473f5ef93e4e37984980e1315':
  Revert behavior of Lockscreen Activity Launch to KK
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 9509789..04e1817 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -937,13 +937,6 @@
     private boolean mRunningVoice = false;
 
     /**
-     * Set while the keyguard is waiting for an activity to draw.
-     * In this state, if we are sleeping, we allow Activities to launch
-     * so that they can draw before Keyguard dismisses itself.
-     */
-    private boolean mKeyguardWaitingForDraw = false;
-
-    /**
      * State of external calls telling us if the device is asleep.
      */
     private boolean mWentToSleep = false;
@@ -6256,7 +6249,10 @@
             synchronized (this) {
                 if (DEBUG_LOCKSCREEN) logLockScreen("");
                 mWindowManager.keyguardWaitingForActivityDrawn();
-                mKeyguardWaitingForDraw = true;
+                if (mLockScreenShown) {
+                    mLockScreenShown = false;
+                    comeOutOfSleepIfNeededLocked();
+                }
             }
         } finally {
             Binder.restoreCallingIdentity(token);
@@ -9959,7 +9955,7 @@
     }
 
     public boolean isSleeping() {
-        return mSleeping && !mKeyguardWaitingForDraw;
+        return mSleeping;
     }
 
     void goingToSleep() {
@@ -9980,7 +9976,6 @@
         if (mWentToSleep && !mRunningVoice) {
             if (!mSleeping) {
                 mSleeping = true;
-                mKeyguardWaitingForDraw = false;
                 mStackSupervisor.goingToSleepLocked();
 
                 // Initialize the wake times of all processes.
@@ -10089,7 +10084,6 @@
             try {
                 if (DEBUG_LOCKSCREEN) logLockScreen(" shown=" + shown);
                 mLockScreenShown = shown;
-                mKeyguardWaitingForDraw = false;
                 comeOutOfSleepIfNeededLocked();
             } finally {
                 Binder.restoreCallingIdentity(ident);