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
refactor(android): Ti.Filesystem external storage handling #12253
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes TIMOB-28231
Fixes TIMOB-28230
Fixes TIMOB-28182
|
garymathews
approved these changes
Nov 10, 2020
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.
CR: PASS
FR Passed. |
garymathews
added a commit
to garymathews/titanium_mobile
that referenced
this pull request
Nov 16, 2020
* feat(android): change externalStorageDirectory to use scoped storage Fixes TIMOB-28231 * feat(android): add Ti.Filesystem.externalCacheDirectory property Fixes TIMOB-28230 * test(android): add external storage read/write tests * refactor(android): only add storage permissions when needed Fixes TIMOB-28182 * chore(android): update code comments for TIMOB-28231 Co-authored-by: Gary Mathews <contact@garymathews.com> Co-authored-by: Lokesh Choudhary <lchoudhary@axway.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Summary:
Ti.Filesystem.externalStorageDirectory
to use scoped storage.WRITE_EXTERNAL_STORAGE
permission.Ti.Filesystem.externalCacheDirectory
.WRITE_EXTERNAL_STORAGE
permission when needed.Ti.Fileystem.requestStoragePermission()
,Ti.Media.showCamera()
,Ti.Media.saveToPhotoGallery()
.TiMockFile
Java class for handling inaccessible/invalid file URLs.Ti.Filesystem.getFile()
no longer returnsnull
and instead returns a file object which no-ops.API Test:
FileExternalTest.js
attached to TIMOB-28231 on Android.External Storage File
Write Time: <CurrentTime>
External Cache File
Write Time: <CurrentTime>
Setting -> Apps -> App Info -> [AppName] -> Storage
Clear Cacher
button.External Storage File
Write Time: <CurrentTime>
General Permission Test:
FileExternalTest.js
attached to TIMOB-28231 for Android../build/android/app/intermediates/merged_manifests/debug/AndroidManifest.xml
WRITE_EXTERNAL_STORAGE
permission.requestStoragePermissions() Test:
RequestStoragePermissionsTest.js
attached to TIMOB-28182 on Android.true
../build/android/app/intermediates/merged_manifests/debug/AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
saveToPhotoGallery() Test:
ImageToGalleryTest.js
attached to TIMOB-28182 on Android 10 or 11../build/android/app/intermediates/merged_manifests/debug/AndroidManifest.xml
maxSdkVersion
part.)<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
showCamera() Test:
CameraPhotoExternalTest.js
attached to TIMOB-28182 on Android 10 or 11.