Commit graph

10 commits

Author SHA1 Message Date
Steve Paik
10b149f18f Add force_suspend function
This CL implements a simple force_suspend().  This function takes a
timeoutMs argument that is currently ignored.  It also uses a two-stage
init process that spawns the suspend_thread when autosuspend is in use.

Follow-up CLs will:
- Implement file locking to prevent multiple libsuspend instances from
starting multiple suspend threads in the system.
- Fully implement timout for force_suspend.
- Integrate force_suspend with suspend_thred.

Bug: 70669809
Test:  autosuspend still works
Change-Id: I6b2c72d0c61d1bec6db0f0b28481ffe0e20ec615
2018-01-19 12:30:39 -08:00
Steve Paik
2d44190539 Create wrapper function for set_wakeup_callback
Bug: 70669809
Test:  Compiles

Change-Id: I55f8b9995c2d872504b586addb07a18206da7fbe
2017-12-18 10:22:04 -08:00
Steve Paik
fea16e1dea Fix LOG() messages to drop \n
Bug: 70669809
Test: It's gone
Change-Id: Id66776a229be677c89968d1e0dc81fc8b4b7de5d
2017-12-14 17:31:58 -08:00
Mark Salyzyn
271a1a7cda resolve merge conflicts of a45b1d6f3 to master
Test: compile
Bug: 30465923
Change-Id: I648855539df3cfa176c6ecac19b6a562ba6feaf7
2017-01-11 11:41:38 -08:00
Mark Salyzyn
30f991f251 liblog: use log/log.h when utilizing ALOG macros
Test: compile
Bug: 30465923
Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
2017-01-11 09:31:15 -08:00
Tim Murray
021d60be98 libsuspend: remove autosleep and earlysuspend
autosleep and earlysuspend are long-deprecated, so remove them to make
libsuspend slightly more comprehensible.

Test: builds and still suspends on marlin

bug 32621856

Change-Id: I66a904c3fce0111fb5e9d1ab9d205c97617ae210
2016-11-02 15:49:56 -07:00
Mark Salyzyn
66ce3e08c5 system/core Replace cutils/log.h with android/log.h
Should use android/log.h instead of cutils/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
2016-09-30 12:47:05 -07:00
Todd Poynor
6f26891d67 libsuspend: use wakeup count interface for system suspend
Use the wakeup count interface for requesting suspend, instead of
autosleep, to allow userspace to collect stats on suspend/resume
activity.

Change-Id: I44b5ef031b2bdc5b09c904fb2adbbe16370c2984
2014-03-04 20:02:53 -08:00
Kyle Russell
a26b4caf4c autosuspend_inited flag set even if initialization fails
Prevents possible SIGSEGV on second autosuspend_enable attempt when
first intialization attempt fails.  autosuspend_inited should only
be set once autosuspend_ops has been assigned.

Consider the first call to autosuspend_enable().
autosuspend_init() sets its inited flag to true, and attempts to
set autosuspend_ops.  If all the other autosuspend_*_init() attempts
fail, autosuspend_init() returns -1, which autosuspend_enable()
will return as a failure.  A second call to autosuspend_enable()
will check autosuspend_init() and see that autosuspend has already
been initialized.  It will attempt to access autosuspend_ops, which
were not set in the first initialization attempt, causing a SIGSEGV.

Change-Id: Ib2d3ee62fee4c3b6d0323e5b7f3709a23c6b923f
2012-11-20 09:12:39 -05:00
Colin Cross
a2582c2c4d libsuspend: create new library to handle triggering suspend
libsuspend provides functions autosuspend_enable() and
autosuspend_disable() to trigger suspend on a variety of different
kernels.

Change-Id: I5dc28fb51532fa7c514330f1cfde7698d31d734c
2012-05-07 15:33:34 -07:00