在按“重置应用程序首选项"后,我的应用程序的所有权限都将被撤消. [英] All the permissions of my app are revoked after pressing "Reset app preferences"

查看:158
本文介绍了在按“重置应用程序首选项"后,我的应用程序的所有权限都将被撤消.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个应用程序并支持Android 6.0.当我在设置"->应用程序"->重置应用程序首选项"中重置应用程序首选项时,我的应用程序的所有权限都将被吊销,并且该应用程序不会重新启动.撤消其权限后无法重新启动该应用程序可能会导致许多意外崩溃.

I develop an app and support Android 6.0. When I reset app preferences in Settings -> Apps -> Reset app preferences, all permissions of my app are revoked and the app is not restarted. Failure to restart the app after revoking its permissions can cause many unexpected crashes.

该如何处理?

当我手动撤消其权限(设置->应用程序->我的应用程序->权限)时,该应用程序将重新启动.

The app is restarted when I revoke its permissions manually (Settings -> Apps -> My app -> Permissions).

推荐答案

我可以重现该问题.我已就此问题提交了问题.

I can reproduce the problem. I have filed an issue in regards to it.

该如何处理?

How should I handle this case?

由于这是一个概率很低的事件(有多少用户打算找到这个选项,更不用说吹过警告对话框并真正做到了?),就我个人而言,我不会不必担心太多.

Since this is a fairly low-probability event (how many users are ever going to find that option, let alone blow past the warning dialog and actually do it?), personally, I wouldn't worry about it too much.

由于没有记录在案的setOnPermissionChangeListener()ACTION_DUDE_YOUR_PERMS_WUZ_WHACKED或任何有关权限更改的资料,因此您在这里实际上无能为力.使checkSelfPermission()调用与调用受保护的API尽可能接近,将有助于减少您有可能被撤回许可的风险.

Since there is no documented setOnPermissionChangeListener() or ACTION_DUDE_YOUR_PERMS_WUZ_WHACKED or anything to find out about the permission change, there is not a lot you can really do here. Having checkSelfPermission() calls as close as possible to calling the protected APIs will help reduce the window of time where you are at risk of a permission being revoked behind your back.

这篇关于在按“重置应用程序首选项"后,我的应用程序的所有权限都将被撤消.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆