Skip to content
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

[BUG] Assets list is not updated when set to limited access on android though settings, after pressing continue with limited access and selecting some files. #1215

Closed
arthurpuha opened this issue Oct 25, 2024 · 15 comments · Fixed by fluttercandies/flutter_wechat_assets_picker#656

Comments

@arthurpuha
Copy link

arthurpuha commented Oct 25, 2024

Assets list is not updated when set to limited access on android though settings, after pressing continue with limited access and selecting some files.

How to reproduce
1.Set permission to limited access in phone settings on android.
2. Open gallery picker.
3. Proceed with limited access on the info screen.
4. On screen with empty list press top button.
5. Select some photos for limited access.
6. Previous page with empty list is not updated with selected photos.

Expected behavior
When we selected some assets for limited access those are displayed in the list.

Version information

  • Device: Android
  • OS: 14
  • Package Version: [9.2.2]
  • Flutter Version: [3.19.6]
@AlexV525
Copy link
Member

How did you get a limited permission on Android 13?

@arthurpuha
Copy link
Author

How did you get a limited permission on Android 13?

Oh, my bad, it was Android 14

@AlexV525
Copy link
Member

Please use the unmodifed example to reproduce the issue and provide a screen recording.

@arthurpuha
Copy link
Author

Please use the unmodifed example to reproduce the issue and provide a screen recording.

limited_access_bug.webm

@AlexV525
Copy link
Member

What device is it?

@arthurpuha
Copy link
Author

What device is it?

it is pixel 7 pro emulator

@arthurpuha
Copy link
Author

arthurpuha commented Oct 28, 2024

but it has same behaviour with Android 14 on other phones

@AlexV525
Copy link
Member

How did you get an empty list from the start with the Pixel emulator?

This is what I've got:

2024-10-29.13.47.55.mp4

@arthurpuha
Copy link
Author

arthurpuha commented Oct 29, 2024

How did you get an empty list from the start with the Pixel emulator?

This is what I've got:

2024-10-29.13.47.55.mp4

Go to the settings change there to deny - and change to limited again.

@AlexV525
Copy link
Member

Can you take a complete screen recording starting from installing the example? I can't follow your steps on my emulator.

@arthurpuha
Copy link
Author

Can you take a complete screen recording starting from installing the example? I can't follow your steps on my emulator.

vid.mp4

@AlexV525
Copy link
Member

Woah, something happened at 0:50, it just jumps right in without animations? Did you make any edits? 🤔

@arthurpuha
Copy link
Author

Woah, something happened at 0:50, it just jumps right in without animations? Did you make any edits? 🤔

No, I load the app and press on common picker button.

@AlexV525
Copy link
Member

I can see the same behavior by following your screen recording. Thanks!

The debug log tells that the limited permission is granted without asking.

I/PhotoManager( 5377): Returned permissions: android.permission.READ_MEDIA_VISUAL_USER_SELECTED
I/PhotoManager( 5377): Returned permissions: android.permission.READ_MEDIA_VIDEO
I/PhotoManager( 5377): Returned permissions: android.permission.READ_MEDIA_IMAGES
D/PhotoManager( 5377): dealResult: 
D/PhotoManager( 5377):   permissions: [Ljava.lang.String;@8adcaca
D/PhotoManager( 5377):   grantResults: [I@805143b
D/PhotoManager( 5377):   deniedPermissionsList: [android.permission.READ_MEDIA_VIDEO, android.permission.READ_MEDIA_IMAGES]
D/PhotoManager( 5377):   grantedPermissionsList: [android.permission.READ_MEDIA_VISUAL_USER_SELECTED]
D/PhotoManager( 5377): [PermissionDelegate34] havePermissions: [android.permission.READ_MEDIA_VIDEO], result: false
D/PhotoManager( 5377): [PermissionDelegate34] havePermissions: [android.permission.READ_MEDIA_IMAGES], result: false

From the first look this might be a bug with Android 14 permissions.

@AlexV525
Copy link
Member

Debugged around the permission delegate, in this case, READ_MEDIA_VISUAL_USER_SELECTED did return as granted from the application context, so there is a little bug with the permission in the Android. However, I've managed to find a workaround for the picker to get rid of permissions in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants