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

feat(android)!: remove unnecessary permissions #308

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

breautek
Copy link
Contributor

@breautek breautek commented Dec 25, 2024

Platforms affected

Android

Motivation and Context

This PR depends on #307

fixes #289

With the removal of Media Store queries, we do not need the READ/WRITE external storage permissions.

Description

Removed several methods for managing permissions as they were not necessary. KEPT camera permission handling for that fringe case where it is required if it is declared in the manifest.

Added GRANT WRITE flag to Video/Image intents, as that is necessary to give the third-party application write access to the specified directory (as provided by our File Provider). Audio must be handled differently.

The RECORD_SOUND_ACTION intent does not make use of the EXTRA_OUTPUT parameter therefore we cannot instruct the third-party application to write to a location of our choice. Instead they will always write to external storage. For consistency however, we will copy the file to the cache directory.

Testing

Ran Paramedic tests.
Manual tests with and without the CAMERA permission declared on API 28 & 29.

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

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.

  • Consolidated a comment line.
  • Syntax changes to match other part of the code... Unless you planning to reformat the entire code later to break on }.

Other then that its OK.

src/android/Capture.java Show resolved Hide resolved
src/android/Capture.java Outdated Show resolved Hide resolved
src/android/Capture.java Outdated Show resolved Hide resolved
src/android/Capture.java Outdated Show resolved Hide resolved
@erisu erisu changed the title Remove unnecessary permissions feat(android): remove unnecessary permissions Dec 27, 2024
@erisu erisu changed the title feat(android): remove unnecessary permissions feat(android)!: remove unnecessary permissions Dec 27, 2024
@erisu
Copy link
Member

erisu commented Dec 27, 2024

When squash merging, make sure the commit title contains the updated feat(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 d5ba992 into apache:master Dec 28, 2024
13 of 15 checks passed
@breautek breautek deleted the remove-perms branch December 28, 2024 19:27
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.

Cant get access to media file
2 participants