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>
Tue, 8 Nov 2016 14:32:49 +0000 (22:32 +0800)
commitbced8de084520dcde858f2d1720131f6c93f385a
tree9cd2aaca17103718f44d2a56beadba790c3c3de7
parentb57923c01d2cecca5b78c9a5d87bf96e8fa0176e
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]