The problem is, as previously stated that the system immediately
shuts itself back down when you hit a resume source. We have fixed
this by adding a patch to the resume path to do the following:
@@ -248,6 +248,9 @@ int suspend_devices_and_enter(suspend_state_t state)
static void suspend_finish(void)
To ensure that the main android power driver does not decide that it
needs to suspend again, and re-run the suspend process.
I've checked through the android source tree, and it seems the only
two places where /sys/power/state is referenced is in the powerd sources
(system/core/toolbox/powerd.c) and the init.rc.
The powerd source does not seem to be built into the toolbox, and
there's no mention in my build. Is this some form of problem known
to the "generic" build?
I've tried changing one of my resume buttons to send the POWER key
to see if this is required, but it does not make any difference to
The init.rc script has a service statement which should also make
sure that the power state is set, but it does not seem to be executed.
> service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
> socket zygote stream 666
> onrestart write /sys/android_power/request_state wake
> onrestart write /sys/power/state on
> onrestart restart media
> onrestart restart netd