Files
OpenCellular/common
Furquan Shaikh 55b87f4847 charge_state: Change CHARGE_MAX_SLEEP_USEC to 1 minute
CHARGE_MAX_SLEEP_USEC was originally set to 1 minute (i.e. equal to
POLL_PERIOD_VERY_LONG) in CL:191767. However, during re-factoring in
CL:193876 it got changed to 1 second as charge_state_v1 used this
value. Looking at the way CHARGE_MAX_SLEEP_USEC is used, value of 1
minute makes more sense because sleep_usec could be set to
POLL_PERIOD_VERY_LONG when device is off or suspended. With the
current logic in suspend/off state, sleep_usec is set to
POLL_PERIOD_VERY_LONG and immediately gets reset to
CHARGE_MAX_SLEEP_USEC in charger_task.

This change fixes the above behavior by defining CHARGE_MAX_SLEEP_USEC
as 1 minute. As a side-effect of this, we might not wake up early
enough in case of critical battery. Thus, check if we need to shutdown
on critical battery and adjust sleep time accordingly.

BUG=b:69695376
BRANCH=None
TEST=make -j buildall

Change-Id: Ieba7279dc4b02c3d64022c3c5ac09fb869a3632d
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/788181
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-11-30 20:30:11 -08:00
..
2017-11-17 20:18:38 -08:00
2015-05-19 02:46:27 +00:00
2017-11-06 13:48:38 -08:00
2017-10-17 13:02:49 -07:00
2016-11-15 17:41:53 -08:00
2017-10-19 14:56:09 -07:00
2017-09-11 11:14:24 -07:00
2016-03-02 13:39:47 -08:00
2017-11-17 20:18:38 -08:00
2017-06-02 10:38:57 -07:00
2017-10-31 13:04:59 -07:00
2017-10-24 12:57:45 -07:00
2014-05-17 20:14:17 +00:00
2016-03-21 16:35:33 -07:00
2017-05-09 23:20:07 -07:00
2017-11-06 13:48:38 -08:00
2017-08-10 22:47:24 -07:00
2017-09-22 10:18:50 -07:00