I'm using this code to open Notification Listener Settings:
startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));
I would like to check if the user has granted authorization to my app. I already tried to check if my NotificationListenerService is running, but it seems that it gets halted and restarted by the system (even if I return START_STICKY).
If you're using androidx you can use
to check if your listener is enabled. Source
The only correct way to do it is to check the secure settings:
I was wrong, checking if service is running works: