Open yuayee opened 1 month ago
Has this issue not been reviewed yet? Is there a way to update the mediaItem's image after the image cache is complete? I tried calling notifyChildrenChanged, but the image isn't updated, possibly because the URI remains the same. I'd really appreciate it if I could get an answer to this.
We are not the Automotive team but I'd guess that the media center is caching images as you say. And similarly as you I would also think that changing the content://-URI would solve the issue. When the same content-URI is used then AAOS doesn't have a way to know that this has changed. There isn't an expiry or other cache mechanism like for HTTP with content providers.
I can't give you a better answer I'm afraid.
images are shown as the default icon in the shape of a music note, and the cached images downloaded through Glide are only displayed after exiting and re-entering that page
I'm not an AAOS expert but if I understand correctly you want AAOS update the default icon as soon as the actual image is downloaded by your app. Looks like the expectation is that the image changes on the screen that is currently presented. I'm not sure if this is possible. At least AAOS would need a nudge from the app side I think.
What I would try is dowloading the image and construct a new content://-URI that you then save (or update in the MediaItem
). Then call onChildrenChanged(parentId, ...)
. That should make AAOS download your media items again and it gets the new content://-URI.
In the UAMP app, the AlbumArtContentProvider is used to load images. In Android Automotive, when displaying the item list, images are shown as the default icon in the shape of a music note, and the cached images downloaded through Glide are only displayed after exiting and re-entering that page or scrolling back to redraw the items. Is there a way to refresh the images when the image cache is completed?