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
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
libsuspend provides functions autosuspend_enable() and
autosuspend_disable() to trigger suspend on a variety of different
kernels.
Change-Id: I5dc28fb51532fa7c514330f1cfde7698d31d734c