How to swap ( invert ) power button behavior ?

161 views
Skip to first unread message

mirek190

unread,
Feb 13, 2019, 4:12:45 PM2/13/19
to Android-x86
I have a tablet so power button works .. strange ...  if i press it then I'm getting power menu - keep longer the button -- sleep device
How to swap that behavior ?
Pressing should sleep device and keeping longer should trigger power menu.


I'm working with the newest source oreo-x86.

Thanks for any advice.

Cezar

unread,
Feb 14, 2019, 11:28:12 AM2/14/19
to Android-x86
path is /oreox86/frameworks/base/core/res/res/values/config.xml:
 modify:
<integer name="config_longPressOnPowerBehavior">1</integer>
and
<integer name="config_shortPressOnPowerBehavior">1</integer>

to whatever suits you.

mirek190

unread,
Feb 15, 2019, 6:45:42 PM2/15/19
to Android-x86
    <!-- Control the behavior when the user long presses the power button.
            0 - Nothing
            1 - Global actions menu
            2 - Power off (with confirmation)
            3 - Power off (without confirmation)
    -->
    <integer name="config_longPressOnPowerBehavior">1</integer>


    <!-- Control the behavior when the user short presses the power button.
            0 - Nothing
            1 - Go to sleep (doze)
            2 - Really go to sleep (don't doze)
            3 - Really go to sleep and go home (don't doze)
            4 - Go to home
            5 - Dismiss IME if shown. Otherwise go to home
    -->
    <integer name="config_shortPressOnPowerBehavior">1</integer>


How changing these values swap power button behavior ? 

Sung-Jin Park

unread,
Feb 15, 2019, 11:25:53 PM2/15/19
to andro...@googlegroups.com
Pressing should sleep device and keeping longer should trigger power menu.

I feel that this is weird because we can press the power button by any unintended mistake.

Pressing the power button for a while seems that the user has a intension to make the tablet sleep. Isn't it? :)

2019년 2월 14일 (목) 오전 6:12, mirek190 <mire...@gmail.com>님이 작성:
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

mirek190

unread,
Feb 16, 2019, 9:46:12 AM2/16/19
to Android-x86
On the tablet short pressing button should sleep device ..not trigger power menu... - do you sleep your smartphone by press long power button ? 
Do you have idea how to swap it ? 
Reply all
Reply to author
Forward
0 new messages