From 6ff6d010d117c623d5c2558602dc9dc7493a8ebf Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 24 Sep 2013 16:21:54 -0700 Subject: [PATCH] Be less aggressive when not resuming top activity The previous fix for keeping activities from running on startup, ag/363992, was keeping the home task from launching when the keyguard should have allowed it. This fix permits the home activity to launch in such situations. Fixes bug 10916877. Change-Id: I429f0d5a13e06a247b9b6b7241f9a3514044c371 --- services/java/com/android/server/am/ActivityStack.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index c760a3b4f7ccd..bd561fd2a8710 100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -1190,10 +1190,6 @@ final class ActivityStack { } final boolean resumeTopActivityLocked(ActivityRecord prev, Bundle options) { - if (mService.mLockScreenState == ActivityManagerService.LOCK_SCREEN_FIRST_SHOWN) { - return false; - } - // Find the first activity that is not finishing. ActivityRecord next = topRunningActivityLocked(null); @@ -1255,9 +1251,10 @@ final class ActivityStack { // 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.isSleepingOrShuttingDown()) + if (mService.mLockScreenState == ActivityManagerService.LOCK_SCREEN_FIRST_SHOWN || + (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();