I want to show my custom UI when the power off button is long pressed and show the power option ui, Then want to dismiss this ui and show my custom UI. How can I detect power button long press or power menu system ui. How can I detect this system ui appearing and how can I dismiss this, after dismiss I open automatic my app and show a related screen.
My app already have access :-
- Administrator access
- Enable accessibility service
- Ignore battery optimization for running in background with low battery
- Enabled App launch or auto start permission
After having this permission, can I dismiss the system generated ui of power option when user click on power button. and after dismiss this dialog ,open my app with related screen.