diff options
-rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index f98b668aba07..0d1d6209c8af 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -2870,6 +2870,13 @@ public final class ActivityManagerService extends ActivityManagerNative } boolean startHomeActivityLocked(int userId) { + if (mHeadless) { + // Added because none of the other calls to ensureBootCompleted seem to fire + // when running headless. + ensureBootCompleted(); + return false; + } + if (mFactoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL && mTopAction == null) { // We are running in factory test mode, but unable to find @@ -4918,7 +4925,7 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized (this) { booting = mBooting; mBooting = false; - enableScreen = !mBooted; + enableScreen = !mBooted && !mHeadless; mBooted = true; } |