bug: Fix Android 14+ media access so new videos appear in library#1595
Open
AndyWangLYN wants to merge 1 commit intoanilbeesetti:mainfrom
Open
bug: Fix Android 14+ media access so new videos appear in library#1595AndyWangLYN wants to merge 1 commit intoanilbeesetti:mainfrom
AndyWangLYN wants to merge 1 commit intoanilbeesetti:mainfrom
Conversation
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.
Issue
Newly added videos were not appearing in the media library for some users (notably Android 14+/16 devices), even after refresh/reinstall. As mentioend in: #1592
Root Cause
The app treated READ_MEDIA_VIDEO as the only runtime storage permission state.
On Android 14+, users can grant limited media access (READ_MEDIA_VISUAL_USER_SELECTED), which allows only selected files.
The app did not detect this limited-access mode, so newly added videos outside the selected set were not visible.
Media sync also applied a strict file-path existence filter, which could drop valid MediaStore rows under newer scoped-storage/OEM behavior.
Fix
Added Android 14+ permission support for limited/full media access:
Request/check both READ_MEDIA_VIDEO and READ_MEDIA_VISUAL_USER_SELECTED.
Detect and separate full access vs limited access.
Start sync only when full access is available.
Show a dedicated limited-access prompt so users can grant full access for complete library visibility.
Updated manifest:
Added android.permission.READ_MEDIA_VISUAL_USER_SELECTED.
Hardened media sync ingestion:
Ignore rows with missing/null DATA.
Removed strict File.exists() filtering so valid indexed items are not incorrectly dropped.
Testing Done:
Unit tests for permission resolution and full-vs-limited access detection logic.