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

[AND-12] Improve media storage permission handling. #5518

Merged

Conversation

VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Dec 12, 2024

🎯 Goal

Linear: https://linear.app/stream/issue/AND-12/improve-storage-access-permission-behaviour-with-limited-access
Adds support for partial media access for Android 14+.
More details: https://developer.android.com/about/versions/14/changes/partial-photo-video-access

🛠 Implementation details

  • Add READ_MEDIA_VISUAL_USER_SELECTED to AndroidManifest to ensure media re-selection is properly handled on Android 14+.
  • Add granular permission handling for AttachmentsPickerImagesTabFactory based on the different android versions (12 and below, 13 and 14 and above)
  • Add new UI options in the images/videos picker to initiate media re-selection on Android 14+.
  • Add granular permission handling for AttachmentsPickerFilesTabFactory based on the different android versions (12 and below, 13 and 14 and above)
  • Add new UI options in the files picker to handle the visual media permission separately from the audio permissions + add option for media re-selection on Android 14+.

🎨 UI Changes

Note: I tried to keep the UI as similar as possible as before, but I am open for suggestions on improving it

Android 12 (single storage permission) Android 13 (separate permissions) Android 14 (separate permissions + partial access)
android-12-single-permission.mp4
android-13-separate-permissions.mp4
android-14-partial-access.mp4

🧪 Testing

  1. Open Compose sample app
  2. Open a channel
  3. Tap the attachments button
  4. Use the images/files tabs to see if the permissions are handled correctly (different behaviour for Android 12 / 13 / 14+)

@VelikovPetar VelikovPetar marked this pull request as ready for review December 12, 2024 18:27
@VelikovPetar VelikovPetar requested a review from a team as a code owner December 12, 2024 18:27
@JcMinarro JcMinarro enabled auto-merge (squash) December 13, 2024 09:32
@JcMinarro JcMinarro force-pushed the feature/improve_attachment_factories_permissions_compose branch from 688f386 to 66a8e9c Compare December 13, 2024 09:32
@JcMinarro JcMinarro merged commit 8041197 into develop Dec 13, 2024
9 checks passed
@JcMinarro JcMinarro deleted the feature/improve_attachment_factories_permissions_compose branch December 13, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants