Android Question power button keycode (samsung Android 9)

peacemaker

Expert
Licensed User
HI, All

Is it possible to just trap the power key click, or long tap ? Even if root access is avalable.
 

peacemaker

Expert
Licensed User
"android.intent.action.SCREEN_OFF" intent is got via BroadcastReceiver OK.
The puzzle is to get root ... to try to use "reboot" and "shutdown".

p.s. but the power bitton keycode is also existsing, and maybe can be cought with root ... :)
 
Top