All the permissions of my app are revoked after pressing “Reset app preferences”

时间秒杀一切 提交于 2019-12-10 14:42:28

问题


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.

How should I handle this case?

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/33896601/all-the-permissions-of-my-app-are-revoked-after-pressing-reset-app-preferences

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!