breaking(android): stop using CordovaUri helper class #617
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.
Platforms affected
android
Motivation and Context
At the moment the plugin tries to guess (in a dirty way) the image path from the content url, but that's not really necessary since we know the path beforehand, and doesn't work at the moment since the path was changed in a previous PR causing #597
Description
probably breaking change since CordovaUri class says it's for Android 4.4.4 and lower support, but since cordova-android 9 won't support versions older than 5.1, I think we can remove the class and we also need to update the plugin to use Android X, which will require cordova-android 9.
What the PR does is to store the file path in a variable and use that variable to send the camera result instead of trying to guess the image path from the returned result from the camera intent, which was a dirty way of getting it (according to the method description) and which doesn't work since this was merged.
For that, it removes CordovaUri.java class and it's usages.
Saves image paths in a variable to return.
Changes the file_provider to use
cache_files
as the mentioned commit stores the images there.Removes code used for Android 4.4 and older.
fixes #597
Testing
Tested on Android 5 and Android 9 devices with this code
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)