Skip to content

Hack week: Update target SKD to 33#63

Merged
irfano merged 35 commits intotrunkfrom
hackweek/update-target-sdk-33
Apr 11, 2023
Merged

Hack week: Update target SKD to 33#63
irfano merged 35 commits intotrunkfrom
hackweek/update-target-sdk-33

Conversation

@0nko
Copy link
Copy Markdown
Contributor

@0nko 0nko commented Mar 12, 2023

This PR updates the target SDK to version 33 and implements the new granular media access permissions (images, video, audio), described in the documentation.

On devices running older Android versions (< API 33), the original single Storage permission is requested, which gives access to all media. On versions 33 and up, new granular permissions are requested (images and video are requested in a single permission request, audio in another one).

Old version New version
image image

To test:

To test this PR, please prepare 2 devices/emulators with Android 33 and <33. Also make sure the devices have at least one image to display something (you can take a picture in the Camera app).

API 33:

  1. Start with a clean installation of the sample app
  2. Tap on the Local Device Picker button
  3. Tap on the Allow button
  4. Notice a permission request for music and audio appears
  5. Grant the access
  6. Notice another permission request appears, now for photos and videos
  7. Grant the access
  8. Notice the images stored on a device are listed
  9. If you clear the app storage and try this again but deny the permissions (twice), you'll see the screen show on the screenshot above

API <33:

  1. Repeat the same steps as for API 33
  2. When you tap on the Allow button, you'll get a single permission request mentioning photos, media and files
  3. If you deny the permission, you'll see the screen above

@0nko 0nko added the enhancement New feature or request label Mar 28, 2023
@0nko 0nko marked this pull request as ready for review March 28, 2023 20:36
@0nko 0nko requested review from AjeshRPai and irfano March 28, 2023 20:42
Copy link
Copy Markdown
Member

@irfano irfano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments and questions, and I haven't approved the PR yet in case you want to make changes.

@0nko
Copy link
Copy Markdown
Contributor Author

0nko commented Apr 3, 2023

@irfano Thanks for your patience. I went back and streamlined the way permissions are being requested and ended up refactoring and removing some redundant code. Ready for another round.

@0nko 0nko requested a review from irfano April 3, 2023 23:16
Copy link
Copy Markdown
Member

@irfano irfano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the new commits in response to my comment. I have reviewed all of them, and they have resolved my concerns.
I have added some further comments and questions for your attention.

@0nko 0nko requested a review from irfano April 5, 2023 12:31
@0nko
Copy link
Copy Markdown
Contributor Author

0nko commented Apr 6, 2023

Hey @irfano, I've addressed your comments and the PR's ready for a review.

@irfano irfano self-assigned this Apr 11, 2023
Copy link
Copy Markdown
Member

@irfano irfano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all of your work and your patience with my review. 😁
I tested different MediaPickerSetups (only IMAGES and EVERYTHING), and both worked great. LGTM! 👍🏻

@irfano irfano merged commit 0ccb8ab into trunk Apr 11, 2023
@irfano irfano deleted the hackweek/update-target-sdk-33 branch April 11, 2023 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants