Skip to content
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): remove usage of Media Store queries #307

Merged
merged 1 commit into from
Dec 28, 2024

Conversation

breautek
Copy link
Contributor

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

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek added this to the 6.0.0 milestone Dec 25, 2024
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The only thing I noticed is that you left the method whichContentStore after deleting its only reference. However, I see that you removed it in a later PR, so I assume it's fine.

@erisu erisu changed the title fix: Remove usage of Media Store queries fix(android): remove usage of Media Store queries Dec 27, 2024
@erisu
Copy link
Member

erisu commented Dec 27, 2024

When squash merging, make sure the commit title contains the updated fix(android):

I noticed the current commit title missing the platform as checklist requested:

Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))

@breautek breautek merged commit 38a8cca into apache:master Dec 28, 2024
13 of 15 checks passed
@breautek breautek deleted the remove/query-img branch December 28, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants