Use Android Photo Picker for external media selection - #2010
Open
cryptochrome wants to merge 1 commit into
Open
Conversation
cryptochrome
marked this pull request as ready for review
August 6, 2026 09:18
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.
Summary
MediaStore.ACTION_PICK_IMAGESflow for single external image/video selection on Android 13 and newerACTION_OPEN_DOCUMENTwith image/video MIME filters on older devices or when the system Photo Picker cannot be resolvedWhy
The external media action currently combines
ACTION_PICKfor images withACTION_GET_CONTENTfor videos. Because these are implicit intents, device manufacturers can resolve them to different apps; on Samsung devices this can open Samsung Gallery instead of Android's privacy-preserving Photo Picker and omit configured cloud media providers.ACTION_PICK_IMAGESis the platform-recommended image/video selection action on supported Android versions. Picker URIs do not expose a normal filesystem path, so the result handling also needs to use the returned MIME type and copy video content when necessary.User impact
On supported devices, Telegram's external media action opens the Android Photo Picker consistently and can expose the user's configured cloud media provider. Older devices retain a system picker fallback without requiring a new dependency.
Validation
git diff --checkpassesphoto pickerandACTION_PICK_IMAGES; no duplicate implementation was found