Skip to content

fix(android): explicitly grant URI permissions for legacy camera capture#60

Merged
alexgerardojacinto merged 3 commits into
mainfrom
fix/RMET-5241-implicit-uri-grants
Jul 8, 2026
Merged

fix(android): explicitly grant URI permissions for legacy camera capture#60
alexgerardojacinto merged 3 commits into
mainfrom
fix/RMET-5241-implicit-uri-grants

Conversation

@alexgerardojacinto

@alexgerardojacinto alexgerardojacinto commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE intents. The deprecated LegacyCameraFlow.openCamera() sent no grant flags at all for its FileProvider output URI, unlike the edit intents elsewhere in this file which already do.

  • Add FLAG_GRANT_READ_URI_PERMISSION and FLAG_GRANT_WRITE_URI_PERMISSION to the capture intent.
  • Bump ioncamera-android to 1.0.2, which contains the equivalent fix for the non-legacy camera flow (ion-android-camera#17).

Part of RMET-5241.

Draft: ioncamera-android:1.0.2 is not yet published to Maven Central — this PR is blocked on that release landing. Do not merge until then.

Test plan

  • Manual: exercised both Camera.getPhoto() (this fix) and Camera.takePhoto() (ion-android-camera fix) via this plugin's example app, built locally against a local Maven artifact for ioncamera-android:1.0.2. Confirmed both work on Android 7 (API 25) and Android 17.

Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE
intents. The deprecated LegacyCameraFlow.openCamera() sent no grant flags
at all for its FileProvider output URI, unlike the edit intents elsewhere
in this file which already do.

RMET-5241

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FYI @alexgerardojacinto, lint is failing, probably the line added in the java file. I suppose once the native library is released one can run fmt and then push to see if CI passes.

@alexgerardojacinto
alexgerardojacinto marked this pull request as ready for review July 8, 2026 14:18
@alexgerardojacinto
alexgerardojacinto merged commit df4b6d7 into main Jul 8, 2026
8 checks passed
@alexgerardojacinto
alexgerardojacinto deleted the fix/RMET-5241-implicit-uri-grants branch July 8, 2026 14:34
capacitor-bot pushed a commit that referenced this pull request Jul 8, 2026
## [8.2.1](v8.2.0...v8.2.1) (2026-07-08)

### Bug Fixes

* **android:** explicitly grant URI permissions for legacy camera capture ([#60](#60)) ([df4b6d7](df4b6d7))
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