mirror of https://github.com/BOINC/boinc.git
- client (Android): forget hysteresis policy; don't compute if < 95% charged.
This commit is contained in:
parent
8d71408978
commit
6352f9ca9d
|
@ -277,25 +277,13 @@ int CLIENT_STATE::check_suspend_processing() {
|
||||||
|
|
||||||
// on some devices, running jobs can drain the battery even
|
// on some devices, running jobs can drain the battery even
|
||||||
// while it's recharging.
|
// while it's recharging.
|
||||||
// So use the following hysteresis policy:
|
// So compute only if 95% charged or more.
|
||||||
// start computing when the batter is 95% charged.
|
|
||||||
// stop computing if it falls below 90%.
|
|
||||||
// Repeat.
|
|
||||||
//
|
//
|
||||||
static bool hyst_state = true;
|
|
||||||
int cp = host_info.battery_charge_pct;
|
int cp = host_info.battery_charge_pct;
|
||||||
if (cp >= 0) {
|
if (cp >= 0)
|
||||||
if (cp < 90) {
|
|
||||||
hyst_state = true;
|
|
||||||
return SUSPEND_REASON_BATTERY_CHARGING;
|
|
||||||
}
|
|
||||||
if (cp < 95) {
|
if (cp < 95) {
|
||||||
if (hyst_state) {
|
|
||||||
return SUSPEND_REASON_BATTERY_CHARGING;
|
return SUSPEND_REASON_BATTERY_CHARGING;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
hyst_state = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue