1

My app is using storage permission (read + write).

If I grant or reject the permission, everything works fine. But if I reject it and check the "Do not ask again" checkbox, then the app can no longer access storage, even if I go to the settings to manually grant the permission. Android correctly tells me that the permission is now granted, but when accessing the storage, I get an EACCES (Permission denied) error.

Clearing the data does not fix the bug, nor rebooting the device, not even reinstalling the app.

This means that if a user does this, the app no longer works on his device, unless he does a factory reset. Nice.

Is there anything we can do?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Tim Autin
  • 6,043
  • 5
  • 46
  • 76
  • Check it manually and show a custom dialog ok - move to app's settings cancel - just stop the operation – Alexander Nov 17 '19 at 20:22
  • Thanks but I think you didn't get the problem: even if the user goes to the settings to manually grant the permission, I can't access the storage. The permission is granted, checkSelfPermission returns true, but when trying to effectively access the storage leads to an EACCES (Permission denied) error. – Tim Autin Nov 17 '19 at 20:25
  • Did you check it? (https://stackoverflow.com/questions/30719047/android-m-check-runtime-permission-how-to-determine-if-the-user-checked-nev) – Alexander Nov 17 '19 at 20:28
  • I guess your question is duplicate [check](https://stackoverflow.com/questions/30719047/android-m-check-runtime-permission-how-to-determine-if-the-user-checked-nev) – Alexander Nov 17 '19 at 20:31
  • This is not a duplicate. Again: my problem is not to determine wether the "Do not ask again" checkbox has been checked or not, it is that once the user has checked the box and rejected the permission, he can no longer grant the permission, even when manually going to the settings. The permission seems granted, but when trying to read/write storage, it fails. – Tim Autin Nov 17 '19 at 20:59
  • Isn't that the expected behavior? Isn't the user saying, "I am not going to give permission and do not ask me again"?What am I missing? – The_Martian Nov 18 '19 at 02:49
  • @The_Martion. You missed that the app was deinstalled before. – blackapps Nov 18 '19 at 15:24
  • Your problem has been reported before by @CommonsWare. Sorry that i could not find his blog post about it. – blackapps Nov 18 '19 at 15:24

0 Answers0