2016-11-12 3:30 GMT+08:00 Michael Goffioul <
michael....@gmail.com>:
> Answering myself: it seems setting "debug.autosleep=1" in Android solves the
> problem. From the look at it, the kernel bundled with 4.4-r5 does not have
> the Android kernel patches for earlysuspend, but Android will use
> earlysuspend mechanism by default. So the wakelock installed by
> PowerManagerService is ignored by the kernel. By making Android to use
> autosleep instead, the wakelock is taken into account and the CPU stays
> awake.
I'm just going to answer your question.
Fortunately you have found it.
Actually the best way to find the answer
is just read the source code.
Note debug.autosleep is only valid in android-x86 4.4.
For android-x86 6.0 or 7.0 you should use
sleep.earlysuspend=0. Also note the default value
of sleep.earlysuspend is 1 in 6.0.
But in 7.0 it's experimentally changed to 0.
Indeed the suspend/resume support of
android-x86 is still premature.
So don't surprise it is changed or broken
in the future...