Make device sleep when pressing the power button

621 views
Skip to first unread message

Tristan Daniel

unread,
Jul 17, 2018, 2:57:11 PM7/17/18
to Android-x86
Hi,

I installed the 8.1-rc1 64 on my Lenovo Ideapad MIIX 520 12. Everything is working fine, but I would like to change the behavior of the power button and screen timeout.

I have successfuly suspended the device to memory by running the following command:

echo mem > /sys/power/state

And by pressing the power button, the device wakes up without any problem.

Currently, pressing the power button brings up a popup menu asking me if I want to shut down or reboot the device. I would like it instead to just suspend to memory.
Additionnaly, when the device display times out, the device kind of suspends but I don't know how exactly. And if I press the power button, the fan starts spinning at 100% but the display stays off. So ideally I would like to suspend the device to memory too when the display times out.

Is there any way to achieve this, either by tweaking the props or even recompiling Android?

Thanks!

Chih-Wei Huang

unread,
Jul 18, 2018, 10:13:26 PM7/18/18
to Android-x86
Yes.

setprop poweroff.doubleclick 1

You may add poweroff.doubleclick=1 to build.prop
to make it persistent.

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Tristan Daniel

unread,
Jul 19, 2018, 7:58:58 AM7/19/18
to Android-x86
Thanks, setting poweroff.doubleclick=1 fixed the problem of the power button showing a menu instead of putting the device to standby.

Now the only problem left is that I want the device to suspend to RAM instead of going in standby mode.
I understand this is the default Android behavior, but for a laptop usage, I do not need the system to keep running in the background.

As I said, I know it works well on my tablet with echo mem > /sys/power/state, so I guess it's just a matter of telling Android to suspend to RAM instead of going in standby mode.

youling 257

unread,
Jul 19, 2018, 8:07:21 AM7/19/18
to Android-x86
of course,oreo remove earlysuspend,can't press power button sleep to suspend .

nougat,we can sleep.earlysuspend=1,press power button sleep immediately suspend .

how to immediately suspend on oreo ?
Reply all
Reply to author
Forward
0 new messages