From 9449a6162e275531857464acc2279894d5d6a240 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 1 Oct 2014 15:53:28 -0700 Subject: [PATCH] Fix issue #17740687: Device does not boot after flashing LMP dev TOT(1478825) build. There was a path through idle where we could clear mBooting but not set mBooted, so we would no longer start activities. This is probably happening because if you start a user or userdebug build with the device plugged in to adb, the system early on starts the USB security dialog, before home is started. If that goes idle first, we will end up in the case where we clear booting (because something went idle) but not set booted (because it was not home that went idle). Change this so that we always set booted when clearing booting. Change-Id: I40053710eefa939315aeb9475ecdd2e8a87351ff --- .../android/server/am/ActivityStackSupervisor.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index e9f055866bd26..bbfb62abff055 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -2243,9 +2243,13 @@ public final class ActivityStackSupervisor implements DisplayListener { r.idle = true; //Slog.i(TAG, "IDLE: mBooted=" + mBooted + ", fromTimeout=" + fromTimeout); - if (!mService.mBooted && isFrontStack(r.task.stack)) { - mService.mBooted = true; - enableScreen = true; + if (isFrontStack(r.task.stack) || fromTimeout) { + booting = mService.mBooting; + mService.mBooting = false; + if (!mService.mBooted) { + mService.mBooted = true; + enableScreen = true; + } } } @@ -2273,9 +2277,6 @@ public final class ActivityStackSupervisor implements DisplayListener { mFinishingActivities.clear(); } - booting = mService.mBooting; - mService.mBooting = false; - if (mStartingUsers.size() > 0) { startingUsers = new ArrayList(mStartingUsers); mStartingUsers.clear();