androidkotlinaccessibilityservice

Dismissing System Dialogs


is there a way to dismiss System Dialogs (Power Off Popup in this case) and the Notification Panel when they're opened? Using Accessibility Services I'm getting the event of these actions being done by user , but couldn't find a way to change close or dismiss them

Found this solution on web but it's deprecated now :

Intent.ACTION_CLOSE_SYSTEM_DIALOGS

I tried calling startActivity but it doesn't effect the focus on them even when the activity starts


Solution

  • Making some assumptions but unless you have root access, it's largely impossible.

    Intent.ACTION_CLOSE_SYSTEM_DIALOGS use to be a reliable method but recent versions of Android will not permit it.

    There are option but everything is subject to Google Play Policy.