Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android!: allow read-write to app dirs in media dirs and on external sdcards too #597

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ath0mas
Copy link

@ath0mas ath0mas commented Aug 24, 2023

Platforms affected

Android

Motivation and Context

Reading and writing to app dirs onto external SD cards works fine without any permission.
Same was done for external media directories, on primary non-removable storage, and others on removable ones.

Description

Reading and writing to app dirs onto external SD cards is currently asking for permissions, *_EXTERNAL_STORAGE or more recently READ_MEDIA_*.
The SDK 33 permission change made me look more into this, as asking for MEDIA related permissions seems strange.
With this PR, app dirs on external SD cards are excluded from this requirement ; even if browsing among directories, some of which are still outside of the allowed list, continue to ask for sort of unrelated permissions most of the time I think. While it may indeed be useful if the target files really are "media".

Testing

Built a testApp with targetSDK 33, installed on emulators API 28, 29, 30, 32, and 33,
Then I checked both READ and WRITE inside app dirs of internal, external, and external sd cards storage paths: operations run fine, and without asking for any permission.
Similar operations but for files outside of the allowed list still require permissions.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@ath0mas ath0mas changed the title feat(android): allow read-write to app dirs on external sdcards too Android!! allow read-write to app dirs in media dirs and on external sdcards too Aug 31, 2023
@ath0mas ath0mas changed the title Android!! allow read-write to app dirs in media dirs and on external sdcards too Android!: allow read-write to app dirs in media dirs and on external sdcards too Aug 31, 2023
@ath0mas ath0mas force-pushed the allowed-app-dirs-external-sdcards branch from 28245e9 to 5731347 Compare August 31, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant