power: earlysuspend: suspend if user space is still asleep after resume
authorVarun Wadekar <vwadekar@nvidia.com>
Wed, 9 May 2012 09:22:26 +0000 (14:22 +0530)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 9 May 2012 11:32:07 +0000 (04:32 -0700)
commitafe26e084f0058a3fa4b98fb2cb8a56f1f94e0f8
treeecda77918721675363da4db672aee10b0c0b31f0
parent6ffdd371786880f74c8d9995e682469b0617770b
power: earlysuspend: suspend if user space is still asleep after resume

There are cases (Android alarms to perform some housekeeping) where the
user space is not awake while resume and we need to suspend the device
again in such scenarios. Schedule a delayed work to take care of this
scenario, which checks if the device state has changed due to late_resume
and if not, then suspends the device again.

Since we do not use wakelocks.c any more, PowerManagerService is not able
to get a wake_lock upon resume which it can play with. We do not want to
get wakelocks.c back again, and this code takes care of the earlier
suspend-resume scenario.

Tested with LowPowerTest_Cmd_Display_On.apk and passed 100 iterations.

Bug 979311

Change-Id: I873a888dc4139bbeaf146bbc7fd55a9f71c7108d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/101477
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
kernel/power/earlysuspend.c