Loading services/core/java/com/android/server/am/ActiveServices.java +1 −0 Original line number Diff line number Diff line Loading @@ -1468,6 +1468,7 @@ public final class ActiveServices { app.services.remove(r); r.app = null; scheduleServiceRestartLocked(r, false); return; } } Loading services/core/java/com/android/server/am/ActivityManagerService.java +18 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static com.android.internal.util.XmlUtils.writeBooleanAttribute; import static com.android.internal.util.XmlUtils.writeIntAttribute; import static com.android.internal.util.XmlUtils.writeLongAttribute; import static com.android.server.Watchdog.NATIVE_STACKS_OF_INTEREST; import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE; import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT; import static org.xmlpull.v1.XmlPullParser.START_TAG; import static com.android.server.am.ActivityStackSupervisor.HOME_STACK_ID; Loading Loading @@ -1192,7 +1193,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int SYSTEM_USER_START_MSG = 42; static final int SYSTEM_USER_CURRENT_MSG = 43; static final int ENTER_ANIMATION_COMPLETE_MSG = 44; static final int ENABLE_SCREEN_AFTER_BOOT_MSG = 45; static final int FINISH_BOOTING_MSG = 45; static final int START_USER_SWITCH_MSG = 46; static final int SEND_LOCALE_TO_MOUNT_DAEMON_MSG = 47; Loading Loading @@ -1877,8 +1878,13 @@ public final class ActivityManagerService extends ActivityManagerNative } break; } case ENABLE_SCREEN_AFTER_BOOT_MSG: { case FINISH_BOOTING_MSG: { if (msg.arg1 != 0) { finishBooting(); } if (msg.arg2 != 0) { enableScreenAfterBoot(); } break; } case SEND_LOCALE_TO_MOUNT_DAEMON_MSG: { Loading Loading @@ -6258,8 +6264,9 @@ public final class ActivityManagerService extends ActivityManagerNative Binder.restoreCallingIdentity(origId); } void postEnableScreenAfterBootLocked() { mHandler.sendEmptyMessage(ENABLE_SCREEN_AFTER_BOOT_MSG); void postFinishBooting(boolean finishBooting, boolean enableScreen) { mHandler.sendMessage(mHandler.obtainMessage(FINISH_BOOTING_MSG, finishBooting? 1 : 0, enableScreen ? 1 : 0)); } void enableScreenAfterBoot() { Loading Loading @@ -11275,6 +11282,7 @@ public final class ActivityManagerService extends ActivityManagerNative // Start up initial activity. mBooting = true; startHomeActivityLocked(mCurrentUserId); try { if (AppGlobals.getPackageManager().hasSystemUidErrors()) { Loading Loading @@ -12508,7 +12516,7 @@ public final class ActivityManagerService extends ActivityManagerNative boolean printedAnything = false; if (mRecentTasks.size() > 0) { if (mRecentTasks != null && mRecentTasks.size() > 0) { boolean printedHeader = false; final int N = mRecentTasks.size(); Loading Loading @@ -12907,10 +12915,12 @@ public final class ActivityManagerService extends ActivityManagerNative if (dumpAll) { pw.println(" Total persistent processes: " + numPers); pw.println(" mProcessesReady=" + mProcessesReady + " mSystemReady=" + mSystemReady); pw.println(" mBooting=" + mBooting + " mSystemReady=" + mSystemReady + " mBooted=" + mBooted + " mFactoryTest=" + mFactoryTest); pw.println(" mBooting=" + mBooting + " mCallFinishBooting=" + mCallFinishBooting + " mBootAnimationComplete=" + mBootAnimationComplete); pw.print(" mLastPowerCheckRealtime="); TimeUtils.formatDuration(mLastPowerCheckRealtime, pw); pw.println(""); services/core/java/com/android/server/am/ActivityStack.java +9 −0 Original line number Diff line number Diff line Loading @@ -1482,6 +1482,11 @@ final class ActivityStack { final boolean resumeTopActivityInnerLocked(ActivityRecord prev, Bundle options) { if (ActivityManagerService.DEBUG_LOCKSCREEN) mService.logLockScreen(""); if (!mService.mBooting && !mService.mBooted) { // Not ready yet! return false; } ActivityRecord parent = mActivityContainer.mParentActivity; if ((parent != null && parent.state != ActivityState.RESUMED) || !mActivityContainer.isAttachedLocked()) { Loading Loading @@ -3606,6 +3611,10 @@ final class ActivityStack { final TaskRecord task = mResumedActivity != null ? mResumedActivity.task : null; if (task == tr && tr.isOverHomeStack() || numTasks <= 1 && isOnHomeDisplay()) { if (!mService.mBooting && !mService.mBooted) { // Not ready yet! return false; } final int taskToReturnTo = tr.getTaskToReturnTo(); tr.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); return mStackSupervisor.resumeHomeStackTask(taskToReturnTo, null); Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +8 −6 Original line number Diff line number Diff line Loading @@ -421,6 +421,11 @@ public final class ActivityStackSupervisor implements DisplayListener { } boolean resumeHomeStackTask(int homeStackTaskType, ActivityRecord prev) { if (!mService.mBooting && !mService.mBooted) { // Not ready yet! return false; } if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) { mWindowManager.showRecentApps(); return false; Loading Loading @@ -2295,9 +2300,7 @@ public final class ActivityStackSupervisor implements DisplayListener { activityRemoved |= r.task.stack.destroyActivityLocked(r, true, "finish-idle"); } if (booting) { mService.finishBooting(); } else { if (!booting) { // Complete user switch if (startingUsers != null) { for (int i = 0; i < startingUsers.size(); i++) { Loading @@ -2318,8 +2321,8 @@ public final class ActivityStackSupervisor implements DisplayListener { //dump(); //mWindowManager.dump(); if (enableScreen) { mService.postEnableScreenAfterBootLocked(); if (booting || enableScreen) { mService.postFinishBooting(booting, enableScreen); } if (activityRemoved) { Loading Loading @@ -2584,7 +2587,6 @@ public final class ActivityStackSupervisor implements DisplayListener { r.mLaunchTaskBehind); } } resumeHomeStackTask(HOME_ACTIVITY_TYPE, null); } void moveTaskToStack(int taskId, int stackId, boolean toTop) { Loading Loading
services/core/java/com/android/server/am/ActiveServices.java +1 −0 Original line number Diff line number Diff line Loading @@ -1468,6 +1468,7 @@ public final class ActiveServices { app.services.remove(r); r.app = null; scheduleServiceRestartLocked(r, false); return; } } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +18 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static com.android.internal.util.XmlUtils.writeBooleanAttribute; import static com.android.internal.util.XmlUtils.writeIntAttribute; import static com.android.internal.util.XmlUtils.writeLongAttribute; import static com.android.server.Watchdog.NATIVE_STACKS_OF_INTEREST; import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE; import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT; import static org.xmlpull.v1.XmlPullParser.START_TAG; import static com.android.server.am.ActivityStackSupervisor.HOME_STACK_ID; Loading Loading @@ -1192,7 +1193,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int SYSTEM_USER_START_MSG = 42; static final int SYSTEM_USER_CURRENT_MSG = 43; static final int ENTER_ANIMATION_COMPLETE_MSG = 44; static final int ENABLE_SCREEN_AFTER_BOOT_MSG = 45; static final int FINISH_BOOTING_MSG = 45; static final int START_USER_SWITCH_MSG = 46; static final int SEND_LOCALE_TO_MOUNT_DAEMON_MSG = 47; Loading Loading @@ -1877,8 +1878,13 @@ public final class ActivityManagerService extends ActivityManagerNative } break; } case ENABLE_SCREEN_AFTER_BOOT_MSG: { case FINISH_BOOTING_MSG: { if (msg.arg1 != 0) { finishBooting(); } if (msg.arg2 != 0) { enableScreenAfterBoot(); } break; } case SEND_LOCALE_TO_MOUNT_DAEMON_MSG: { Loading Loading @@ -6258,8 +6264,9 @@ public final class ActivityManagerService extends ActivityManagerNative Binder.restoreCallingIdentity(origId); } void postEnableScreenAfterBootLocked() { mHandler.sendEmptyMessage(ENABLE_SCREEN_AFTER_BOOT_MSG); void postFinishBooting(boolean finishBooting, boolean enableScreen) { mHandler.sendMessage(mHandler.obtainMessage(FINISH_BOOTING_MSG, finishBooting? 1 : 0, enableScreen ? 1 : 0)); } void enableScreenAfterBoot() { Loading Loading @@ -11275,6 +11282,7 @@ public final class ActivityManagerService extends ActivityManagerNative // Start up initial activity. mBooting = true; startHomeActivityLocked(mCurrentUserId); try { if (AppGlobals.getPackageManager().hasSystemUidErrors()) { Loading Loading @@ -12508,7 +12516,7 @@ public final class ActivityManagerService extends ActivityManagerNative boolean printedAnything = false; if (mRecentTasks.size() > 0) { if (mRecentTasks != null && mRecentTasks.size() > 0) { boolean printedHeader = false; final int N = mRecentTasks.size(); Loading Loading @@ -12907,10 +12915,12 @@ public final class ActivityManagerService extends ActivityManagerNative if (dumpAll) { pw.println(" Total persistent processes: " + numPers); pw.println(" mProcessesReady=" + mProcessesReady + " mSystemReady=" + mSystemReady); pw.println(" mBooting=" + mBooting + " mSystemReady=" + mSystemReady + " mBooted=" + mBooted + " mFactoryTest=" + mFactoryTest); pw.println(" mBooting=" + mBooting + " mCallFinishBooting=" + mCallFinishBooting + " mBootAnimationComplete=" + mBootAnimationComplete); pw.print(" mLastPowerCheckRealtime="); TimeUtils.formatDuration(mLastPowerCheckRealtime, pw); pw.println("");
services/core/java/com/android/server/am/ActivityStack.java +9 −0 Original line number Diff line number Diff line Loading @@ -1482,6 +1482,11 @@ final class ActivityStack { final boolean resumeTopActivityInnerLocked(ActivityRecord prev, Bundle options) { if (ActivityManagerService.DEBUG_LOCKSCREEN) mService.logLockScreen(""); if (!mService.mBooting && !mService.mBooted) { // Not ready yet! return false; } ActivityRecord parent = mActivityContainer.mParentActivity; if ((parent != null && parent.state != ActivityState.RESUMED) || !mActivityContainer.isAttachedLocked()) { Loading Loading @@ -3606,6 +3611,10 @@ final class ActivityStack { final TaskRecord task = mResumedActivity != null ? mResumedActivity.task : null; if (task == tr && tr.isOverHomeStack() || numTasks <= 1 && isOnHomeDisplay()) { if (!mService.mBooting && !mService.mBooted) { // Not ready yet! return false; } final int taskToReturnTo = tr.getTaskToReturnTo(); tr.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); return mStackSupervisor.resumeHomeStackTask(taskToReturnTo, null); Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +8 −6 Original line number Diff line number Diff line Loading @@ -421,6 +421,11 @@ public final class ActivityStackSupervisor implements DisplayListener { } boolean resumeHomeStackTask(int homeStackTaskType, ActivityRecord prev) { if (!mService.mBooting && !mService.mBooted) { // Not ready yet! return false; } if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) { mWindowManager.showRecentApps(); return false; Loading Loading @@ -2295,9 +2300,7 @@ public final class ActivityStackSupervisor implements DisplayListener { activityRemoved |= r.task.stack.destroyActivityLocked(r, true, "finish-idle"); } if (booting) { mService.finishBooting(); } else { if (!booting) { // Complete user switch if (startingUsers != null) { for (int i = 0; i < startingUsers.size(); i++) { Loading @@ -2318,8 +2321,8 @@ public final class ActivityStackSupervisor implements DisplayListener { //dump(); //mWindowManager.dump(); if (enableScreen) { mService.postEnableScreenAfterBootLocked(); if (booting || enableScreen) { mService.postFinishBooting(booting, enableScreen); } if (activityRemoved) { Loading Loading @@ -2584,7 +2587,6 @@ public final class ActivityStackSupervisor implements DisplayListener { r.mLaunchTaskBehind); } } resumeHomeStackTask(HOME_ACTIVITY_TYPE, null); } void moveTaskToStack(int taskId, int stackId, boolean toTop) { Loading