How to close notification panel without AccessibilityService in Android 12?

Viewed 840

I'm looking for a way to close a notification panel after the user pressed some button in my notification. Currently, I'm doing it like that:

sendBroadcast(Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS))

But this way is deprecated on Android 12 and the official recommendation is to use GLOBAL_ACTION_DISMISS_NOTIFICATION_SHADE action from AccessibilityService. Is there any way to do it somehow without AccessibilityService?

0 Answers
Related