From b99a54afbb8e8c80224de182e9bb734e78b14920 Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Fri, 3 Jul 2026 16:35:22 -0400 Subject: [PATCH 1/3] fix: explicitly grant read URI permission for camera capture intents Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE intents. openDeviceCamera and createCameraIntent already granted write permission for the FileProvider output URI but not read, which the camera app also needs. RMET-5241 --- .../io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt b/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt index 37ac171..56b41ba 100644 --- a/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt +++ b/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt @@ -29,7 +29,7 @@ class IONCAMRMediaHelper : IONCAMRMediaHelperInterface { if (activity != null && imageUri != null) { val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri) - intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION) + intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION) val mPm: PackageManager = activity.packageManager if (intent.resolveActivity(mPm) != null) { activity.startActivityForResult( @@ -50,7 +50,7 @@ class IONCAMRMediaHelper : IONCAMRMediaHelperInterface { val safeUri = imageUri ?: return null val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri) - intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION) + intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION) return if (intent.resolveActivity(safeActivity.packageManager) != null) { intent From bc843228188112332316f6b86bebe6df6f63db17 Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Tue, 7 Jul 2026 10:30:27 -0400 Subject: [PATCH 2/3] chore: bump version to 1.0.2 RMET-5241 --- CHANGELOG.md | 6 ++++++ pom.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5a593b..476632e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 The changes documented here do not include those from the original repository. +## [1.0.2] + +### 2026-07-07 + +- Fix: explicitly grant `FLAG_GRANT_READ_URI_PERMISSION` (in addition to the existing write permission) when launching camera capture intents, required for Android 18's implicit URI grant restriction ([RMET-5241](https://outsystemsrd.atlassian.net/browse/RMET-5241)). + ## [1.0.1] ### 2026-04-27 diff --git a/pom.xml b/pom.xml index e489da6..99f0ccf 100644 --- a/pom.xml +++ b/pom.xml @@ -6,5 +6,5 @@ 4.0.0 io.ionic.libs ioncamera-android - 1.0.1 + 1.0.2 From 762e783de083bc43d441ff03db80d3fddc958ffb Mon Sep 17 00:00:00 2001 From: "Alex J." Date: Wed, 8 Jul 2026 08:36:39 -0400 Subject: [PATCH 3/3] Apply suggestion from @OS-pedrogustavobilro Co-authored-by: Pedro Bilro --- .../io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt b/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt index 56b41ba..d9b2143 100644 --- a/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt +++ b/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt @@ -49,7 +49,7 @@ class IONCAMRMediaHelper : IONCAMRMediaHelperInterface { val safeActivity = activity ?: return null val safeUri = imageUri ?: return null val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) - intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri) + intent.putExtra(MediaStore.EXTRA_OUTPUT, safeUri) intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION) return if (intent.resolveActivity(safeActivity.packageManager) != null) {