Why this code works:
ActivityCompat.requestPermissions(thisActivity,
new String[]{Manifest.permission.READ_CONTACTS},
666);
## In the manifest
<uses-permission android:name="android.permission.READ_CONTACTS" />
and this code doesn't work:
ActivityCompat.requestPermissions(thisActivity,
new String[]{Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE},
666);
## In the manifest
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" />
The first snippet starts the request permission activity asking for read contacts permissions. The last snippet doesn't show the activity and in the logs there is this message:
10-16 12:19:48.061 1138-3635/? I/ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.google.android.packageinstaller cmp=com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity (has extras)} from uid 10147 on display 0
So, what I'm supposed to do to ask notifications permissions? Target API is v24 and the minimum sdk version is 23.