Skip to content

Commit f5784c0

Browse files
client: if suspending because we're on batteries, don't suspend NCI tasks
(which don't use significant power)
1 parent 8f4271e commit f5784c0

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

client/app_control.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,15 @@ void ACTIVE_TASK_SET::suspend_all(int reason) {
11711171
continue;
11721172
}
11731173

1174-
if (cc_config.dont_suspend_nci && atp->result->non_cpu_intensive()) {
1175-
continue;
1174+
// special cases for non-CPU-intensive apps
1175+
//
1176+
if (atp->result->non_cpu_intensive()) {
1177+
if (cc_config.dont_suspend_nci) {
1178+
continue;
1179+
}
1180+
if (reason == SUSPEND_REASON_BATTERIES) {
1181+
continue;
1182+
}
11761183
}
11771184

11781185
// handle CPU throttling separately

0 commit comments

Comments
 (0)