I've finished trying with KeyEvent.KEYCODE_POWER in onKeyDown override method, execut Root command, dismiss system dialog and abortBroadcast() to prevent power-off or restart from power button's long press click event. But these're not working due to security reasons for android version>9.
Do you think we can use some kind of script to get that on android os?
I hope you're gonna give any idea to try. Thanks..