-
Notifications
You must be signed in to change notification settings - Fork 762
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
added download path #532
base: master
Are you sure you want to change the base?
added download path #532
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR. I left some remarks and wonder what your thoughts will be.
Several JS files had some formatting changes which is breaking our lint rules. I suggest reverting these formatting changes. You can run npm test
which should run the linter locally to confirm that lint passes.
For the README
file, you've made a lot of drastic changes to the formatting, but I do like these changes. However, should we need to revert this PR in the future for whatever reason, it will cause the revert to your README improvements. I'd suggest considering pulling out the reformat and readability improvements as a separate PR, and keep the README changes here focused on the documentation additions for the downloadsDirectory
. I don't consider this a blocker though.
| `files` | dataDirectory | files | r/w | Yes | No | Yes | | ||
| `Documents` | | documents | r/w | Yes | No | Yes | | ||
| `<sdcard>/` | externalRootDirectory | sdcard | r/w\*\*\* | Yes | No | No | | ||
| `<sdcard>/` | downloadDirectory | sdcard | r/w\*\*\* | Yes | No | No | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `<sdcard>/` | downloadDirectory | sdcard | r/w\*\*\* | Yes | No | No | | |
| `<sdcard>/Downloads` | downloadDirectory | sdcard | r/w | Yes | No | No | |
I think the download directory is generally located at <sdcard>/Download
but I think this should be confirmed. Additionally, the triple star indicator is for a note on API 30 changes where the external root directory is no longer a writable path, which I don't think applies to the Downloads folder.
Suggestion is to show changes, but it will likely screw up the textual formatting of the table, so these changes might be better to be applied manually rather then accepting the suggestion commit as is.
@@ -1025,6 +1025,7 @@ private JSONObject requestAllPaths() throws JSONException { | |||
ret.put("externalDataDirectory", toDirUrl(context.getExternalFilesDir(null))); | |||
ret.put("externalCacheDirectory", toDirUrl(context.getExternalCacheDir())); | |||
ret.put("externalRootDirectory", toDirUrl(Environment.getExternalStorageDirectory())); | |||
ret.put("downloadDirectory", toDirUrl(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getExternalStoragePublicDirectory is deprecated as of API 29.
It appears Context.getExternalFilesDir is the replacement. I believe the Environment.DIRECTORY_DOWNLOADS
can be still used with getExternalFilesDir
but it would need to be confirmed.
Platforms affected
Android
Motivation and Context
From Android 10 onwards it was very difficult to download due to permissions. The downloads folder has permission to access.
Description
added download path
Testing
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)