You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f9b3954
Browse filesBrowse the repository at this point in the historyBrowse files
[image_picker] Fix android-16 not picking up file (#11320)
## Description
Fixes an issue where `image_picker` returns a null file after selecting an image from the gallery on Android 16+, caused by incorrect handling of content URIs in the Android implementation.
## Changes
- Updated `ImagePickerUtils.java` to handle Android 16+ behavior correctly
- Fixed file picking logic
## Tests
- Added unit tests for `effectiveUsePhotoPicker` to verify behavior on Android 16 (API 36)
- Ensured correct behavior across API levels
## Issue
Fixesflutter/flutter#182071Fixesflutter/flutter#184826
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Copy file name to clipboardExpand all lines: packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerDelegate.java
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -306,7 +306,7 @@ public void chooseMediaFromGallery(
Copy file name to clipboardExpand all lines: packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerUtils.java
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@
15
15
importjava.util.Arrays;
16
16
17
17
finalclassImagePickerUtils {
18
+
privatestaticfinalintAPI_LEVEL_36 = 36;
19
+
18
20
/** returns true, if permission present in manifest, otherwise false */
0 commit comments