OSDN Git Service

add powerbtnd to simulate long press of power button.
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 23 Jul 2012 06:32:37 +0000 (14:32 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 5 May 2016 09:45:06 +0000 (17:45 +0800)
commit6bd69225268935ff482958439fa5b59718f41804
treee0fe1e6f33078d88362ea13d96302cfa9656ecfd
parente9119ee822879f5d6fb38a5700382839e3e61c72
add powerbtnd to simulate long press of power button.

On x86 PC, power button usually generates key press and release events
simultaneously. However, the android framework expects a long press
of power button to invoke the power off dialog. The daemon simulates a
long press of power button,

On poweroff.doubleclick=0, one click to power button invokes poweroff
dialog directly.

On poweroff.doubleclick=1, one click to power button suspends the system,
while double click in one second invokes poweroff dialog.

A target needs to add excluded-input-devices.xml to exclude
'Power Button' from processing by EventHub.
Android.mk
power/powerbtnd.c [new file with mode: 0644]