This repository was archived by the owner on Oct 16, 2025. It is now read-only.
feat: Add support for Android 14 granular media permissions #458
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.
🚀 Android 14 (API 34) Granular Media Permissions Support
📋 Summary
This PR adds full support for Android 14's new granular media permissions, resolving runtime permission failures and providing an excellent user experience with the new permission model.
🐛 Problem Solved
Issue: Users on Android 14 experience runtime permission failures where the image picker cannot access photos, even when permissions appear to be granted.
Root Cause: Android 14 introduced granular media permissions where users can choose between:
READ_MEDIA_VISUAL_USER_SELECTED(partial access)READ_MEDIA_IMAGES+READ_MEDIA_VIDEO(full access)The library was only checking for full access permissions, causing failures when users chose partial access.
✨ What's New
🔐 Smart Permission Handling
🎛️ Developer-Friendly Configuration
📱 Enhanced User Experience
🔧 Technical Changes
New Files Added
MediaPermissionHelper.kt- Centralized permission logic and state detectionGranularPermissionConfig.kt- Configuration class for permission behaviordocs/android_14_migration.md- Comprehensive migration guideFiles Modified
AndroidManifest.xml- AddedREAD_MEDIA_VISUAL_USER_SELECTEDpermissionImagePickerFragment.kt- Enhanced with granular permission logicDefaultImageFileLoader.kt- Added partial access supportImagePickerConfig.kt- New configuration options and extension functionsstrings.xml- New permission-related messagesMainActivity.kt(sample) - Updated with Android 14 examplesREADME.md- Added Android 14 informationCHANGELOG.md- Documented new featuresKey Technical Features
FULL_ACCESS,PARTIAL_ACCESS,NO_ACCESS, andLEGACY_ACCESSstates🧪 Testing
Tested Scenarios
Test Commands
📖 Documentation
New Documentation
Updated Documentation
🔄 Backward Compatibility
100% Backward Compatible - No breaking changes:
🎯 Migration Path
For Existing Users (Zero Changes Required)
For New Android 14 Features (Optional)
📊 Impact
Before This PR
After This PR
🚀 Benefits
📝 Checklist
🔗 Related Issues
Fixes runtime permission failures on Android 14 devices where users experience image loading issues despite granting permissions.
This PR ensures your Android image picker library provides an excellent experience on Android 14 while maintaining full compatibility with existing implementations.