Power Off Button and Shutdown

2,002 views
Skip to first unread message

OmegaKZ793

unread,
Jun 6, 2014, 1:15:49 AM6/6/14
to andro...@googlegroups.com
Hi all!

Thank you very much for this wonderful project. 

I downloaded the source code, trying to figure out how to fix them so that when you click on the button "PC on/off ", the system has completed its work. 

I understand that it is necessary to correct the system modules. But I don `t know which one. In the module, the "SystemUI" I have found function for shutdown sustem. Its added there new void, it does not take the issue of dialogue with the shutdown. 

I thought about how to finish on the listner "KEYCODE_POVER" but it is not the best option. 

P.S. :I rework system for CarPC.

Chih-Wei Huang

unread,
Jun 6, 2014, 2:41:07 AM6/6/14
to Android-x86
You should/need not to change that.
The problem is the power button of traditional PC/NB
doesn't behave as the android expects.
There are some ways to solve it:

1. Simulate power off event by double clicking
the power button (setprop poweroff.doubleclick 1)
This is the default behavior of 4.4-RCx.
2. Simulate power off event by single clicking.
Just change the property poweroff.doubleclick to 0.
3. Change your power button behavior to meet the
android requirement.
It may need to modify your bios, hardware spec, ...

> P.S. :I rework system for CarPC.

If you are designing your hardware,
you'd better to go with the 3rd approach.


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

OmegaKZ793

unread,
Jun 6, 2014, 7:26:43 AM6/6/14
to andro...@googlegroups.com
Thank you! 
I will try to use this "poweroff.doubleclick to 0." 
Use platform "Intel NUC" for my CarPC. Android 4.4 RC2 Work is fine! 
Can I use an external GPS devices, such as USB GPS-receiver. If I can, what I can use the device for better compatibility?

OmegaKZ793

unread,
Jun 9, 2014, 6:05:28 AM6/9/14
to andro...@googlegroups.com
SOLVED 
If you need to device is ato turn off(without power off dialog) via "Power off" button, You need set "poweroff.doubleclick=0" in build.prop and then, need to edit sources file.
File "<sourcers root>/frameworks/base/core/res/res/values/config.xml", find option "config_longPressOnPowerBehavior" and change value to "3" ("<integer name="config_longPressOnPowerBehavior">3</integer>").
This option allow to power off without dialog.

P.S. file 
 "<sourcers root>/frameworks/base/core/res/res/values/config.xml" have many interesting other options!

Jaime Serrano

unread,
Sep 21, 2015, 6:05:29 PM9/21/15
to Android-x86
Is it possible to modify this param in runtime? I mean without modifying the source tree, recompile and reinstall. I have spent a lot of time tunning the system and I would like to avoid start from scratch again...

Thanks! 
 

Phil Buck

unread,
Aug 25, 2016, 1:12:58 PM8/25/16
to Android-x86
Hi, Looking For Help - Advice Im Looking To Config The Power Button To Send The Computer To Sleep/Hibernate/Standby In Marshmallow 6.0.2

The Early Versions Of Android x86 Done This (Like In Android 4.4.0 & Older Versions) - Ideal As It Is Being Installed In A Car PC & Want An Instant "No Boot" For It To Resume Where I Left Off.

If Anyone Can Tell Me How / What Code I Need To Adjust/Edit To Do This - It Would Be Greatly Received.. Im A Complete Newbie To Configuring Android But Know Where The File I Need To Adjust Is (Core/Res/Res/Values/Config) But Thats All I Can Figure 

I Have Seen A Code For (Power Off With-Out Conformation) But Really Would Like The Sleep Option As I Mention (For The Fast Resume) 

Many Thanks, Phil
Reply all
Reply to author
Forward
0 new messages