From 5e5aa0d6f2dd8e01ec1ed41eb13a560c890efe06 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Sun, 22 Jun 2025 11:39:46 +0530 Subject: [PATCH] fix: always add read URI grant flags See: https://github.com/FossifyOrg/Gallery/issues/525 --- .../src/main/kotlin/org/fossify/commons/extensions/Activity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt b/commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt index d8597654d..4d628ceec 100644 --- a/commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt +++ b/commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt @@ -556,8 +556,9 @@ fun Activity.openEditorIntent(path: String, forceChooser: Boolean, applicationId Intent().apply { action = Intent.ACTION_EDIT setDataAndType(newUri, getUriMimeType(path, newUri)) + addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) if (!isRPlus() || (isRPlus() && (hasProperStoredDocumentUriSdk30(path) || Environment.isExternalStorageManager()))) { - addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION) + addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION) } val parent = path.getParentPath()