Android Marshmallow 当用户从设置中撤销权限时回调?

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?

不,因为你的进程被终止了。没有什么可以回拨的。

Assuming the user gave permissions when asked and revokes them after the processing starts

在那种情况下,当您的进程终止时,您的处理会突然结束。