Fix Android 14+ visual media permission short-circuit in PermissionDelegate34 - #1389
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/fluttercandies/flutter_photo_manager/sessions/12f18d5a-fb95-4999-8359-bebb4959cfc3 Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix PermissionDelegate34 short-circuits requestPermission with READ_MEDIA_IMAGES
Fix Android 14+ visual media permission short-circuit in May 14, 2026
PermissionDelegate34
There was a problem hiding this comment.
Pull request overview
Fixes Android 14+ visual media permission evaluation in the Android permission delegate so combined image+video requests don’t incorrectly short-circuit as “authorized” when only a subset of permissions is granted. This aligns permission checks with expected asset query behavior (avoids videos being missing after an “authorized” result).
Changes:
- Tighten
PermissionDelegate34.havePermissions(...)by requiring all requested full-access visual permissions (unless limited visual access is granted). - Add Android unit tests covering combined vs image-only visual permission combinations.
- Add an Unreleased changelog entry documenting the Android 14+ permission short-circuit fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| CHANGELOG.md | Adds Unreleased release note for the Android 14+ permission evaluation fix. |
| android/src/test/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34Test.kt | Adds unit tests validating the visual permission combination logic. |
| android/src/main/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34.kt | Fixes visual permission short-circuiting by centralizing the logic in hasRequestedVisualPermissions(...). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Android 14+,
requestPermissionExtend()could report authorized access forRequestType.commonafter onlyREAD_MEDIA_IMAGEShad been granted, which preventedREAD_MEDIA_VIDEOfrom being requested and left videos missing from asset queries.Permission evaluation
PermissionDelegate34.havePermissions(...)for visual media requests.READ_MEDIA_VISUAL_USER_SELECTEDis already granted.Regression coverage
Release notes