Fix a regression in pausing activity immediately on sleep

At some point during refactoring of ActivityStack, the code to pause the current
activity got deleted. Added back that line of code. Activity will now pause
as soon as the screen is turned off, rather than after 5 seconds (sleep timeout).

Bug: 10632898

Change-Id: If3cc8708d692d29a13dbd8cfd9edda8883b38c2e
diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java
index 219cb85..9ae049f 100644
--- a/services/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2076,12 +2076,12 @@
                 mService.mHandler.removeMessages(LAUNCH_TIMEOUT_MSG);
             }
         }
+        checkReadyForSleepLocked();
     }
 
     boolean shutdownLocked(int timeout) {
         boolean timedout = false;
         goingToSleepLocked();
-        checkReadyForSleepLocked();
 
         final long endTime = System.currentTimeMillis() + timeout;
         while (true) {