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
Use Storage Access Framework in demo app to access local files. #6045
Labels
Comments
This comment has been minimized.
This comment has been minimized.
This would be very helpful for verifying the correctness of exoplayer implementations in apps. For example, I am seeing decoding weirdness and it would be nice if I could quickly verify the behaviour between the demo app and my implementation. |
icbaker
pushed a commit
that referenced
this issue
Jul 21, 2023
The main demo app was still targeting API 29 to avoid scoped storage restrictions. It is now updated to 34 (like the rest of the demo apps) and handles scoped storage as it should handle it. More specifically: - We need to request READ_MEDIA_... permissions instead of READ_EXTERNAL_STORAGE from API33. - The legacy scoped storage opt-out can be removed - READ_MEDIA_... permissions don't allow arbitrary file access if the file doesn't end in a typical media file extension, so this change adds a remark on the guide page to place samples in the app-specific directory. - We also don't have to request permissions for the app-specific directories. - Custom json files can't be placed in arbitray local locations because they don't end in a media file extension, as there is no way we can request a permission to load them. This means we can remove the storage request logic in SampleChooserActivity. Issue: #6045 PiperOrigin-RevId: 549252474
icbaker
pushed a commit
to androidx/media
that referenced
this issue
Jul 21, 2023
The main demo app was still targeting API 29 to avoid scoped storage restrictions. It is now updated to 34 (like the rest of the demo apps) and handles scoped storage as it should handle it. More specifically: - We need to request READ_MEDIA_... permissions instead of READ_EXTERNAL_STORAGE from API33. - The legacy scoped storage opt-out can be removed - READ_MEDIA_... permissions don't allow arbitrary file access if the file doesn't end in a typical media file extension, so this change adds a remark on the guide page to place samples in the app-specific directory. - We also don't have to request permissions for the app-specific directories. - Custom json files can't be placed in arbitray local locations because they don't end in a media file extension, as there is no way we can request a permission to load them. This means we can remove the storage request logic in SampleChooserActivity. Issue: google/ExoPlayer#6045 PiperOrigin-RevId: 549252474
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use case description
Starting with Android Q, access to random local files is forbidden unless the Storage Access Framework is used (see e.g. #6039). To simplify debugging of local files with our demo app, we should add an option to open a file this way. On the other hand, we no longer need to request permission to read files.
See https://developer.android.com/preview/privacy/scoped-storage and https://developer.android.com/guide/topics/providers/document-provider
The text was updated successfully, but these errors were encountered: