refactor(android): remove query img usage #907
Merged
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.
Will rebase after #906 & #902 is merged.
Platforms affected
Android
Motivation and Context
fixes #891
closes #725
closes #660
This code existed since the beginning of time and it does not appear to be relevant anymore.
Duplicates does not occur, even with using DATA_URL or creating modifications via scaling.
Additionally querying the media store on API 28 and lower requires broad
READ_EXTERNAL_STORAGE
permission. If we can removenumpics
and the usage ofqueryImgDb
then we can makeREAD/WRITE_EXTERNAL_STORAGE
optional.With this change, on API 29+ no permissions are necessary to use the plugin, except for
CAMERA
if it's declared (that workaround is still necessary).On API 28 and lower,
WRITE_EXTERNAL_PERMISSION
is optional, but will be required ifsaveToPhotoAlbum
option is enabled, which is a change I plan to make in another PR soon.Additionally, the way it was detecting and attempting to remove duplicate images is dangerous, as media store objects can be inserted at any time by other applications. There is no guarantee that the image selected as the duplicate was actually the duplicate, or if there was a duplicate to begin with.
Description
Removed
numpics
and all code related to managingnumpics
Testing
Manual test on API 24
Paramedic test passes
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)