Status Update
Comments
vi...@google.com <vi...@google.com> #2
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What is the expected output?
Current output
What is the current output?
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Note: Please upload the sample project and screenshot to google drive and share the folder to android-bugreport@google.com, then share the link here.
to...@gmail.com <to...@gmail.com> #3
This is a feature request / question. There's no sample project or anything related to your questions to give .......
vi...@google.com <vi...@google.com> #4
In Android Q with the compatibility flag it's still possible but after a reboot or a re scan some times the entries are removed" which needs to be validated and reproduced first before proceeding further.
Hence please provide the information as requested in
to...@gmail.com <to...@gmail.com> #5
Android Q won't be fixed and the compatibility flag no more exist in android R, so the issue is about how this should be handled in Android R/11.
Issue is:
For Android R there's no way to insert media with a custom data value (content provider urls) and it require us to use the slow API and put the files in a public folder.
The use case is simple I want to have the media stored inside my application to be able to do many things that won't be possible without proper file access.
But I still want to have those file exposed to other media apps via an exported content provider so that they can play the files on other media player application (with some limitations but giving more control to the users).
I have not seen anything announced for R for this need so would like to know how this should be handled.
vi...@google.com <vi...@google.com> #6
to...@gmail.com <to...@gmail.com> #7
So R preview 1 is here :) No more path as data for other apps to consume. No way to set an uri in the data path and no API to insert entries for private files.
Question being: How can application expose their private media without duplicating them in the media store proposed files. We already have content provider urls but no one to consume them as no one to see them in a generic way.
Would be nice to have an answer and not be ignored as some other major issues on Q that are still present on R.
BTW in R preview 1 you can still insert a file path in the data path, this will as in Q work until the reboot that will remove the entries from media store.
ro...@google.com <ro...@google.com> #8
You want to expose media files in your private storage so that an arbitrary app can open them with user consent.
We have 2 good ways you can do this:
Create a content provider such that apps can prompt users to choose your content via ACTION_GET_CONTENT
Create a custom document provider so your app's files are exposed in DocumentsUI (using the storage access framework) via ACTION_OPEN_DOCUMENT
I understand you'd prefer to use media store APIs, but currently these are intended to be used primarily for shared files in organized collections.
Sorry this may not be the answer you are looking for, but we will keep this feedback in mind for the future. We are eager to identify valid use cases which may be limited due to our new privacy enhancements.
to...@gmail.com <to...@gmail.com> #9
Not really I want to be able to expose the organised media from my private location to other applications to be consumed as media as it already works and worked before the "privacy" changes.
Before all I had to do was to insert in media store and fill the data field. This have worked for a very long time, and still mostly works on 10 via the legacy flag. (But they are removed from MediaStore on reboot for unknown reason).
Those are well organised music files with all meta data that any audio player should be able to play. I want to have them in my private folder, because I need to also store associated media like lrc files, m3u and other things that won't be exposed to media store.
So the media are music files, they are well organised I just don't want to store them in public place to not allow modification to them unless they copy them, and to store other things and control path and extension for downloaded playlist.
I know I can expose my media but this require users to use application that would support SAF and would be an awful experience, imagine I offer an album with 10 tracks, there's currently no proper user friendly way to do that in your new mode.
MediaStore is the place to expose those files as unified media storage, we should be able to add content to it exposing our content providers in it. (So fill data field with content:// uris).
vi...@google.com <vi...@google.com> #10
Please provide the use cases a little better to understand.
More details on how the media is supposed to be used, how it worked on P, what you have tried etc will help.
to...@gmail.com <to...@gmail.com> #11
My application is a client for multiple media centers that can connect and control many things.
Those media centers expose media (Audio files, Movies, Tv Episodes) with complete metadata along with those media there can be external files associated with them like subtitles, lyrics, ...
The applications allows users to play those media on the android device or stream them to other devices like Chromecast, Firetv, upnp, ....
The application can download those media for offline use / offline streaming too, the downloaded media also download the associated files like the subtitles. The download can occurs manually by the user, but it can also be rules like always keep X unwatched episode from Z show, automatically download new songs from Y artists, .... Those media are downloaded in private directory of the application to allow proper handling of those alternate files + ensure integrity (as similar file can be present on multiple source I do not download multiple times but match via quick file hashes) of the files and prevent accidental removal + faster streaming / downloading via multiple interleaved chunks, ....
Until P to expose those media to other application I just added them to MediaStore with all the proper meta data so they could be consumed by other applications via MediaStore, no issues here. For P I use the legacy flag and still do that so that apps with the flag or compiled for older SdK can still use them (But they are removed from MediaStore on reboot as reported and ignored on other issue). For Q there's no solution at all to expose those media.
For video files this is not a major issue, I can use standard intents and share the media via a content provider.
For audio this is a major issue as I can't do that properly for more than 1 song. Users may want to use another application to have a better equalizer or some other functions that I do not provide. Audio have relationship between songs and genre / album / artists that can't be exposed to other apps via any "normal" and common feature other than MediaStore. Yet we can't push anything to MediaStore that is not stored in public folders, but apps may need to keep control over the file to ensure integrity/ syncing and other features to provide a proper user experience.
The need is to be able to insert media in MediaStore with a contentProvider uri as the DATA field, that way everything can still work as usual for everyone without any major change to the platform and still keeps all security and everything you bring with P/Q
vi...@google.com <vi...@google.com> #12
to...@gmail.com <to...@gmail.com> #13
Why ask for use case if you do not even read them ......
Please tell me how you store a movie and 3 subtiles in mediastore and associate them so that a consumer can find them? Please tell me how you store a media without ability for user to delete from other app by mistake?
You are ignoring a complete whole tons of use case of sharing media between apps and just have 0 explanation or solution for all the needs ....
vi...@google.com <vi...@google.com> #14
=================================
"Please tell me how you store a movie and 3 subtiles in mediastore and associate them so that a consumer can find them?"
You can put them under /sdcard/Movies/. MediaStore should understand the most popular subtitles mime types and allow adding subtitles under Movies along with the movie files. If this does not work please let us know. Your app will retain ownership to these files until uninstalled
"Please tell me how you store a media without ability for user to delete from other app by mistake?"
Unfortunately there is no way to expose something to the user if you don't trust them to not delete it. The fact that this worked a certain way in P was just incidental. MediaStore should not be indexing external app data directories. On R, no apps can access external app data directories and even if MediaStore were to index them, our privacy policy won't allow MediaStore to share them with another app.
to...@gmail.com <to...@gmail.com> #15
Yes I can put files there and some sub may be added to mediastore but I can't list the folder by files so can't associate movies with their sub by filename as mediastore does not allow to link them by anything nor allow people to store arbitrary data nor allow to handle language data of the subs to display them properly.
It's same with songs and external lyrics.
And the feature request is to be able to add uri to mediastore. I expose the media via file provider anyone can read them.l as per controlling permissions. Allowing to add uri in DATA field would fix the missing pieces.
I totally understand the P Q R changes and their purpose, the feature asked would not impact this while still allowing to share private files securely with metadata.
Exposing songs to other apps via document provider is horrible user experience.
vi...@google.com <vi...@google.com> #16
===============================
You should be able to list all files in Movies that you contributed (regardless of type) and all media related files others contributed. Are you finding that this is not the case? Can you explain more?
to...@gmail.com <to...@gmail.com> #17
When dealing with other team in direct it's way more efficient :)
So let's take the video example.
The server expose:
- Sintel.mkv this media have metadata associated with it like a thumbnail and a description.
- Sintel.srt
- Sintel.en.ass
- Sintel.fr.vtt
We can not just write to /Movies to expose metadata so we have to use the only API available from MediaStore. That API does not give control over file name and locations, we can give hints and that's all. Furthermore we have no control over the extensions either. Please show me / tell me the API that I can use to ensure that either those files are written with the correct filenames and extensions, or how I can insert them in MediaStore and 1) Link them together 2) Have the language information associated with the subtitles. (And proper extension / mimetypes for subtitles including the unsupported types by OS) This is AFAIK not possible.
To try to explain again the issue about deletion of the files outside of the application being not wanted. My application support smart sync for tv shows (and for other things but let's limit to this example), so it ensure that you always have x episodes pre downloaded for offline usage and the application is aware of the offline status, so when offline can display media that are only downloaded. (Doing 1 query to media store for each media would be way to slow for display). Now the episode is stored in MediaStore with the episode name. The user have a notification about low space and is offered to make space by Android, he sees a large video and does not recognize the name as it's an unseen episode name that may be strangely named. He delete the file as he don't know what it is.
Then he take the bus, press play and the media is missing without anyway for the application to be aware of that and have downloaded it again. Leading to a very frustrated user. If the files are inside my app, the space reports shows the app as taking space, the user can go to the app and manage it's offline content.
So as I try to explain there is a need to be able to expose private content to mediastore for consumption by other. Application can share media uri via content providers and have them consumed. We just need a way to insert those content providers uri as DATA in media store to fit a large set of needs.
vi...@google.com <vi...@google.com> #18
==============================
We do not plan to offer a way to contribute files to MediaStore yet hide them from the user if they want to clean up data. These are contradictory requirements from our point of view. We think users should be trusted to know what to do with their data. If that's not true the files should be kept in Android/data.
There are a number of options where movies and associated files can be kept in Android R
add movies and subtitle files to /sdcard/Movies.
add movies and subtitle files to /sdcard/Android/media/<pkg_name>.
Both options can be done via File() api or MediaProvider API, and both options allow other apps to consume the content.
to...@gmail.com <to...@gmail.com> #19
Once again unless the docs are wrongs we can't add files to media store via the DATA field. So we do not have control over file names. Or we put raw files and can't set the metadata.
If we put the files in those folders and force a scan do we still have write permissions as owner of the files without asking for Android permission? Allowing to later update the metadata?
Will be awful to deal for music as can't prevent potential wrong data from tags but well Android is no more about users need.....
vi...@google.com <vi...@google.com> #20
==============================
We do not plan to offer a way to contribute files to MediasStore yet hide them from the user if they want to clean up data. These are contradictory requirements from our point of view. We think users should be trusted to know what to do with their data. If that's not true the files should be kept in Android/data.
There are a number of options where movies and associated files can be kept in Android R
add movies and subtitle files to /sdcard/Movies.
add movies and subtitle files to /sdcard/Android/media/<pkg_name>.
Both options can be done via File() api or MediaProvider API, and both options allow other apps to consume the content.
vi...@google.com <vi...@google.com> #21
to...@gmail.com <to...@gmail.com> #22
So still no answer about how to do things in real life?
For the record, Android 12 still does not understand vtt / ssa / ass very common subtitles file extensions / mimetype so no way to add them with a proper file extension (And obviously no way to encode the language in the file)
Reading the whole files content and trying to guess is not a proper way to handle subtitles, even ExoPlayer requires the mimetype and have no "guesser"
So how are we supposed to handle media files and their associated content like subtitles?
I suppose this will be ignored as the issue is closed but well at least I can tell all users of external subtitles files that I tried ...
Description
In Android Q with the compatibility flag it's still possible but after a reboot or a rescan some times the entries are removed.
For Android R there's no way to do that anymore it seems.
The use case is simple I want to have the media stored inside my application to be able to do many things that won't be possible without proper file access.
But I still want to have those file exposed to other media apps via an exported content provider so that they can play the files on other media player application (with some limitations but giving more control to the users).
I have not seen anything announced for R for this need so would like to know how this should be handled.