Here's the order of checks (see check_suspend_processing() in cs_prefs.cpp):

1) are benchmarks running? (SUSPEND_REASON_BENCHMARKS)
2) user-specified startup delay (SUSPEND_REASON_INITIAL_DELAY)
3) OS about to hibernate? (SUSPEND_REASON_OS)

(the following 4 checked if "run according to preferences",
and the corresponding preference is set)
4) running on batteries? (SUSPEND_REASON_BATTERIES)
5) user active? (SUSPEND_REASON_USER_ACTIVE)
6) time of day (SUSPEND_TIME_OF_DAY)
7) user not active? (SUSPEND_REASON_NO_RECENT_INPUT)

8) CPU throttling (SUSPEND_REASON_CPU_THROTTLE)

(the following Android only)
9) battery hot? (SUSPEND_REASON_BATTERY_OVERHEATED)
10) battery below 95%? (SUSPEND_REASON_BATTERY_CHARGING)

If anyone thinks we should change this order, let me know and explain why.

-- David

On 07-Apr-2013 1:31 AM, Joachim Fritzsch wrote:
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]
<mailto:[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