[TIMOB-26488] Android: Fix Ti.Filesystem.requestStoragePermissions for Android 8 and above #10442
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA: https://jira.appcelerator.org/browse/TIMOB-26488
Description:
In Android 8 Google fixed a problem where granting a
READ_EXTERNAL_STORAGE
permissions automatically granted all the permissions in the group. This PR adds theWRITE_EXTERNAL_STORAGE
permissions in therequestStoragePermissions()
method inFilesystem
module in order to not break existing apps relying on it providing write permission.No unit test for this PR.
Test case:
This fix is only required for Android 8 and above.
Make sure you have both
READ_EXTERNAL_STORAGE
andWRITE_EXTERNAL_STORAGE
declared in tiapp.xmlYou can use any image placed in the Resources folder of the application.
After receiving a
success
callback you can check the devices Gallery\Photos application for the image. It may take some time (like 10 seconds) to appear there.Before this PR you will always get the
error
callback.app.js