Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Marshmallow Callback when user revokes permissions from settings ?

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.

like image 554
LostPuppy Avatar asked Oct 05 '15 21:10

LostPuppy


People also ask

What is auto revoke permissions?

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.

What does it mean to remove permissions if app is not used?

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.

How do I check if permission is granted Android?

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.


1 Answers

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.

like image 74
CommonsWare Avatar answered Oct 27 '22 01:10

CommonsWare