-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(android): handle raw document identifier #11395
Conversation
|
@garymathews Does this PR supersede the community PR #11223? |
@sgtcoolguy Yep |
Can we add an Android-specific unit test for this? It's hard to trace this back to see if there's a clear cut API we can use to trigger this code path, but maybe |
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.
code change looks OK to me, but as stated in other comment - I'd really like to see if there's any way we can test this with a URL passed in to one of our APIs...
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
Although I kind of want to remove all of this custom URL handling code and handle this 100% via a ContentResolver
which is what we do at the bottom of this method. That's the way you're supposed to handle content://
URLs on Android. But this would mean re-testing all of the URLs we're custom handling just in case.
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.
FR Passed: Able to select content from downloads folder without the application crashing.
Test Steps
- Created a Titanium application with the following test case
const win = Ti.UI.createWindow({ backgroundColor: 'white' });
const img = Ti.UI.createImageView();
win.addEventListener('open', _ => {
Ti.Media.openPhotoGallery({
success (event) {
if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
img.image = event.media;
}
},
mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
})
});
win.add(img);
win.open();
- Ran the application
- Selected downloads
- Selected Image
- Image displayed without the application crashing
Test Environment
MacOS Catalina 10.15.1 beta
Xcode 11.3
Node.js 10.16.3
"NPM":"4.2.15-1","CLI":"7.1.2-7"
Pixel Xl (Android 10)
can we get this fix backported to 8_3_X ? Seems simple enough to apply on https://github.com/appcelerator/titanium_mobile/blob/e9ef3702af3f75327af9056ec0bb9a7bf209e130/android/titanium/src/java/org/appcelerator/titanium/io/TitaniumBlob.java#L89 and would allow 8.3.X to get android file delete working again... |
raw
document identifierTEST CASE
JIRA Ticket