breautek opened a new pull request #487:
URL: https://github.com/apache/cordova-plugin-file/pull/487


   <!--
   Please make sure the checklist boxes are all checked before submitting the 
PR. The checklist is intended as a quick reference, for complete details please 
see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   Android
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   Progresses https://github.com/apache/cordova-plugin-file/issues/426 but 
unsure if it completely resolves it
   
   ### Description
   <!-- Describe your changes in detail -->
   
   Code changes includes checking to see the file path on reading directory 
listings (for listing directories and files) and if the file path happens to be 
an "external" file path, then assert/request READ_EXTERNAL_STORAGE permission.
   
   There have been a couple of documentation changes as well, including the 
fact that some directories that were previously writable in earlier API 
versions are no longer writable starting in API 30.
   
   `requestLegacyExternalStorage` flag is removed because that was an API 29 
only flag. This flag is not honoured on API 30 and is forcefully false.
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   Npm test and manual testing using a test app: 
https://github.com/breautek/cordova-file-api30-test-app
   
   I'm not sure if my test app is an exhaustive list, but the basic directory 
listing, reading and writing all appear to work properly assuming the app has 
the READ/WRITE_EXTERNAL_STORAGE permission granted.
   
   CDVFILE urls however don't quite work as expected and is not covered in this 
PR. If a cdvfile url leads to an external directory source and the app does not 
have the proper permissions, the webview does not wait for the permission 
response and the request will fail. From what I can tell, cdvfile-based urls do 
work if the app already has the permission granted.
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [x] I added automated test coverage as appropriate for this change
   - [x] Commit is prefixed with `(platform)` if this change only applies to 
one platform (e.g. `(android)`)
   - [x] 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](https://help.github.com/articles/closing-issues-using-keywords/))
   - [x] I've updated the documentation if necessary
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to