mirror of https://github.com/BOINC/boinc.git
Android client: remove apps from memory if we're on batteries.
Because apps poll 10X/sec for messages from the client, there is a CPU overhead in leaving suspended apps in memory, which can cause battery drain.
This commit is contained in:
parent
cd561b3084
commit
af73b2b862
|
@ -1076,8 +1076,17 @@ void ACTIVE_TASK_SET::suspend_all(int reason) {
|
||||||
//
|
//
|
||||||
atp->preempt(REMOVE_NEVER);
|
atp->preempt(REMOVE_NEVER);
|
||||||
break;
|
break;
|
||||||
|
#ifdef ANDROID
|
||||||
|
case SUSPEND_REASON_BATTERIES:
|
||||||
|
// On Android, remove apps from memory if on batteries.
|
||||||
|
// The message polling in the BOINC runtime system
|
||||||
|
// imposes an overhead which drains the battery a bit
|
||||||
|
atp->preempt(REMOVE_ALWAYS);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
atp->preempt(REMOVE_MAYBE_USER);
|
atp->preempt(REMOVE_MAYBE_USER);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue