Situation
One of my fragments accesses the camera. So of course i need to check the permission in my activity first, before i redirect to it. If the user denies the permission the Activity finishes and redirects him to the previous Activity he was in.
Additionally I would like to show a different fragment when the Activity starts and detects that the permission was permanently denied. (The little checkbox "Never ask again" on the android permission dialog)
Problem
I could not find a proper way of detecting, wether the permission was only denied once or if the "Never ask again" checkbox was checked last time and denied the permission permanently.
Keep in mind that I don't want to know that in the onRequestPermissionsResult callback. I need to know in the onCreate of my Activity if the permission currently is granted, denied or permanently denied.
What I tried
ActivityCompat#shouldShowRequestPermissionRationale
seems to detect wether the permission has been denied in the past or not. It also returns true if it has been denied only once instead of permanently.
PermissionChecker#checkPermission()
didn't seem to notice any difference between permanently and only once denied permission state.
Question
Is there any way of detecting, wether a permission is denied but can still be requested or if it is permanently denied?