Revert behavior to perform onResume.

Back out changes from CLs ag/363992 and ag/363859. These introduced
the bugs found in bug 10917435 which is now fixed. Note that backing
out these changes reintroduces bug 10732489.

Change-Id: Ic5105dd4cfc8bf79c6f06188283d1ee3680c370c
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index bd561fd..a88c3cc 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -1190,6 +1190,8 @@
     }
 
     final boolean resumeTopActivityLocked(ActivityRecord prev, Bundle options) {
+        if (ActivityManagerService.DEBUG_LOCKSCREEN) mService.logLockScreen("");
+
         // Find the first activity that is not finishing.
         ActivityRecord next = topRunningActivityLocked(null);
 
@@ -1251,10 +1253,9 @@
 
         // If we are sleeping, and there is no resumed activity, and the top
         // activity is paused, well that is the state we want.
-        if (mService.mLockScreenState == ActivityManagerService.LOCK_SCREEN_FIRST_SHOWN ||
-                (mService.isSleepingOrShuttingDown()
+        if (mService.isSleepingOrShuttingDown()
                 && mLastPausedActivity == next
-                && mStackSupervisor.allPausedActivitiesComplete())) {
+                && mStackSupervisor.allPausedActivitiesComplete()) {
             // Make sure we have executed any pending transitions, since there
             // should be nothing left to do at this point.
             mWindowManager.executeAppTransition();
@@ -1326,7 +1327,7 @@
 
         // We need to start pausing the current activity so the top one
         // can be resumed...
-        boolean pausing = mStackSupervisor.pauseStacks(userLeaving, false);
+        boolean pausing = mStackSupervisor.pauseBackStacks(userLeaving);
         if (mResumedActivity != null) {
             pausing = true;
             startPausingLocked(userLeaving, false);