Android Question power button keycode (samsung Android 9)

peacemaker

Well-Known Member
Licensed User
HI, All

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

DonManfred

Expert
Licensed User
I don´t think this can be captured.
You need to check Google Documentation (or search google) on how about it works or not on rooted devices. But even here i expect NO.
 

peacemaker

Well-Known Member
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