Is there a way to get callbacks if the user revokes permissions from the settings after having granted them?
I know we have to check for permissions before trying to use a camera etc etc.
Consider the following scenario, I have a video processing application which needs permission to read and write to storage. The task of processing is usually in the order of seconds. Assuming the user gave permissions when asked and revokes them after the processing starts. In this case is there a way we can get callbacks rather than we checking each time? Just so that we can handle the error case gracefully.
Google introduced a new auto-reset permissions feature with Android 11 to automatically revoke sensitive runtime permissions from apps that have not been in use for a few months.
Android 11 (and newer) can automatically remove permissions from “unused apps” to limit access to sensitive personal data, including location, camera, contacts, files, microphone, and phone.
checkSelfPermission(activity, Manifest. permission. X) checks if any permission is already granted, if you check out other answers they do the same, and rest of the code asks for the permissions not granted.
Is there a way to get callbacks if the user revokes permissions from the settings after having granted them?
No, because your process gets terminated. There is nothing to call back to.
Assuming the user gave permissions when asked and revokes them after the processing starts
In that case, your processing ends abruptly, when your process is terminated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With