Commit Graph

18 Commits

Author SHA1 Message Date
Ruchi Kandoi d3027d85f3 Adds a parameter to the wakeup_callback to report sucessful wakeup or suspend aborts.
Adds the call to wakeup_callback when the write to the /sys/power/state
fails. This will help userspace account for the suspend aborts.

Bug: 17478088
Bug: 18179405
Change-Id: Icd1194cfbaf61044ca0b2fe63a10a4c52e1535bc
2015-06-25 13:15:22 -07:00
Jeff Brown 0446e16f53 Add TEMP_FAILURE_RETRY to libsuspend.
In testing, I observed one instance of a call failing due to a signal
sent to the process.  This could happen at various times so it's better
to be safe than sorry.

Bug: 20534809
Change-Id: I42242087300d8b840a50aec34aa6b2e1507cab50
2015-05-18 15:53:56 -07:00
Andreas Gampe 487f98447a Libsuspend: Remove unused variable
For build-system CFLAGS clean-up, remove unused variable.

Change-Id: I34bd33fd24b02ee58b64029146c253c61651d45f
2014-11-24 18:53:44 -08:00
Mark Salyzyn c5e01d8616 am 1291df76: am c5fa4b19: am 065c2706: Merge "libsuspend: Turn on -Werror"
* commit '1291df76956407d08e673443786f92c9a16006c1':
  libsuspend: Turn on -Werror
2014-05-22 19:21:07 +00:00
Mark Salyzyn 6e60d390d0 libsuspend: Turn on -Werror
Change-Id: I4ea982ab7d68a596ac79d93a01c05a109d24672d
2014-05-21 12:58:38 -07:00
Sasha Levitskiy e2acb82a94 am 43cb7ae6: am 4f362e43: am 835526fd: Merge "Cleanup: warning fixit."
* commit '43cb7ae6c31ced8cd518eab59dfea31ab1ade812':
  Cleanup: warning fixit.
2014-04-12 00:02:33 +00:00
Sasha Levitskiy cdc1cfb3e5 Cleanup: warning fixit.
bootable/recovery has a dependent commit: I9adb470b04e4301989d128c9c3097b21b4dea431

Change-Id: Icf23e659265d71d5226d527c2b40cfbc132320ee
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2014-04-11 16:15:46 -07:00
Dianne Hackborn 9552cdf434 Add ability to have a callback when wakeups happen.
Change-Id: I02ff0e035bf8a97bd1a3b6b1699181fc3a137d79
2014-03-07 11:00:39 -08: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
Iliyan Malchev f3104fe5ce am 76edb14f: am 2cc3527a: libsuspend: compile as a static library
* commit '76edb14f94069b11f36250390556d7c3c1853026':
  libsuspend: compile as a static library
2012-12-06 18:59:59 -08:00
Iliyan Malchev 2cc3527ae7 libsuspend: compile as a static library
Compile libsuspend as a static library as well, currently needed by the charger
code in some cases.

Related-to-bug: 7429504
Change-Id: I113017c2c855f915b77c76d8934b6e57c0bb532c
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-12-05 16:03:34 -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 b98865586b libsuspend: force autosleep off during init
If autosuspend_autosleep_init is called when autosleep is enabled,
for example after a runtime restart with the screen off, the kernel
autosleep state will be enabled, but autosuspend_enabled is false.
Further calls to autosuspend_disable by the framework will not result
in autosleep being disabled.

Call autosuspend_autosleep_disable from autosuspend_autosleep_init
to get the kernel state into a known state that matches the
autosuspend_enabled flag.

Bug: 7119416
Change-Id: I8611e4fd256838272aad4382c2340508805b0376
2012-09-21 18:39:17 -07:00
Stephen Hines 30f52fea05 am 67bdfa98: am d25b8502: Merge "Fix unused param warning"
* commit '67bdfa9823dd954fdfaa01721da17d8252fc05d1':
  Fix unused param warning
2012-08-08 17:44:07 -07:00
Edwin Vane 62f9ffac1a Fix unused param warning
libsuspend had only a single warning in the clang build. Fixing it to
make the build clean.

Change-Id: Iaac5f9144b6e6cb122141c6416056c1b2c9aa98e
Author: Edwin Vane <edwin.vane@intel.com>
Reviewed-by: Kevin P Schoedel <kevin.p.schoedel@intel.com>
2012-08-02 10:40:12 -04:00
Colin Cross f25dd878df libsuspend: wait for earlysuspend transition to finish
Wait for the early suspend transition to finish to the point where
surfaceflinger would previously have synchronized.  This is important
during screen on, to ensure the display early suspend handlers have
completed before surfaceflinger unblanks.

Change-Id: I91ac0253d9655c3f1ae3dd7f1a918c279568b23e
2012-06-14 15:13:10 -07:00
Colin Cross 2146b7f2d7 libsuspend: always unblock early suspend
SurfaceFlinger and PowerManagerService manage their synchronization
without the help of early suspend, and SurfaceFlinger no longer unblocks
early suspend.  Add a new thread when early suspend is detected that will
immediately unblock early suspend.

Change-Id: I87ef4984a2ab34cbbb3af8b7762236b9a92dc2ea
2012-06-07 17:15:17 -07: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