Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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).

like image 266
Maksim Dmitriev Avatar asked Nov 24 '15 14:11

Maksim Dmitriev


People also ask

What happen if you Reset app preferences?

Resetting your app preferences will also enable all previously disabled apps on your device. If you have any apps disabled on your phone for any reason at all, resetting the app preference will enable all of them again and you have to disable them manually again if you want them disabled.

What is revoke app permission?

Introduced in Android 11, the permission feature offers a handy option that automatically revokes permissions from an app you haven't opened in a while. This setting can't be applied globally throughout the OS, which means you will have to enable it separately for each app.


1 Answers

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.

like image 184
CommonsWare Avatar answered Sep 27 '22 17:09

CommonsWare