Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -4755,6 +4755,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } boolean mayBeLaunchingApp() { return (mPowerModeReasons & POWER_MODE_REASON_START_ACTIVITY) != 0; } void startPowerMode(@PowerModeReason int reason) { final int prevReasons = mPowerModeReasons; mPowerModeReasons |= reason; Loading services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +9 −1 Original line number Diff line number Diff line Loading @@ -202,6 +202,12 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { */ private static final int KILL_TASK_PROCESSES_TIMEOUT_MS = 1000; /** * The delay to run idle check. It may give a chance to keep launch power mode if an activity * is starting while the device is sleeping and then the device is unlocked in a short time. */ private static final int IDLE_NOW_DELAY_WHILE_SLEEPING_MS = 100; private static final int IDLE_TIMEOUT_MSG = FIRST_SUPERVISOR_TASK_MSG; private static final int IDLE_NOW_MSG = FIRST_SUPERVISOR_TASK_MSG + 1; private static final int RESUME_TOP_ACTIVITY_MSG = FIRST_SUPERVISOR_TASK_MSG + 2; Loading Loading @@ -2252,7 +2258,9 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { final void scheduleIdle() { if (!mHandler.hasMessages(IDLE_NOW_MSG)) { if (DEBUG_IDLE) Slog.d(TAG_IDLE, "scheduleIdle: Callers=" + Debug.getCallers(4)); mHandler.sendEmptyMessage(IDLE_NOW_MSG); final long delayMs = mService.isSleepingLocked() && mService.mayBeLaunchingApp() ? IDLE_NOW_DELAY_WHILE_SLEEPING_MS : 0; mHandler.sendEmptyMessageDelayed(IDLE_NOW_MSG, delayMs); } } Loading Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -4755,6 +4755,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } boolean mayBeLaunchingApp() { return (mPowerModeReasons & POWER_MODE_REASON_START_ACTIVITY) != 0; } void startPowerMode(@PowerModeReason int reason) { final int prevReasons = mPowerModeReasons; mPowerModeReasons |= reason; Loading
services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +9 −1 Original line number Diff line number Diff line Loading @@ -202,6 +202,12 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { */ private static final int KILL_TASK_PROCESSES_TIMEOUT_MS = 1000; /** * The delay to run idle check. It may give a chance to keep launch power mode if an activity * is starting while the device is sleeping and then the device is unlocked in a short time. */ private static final int IDLE_NOW_DELAY_WHILE_SLEEPING_MS = 100; private static final int IDLE_TIMEOUT_MSG = FIRST_SUPERVISOR_TASK_MSG; private static final int IDLE_NOW_MSG = FIRST_SUPERVISOR_TASK_MSG + 1; private static final int RESUME_TOP_ACTIVITY_MSG = FIRST_SUPERVISOR_TASK_MSG + 2; Loading Loading @@ -2252,7 +2258,9 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { final void scheduleIdle() { if (!mHandler.hasMessages(IDLE_NOW_MSG)) { if (DEBUG_IDLE) Slog.d(TAG_IDLE, "scheduleIdle: Callers=" + Debug.getCallers(4)); mHandler.sendEmptyMessage(IDLE_NOW_MSG); final long delayMs = mService.isSleepingLocked() && mService.mayBeLaunchingApp() ? IDLE_NOW_DELAY_WHILE_SLEEPING_MS : 0; mHandler.sendEmptyMessageDelayed(IDLE_NOW_MSG, delayMs); } } Loading