Android 11 "All files access" for the Syncthing App

To answer it from my experience:

It’s the Android framework which reads the targetSdk and then decides which policies apply. Bumping targetSdk from 9 to 10 you’re right. I expect it to apply scoped storage restrictions and making the app unusable. We would then need to opt out of scoped storage to make it work again.

My problem where I last stopped researching is how I could build the app with Android <=9 + 11 and also 10 support. From trying it out I expect <=9 + 11 to behave okay with the existing code and manifest with the plus that 11 gets all files access. Android 10 is a problem I didn’t resolve yet because I need to opt out of scoped storage. See my table:

  • Android <= 9: requires EXTERNAL_WRITE_PERMISSION + SAF, behave neutral to scoped storage opt/in or opt/out.
  • Android 10: We need to opt out of scoped storage (which could be punished by GPlay Store but currently isn’t) and use SAF.
  • Android 11: We need to opt in scoped storage and on top request all files access (see link above on scoped storage and all files access, it’s also mentioned there). ToDo as I expect it is reworking the SAF code in the app where incompatible with the scopes. Then find a way how this still works on Android 10 where all files access doesn’t exist. I somehow fear we’d have to build two apps with just one difference in the manifest which I hope doesn’t come true. That’s why I stopped my first draft of the Android 11 app waiting for the final beta to come up and then retrying things with hands on.

I’m not expecting too much from reading the docs because Google often “last minute” changes API’s to behave and their restrictions before the final version appears in the release channel. It was e.g. the case when I early adopted the “Access location everytime” API in the fork, tested and then it didn’t work in the Android 10 final and still had to be reworked. I’ll post documentation links when I’m working on this next time and find something useful. You’ll also find useful code and manifest info on my fork draft PR. When I feel like being ready for Android 11, I’ll likely file a “minimal” PR upstream to help the app, so no worries.

4 Likes