With the handling of discharge and overheat the state chart got quite
complex. Here is how I think it should behave:

- run_on_batteries = 0
-- charger connected, battery level > X, temperature < Y: not suspended
-- charger connected, battery level < X, temperature < Y: suspend reason
CHARGING
-- charger connected, battery level > X, temperature > Y: suspend reason
OVERHEATED
-- charger connected, battery level < X, temperature > Y: suspend reason
OVERHEATED
-- on batteries: suspend reason BATTERIES

- run_on_batteries = 1
-- charger connected, battery level > X, temperature < Y: not suspended
-- charger connected, battery level < X, temperature < Y: suspend reason
CHARGING
-- charger connected, battery level > X, temperature > Y: suspend reason
OVERHEATED
-- charger connected, battery level < X, temperature > Y: suspend reason
OVERHEATED
-- on batteries, battery level > X, temperature < Y: not suspended
-- on batteries, battery level < X, temperature < Y: suspend reason CHARGING
-- on batteries, battery level > X, temperature > Y: suspend reason
OVERHEATED
-- on batteries, battery level < X, temperature > Y: suspend reason
OVERHEATED

Maybe we should rename CHARGING to NOT_CHARGED, because it can also occur
on batteries.

Configuring X and Y via preferences would be useful, too.

On Fri, Apr 5, 2013 at 11:59 PM, David Anderson <[email protected]>wrote:

> I'm confused; the code (in cs_prefs.cpp) is
>
>         if (!global_prefs.run_on_**batteries
>             && host_info.host_is_running_on_**batteries()
>         ) {
>             return SUSPEND_REASON_BATTERIES;
>         }
>
> This gets called every 1 sec.
> So if run_on_batteries is 0,
> then host_is_running_on_batteries() should get called every 1 sec.
> Am I missing something?


I mixed it up. It gets called, if run_on_batteries is 0, which makes sense.
This is not the reason for the behavior below, then...


>
> -- David
>
>
> On 05-Apr-2013 6:28 AM, Joachim Fritzsch wrote:
>
>> There is a bug in the power management of the client on Android:
>>
>> It occurs preference "run on batteries" is 0. Independently from Android
>> version. Independently whether charging via USB or charger.
>>
>> The client keeps acting according to the status (charger connected) the
>> phone
>> was in, when the client started.
>>
>> E.g. client starts with charger connected. Battery level ~50% charged,
>> unplug
>> charger and phone still shows "Your device's battery is charging".
>> Battery level
>> 100% charged, unplug charger and client keeps running (until it drops
>> below 95%
>> and goes to "your device's battery is charging" again)
>>
>> vice versa if client starts without charger.
>>
>> I recognized that HOST_INFO::host_is_running_on_**batteries() only gets
>> called
>> when preference "run on batteries" is set to 1.
>>
>> Joachim
>>
>>
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to