fix(android): remove usage of Media Store queries #307
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
Using the Media Store query API requires broad range external storage permissions on API 28 and earlier (including API 29 if legacy storage rules are used). This will be important for a future PR to remove unnecessary permissions.
Additionally, the logic of checking the number of images in the media store is flawed as external sources (outside of the application) can add or remove content at any time. There is no guarantee that checking the quantity of images will result in the intended behaviour of removing duplicate images. There is also no guarantee that the image selected is even the image that is a "duplicate".
The Camera plugin had the same logic which was removed for the same reasons.
Lastly, recent changes have changed where images are stored, which is in the app's internal directory, we no longer use the external storage paths.
Description
Removed code associated with checking the media store
Testing
Ran paramedic.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)