-
Notifications
You must be signed in to change notification settings - Fork 840
Refactor: Simplify MIME type handling in file explorer intent #1910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vicajilau
merged 7 commits into
miguelpruivo:master
from
daniJimen:feature/fix_select_files_mymetype
Nov 21, 2025
Merged
Refactor: Simplify MIME type handling in file explorer intent #1910
vicajilau
merged 7 commits into
miguelpruivo:master
from
daniJimen:feature/fix_select_files_mymetype
Nov 21, 2025
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
This commit refactors the logic for setting MIME types in the `ACTION_OPEN_DOCUMENT` intent. Previously, `Intent.ACTION_PICK` was used for specific image types. This has been removed in favor of consistently using `ACTION_OPEN_DOCUMENT`. The handling of `EXTRA_MIME_TYPES` has been simplified: - If `allowedExtensions` is provided, it's used as the value for `EXTRA_MIME_TYPES`. - If `allowedExtensions` is null or empty, the primary `type` is used instead.
…ile picking This change modifies the `startFileExplorer` function to use `Intent.ACTION_GET_CONTENT` instead of `Intent.ACTION_OPEN_DOCUMENT`. This resolves an issue where `ACTION_OPEN_DOCUMENT`, combined with `Intent.CATEGORY_OPENABLE`, could lead to hangs or crashes when picking files from certain providers like Google Drive, OneDrive, or Dropbox, especially when the files are not available locally on the device. `ACTION_GET_CONTENT` is more suitable for importing a copy of the data.
navaronbracke
requested changes
Nov 13, 2025
Collaborator
navaronbracke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also going to need a patch version bump and a changelog entry.
android/src/main/kotlin/com/mr/flutter/plugin/filepicker/FileUtils.kt
Outdated
Show resolved
Hide resolved
android/src/main/kotlin/com/mr/flutter/plugin/filepicker/FileUtils.kt
Outdated
Show resolved
Hide resolved
…tils.kt Co-authored-by: Navaron Bracke <[email protected]>
…tils.kt Co-authored-by: Navaron Bracke <[email protected]>
This commit fixes an issue where file type filtering was not being applied correctly. Now, only files that match the selected MIME types are displayed. Updates the package version to 10.3.7 and adds the change to the `CHANGELOG.md`.
…e' into feature/fix_select_files_mymetype
navaronbracke
approved these changes
Nov 14, 2025
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.
This commit refactors the logic for setting MIME types in the
ACTION_OPEN_DOCUMENTintent.Previously,
Intent.ACTION_PICKwas used for specific image types. This has been removed in favor of consistently usingACTION_OPEN_DOCUMENT.The handling of
EXTRA_MIME_TYPEShas been simplified:allowedExtensionsis provided, it's used as the value forEXTRA_MIME_TYPES.allowedExtensionsis null or empty, the primarytypeis used instead.issue: Android Replaced ACTION_OPEN_DOCUMENT with ACTION_GET_CONTENT #1906