-
Notifications
You must be signed in to change notification settings - Fork 417
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
notifyChildrenChanged does not update Android Auto list of mediaitems #644
Comments
@oceanjules Thank you for the quick reply, I am aware of the requirement of having the browser subscribed in order for it to receive change callbacks. I've implemented the latter on my activity and it works just fine. However, I don't see how it's possible to make the Android Auto browser subscribe as well ? I've only got EDIT: The issue is confirmed to be more grave on another car head unit where the list of items does not get updated at all until the app is completely disconnected and connected. |
Thanks for your report. Can you repro this when testing with the Media3 branch of UAMP? I'm also curious how you test. It sounds like you are testing with an actual headunit of a car. Is this correct? If so is this Android Auto or Automotive and can you repro this with an emulator as well? Sorry, for asking these questions. Just want to make sure to look at the right thing when I start testing this. |
@marcbaechinger I appreciate the reply. I loaded the media3 branch of UAMP but figured out that it does not have any occurrence of any kind related to Regarding the testing environment; my apologies for the ambiguous description. To be more clear, I am not developing the app for Android Automotive OS, but rather just Android with Android Auto support. I tested with:
What matters is that the method |
Issue: androidx#561 Issue: androidx#644 Issue: androidx#645 PiperOrigin-RevId: 568948230
@marcbaechinger With the use of version 1.2.0's |
Can you expand a bit on repro steps and what the expected behaviour and the observed behaviour is? |
@marcbaechinger I created a very simple demo project to reproduce the faulty behavior on Android Auto, and shared it as a GitHub repo here: Media3AutoDemo. To give you a quick walkthrough on the project components: We have a DemoService (MediaLibraryService) which is the pivotal part of the project. The MediaItem hierarchy is dead simple: a root node, then under it there is a child node which is the actual playlist (browsable), which hosts the actual media items visible on the app via DemoActivity. The DemoActivity uses Compose to show the items as a list, where each item can be played or deleted via custom commands. The Playing items works great for both the app and Android Auto, however, deleting items only works for the app, it seems that Android Auto does NOT know that the items are getting deleted even after calling Expected behavior: Once an item is deleted, the service calls Observed behavior:: Hope this helps :) |
I think there is a bug in the Media3 method We will provide a fix for this. -- If you want to fix this earlier on your end, then you can use the overloaded method Iterate over
|
Tested the workaround and it appears to be working perfectly. Thank you so much :) |
When broadcasting a notifyChildrenChanged event, the task for legacy controllers was sent to the broadcasting callback. This would technically work, but because the subscription list is maintained with specific controllers, the broadcast controller isn't subscribed and hence the call wasn't executed. This change calls the overloaded method for a specific controller for each connected controller. Making sure (only) subscribed controllers are notified. Issue: #644 PiperOrigin-RevId: 590904037
We synced a fix for this to the dev branch (see above). I'm closing this issue. Thanks again for reporting! |
When broadcasting a notifyChildrenChanged event, the task for legacy controllers was sent to the broadcasting callback. This would technically work, but because the subscription list is maintained with specific controllers, the broadcast controller isn't subscribed and hence the call wasn't executed. This change calls the overloaded method for a specific controller for each connected controller. Making sure (only) subscribed controllers are notified. Issue: #644 PiperOrigin-RevId: 590904037 (cherry picked from commit 4974f96)
I am not sure to what extent the library handles Android Auto aside from the common playback controls and commands. However, I've been having some issues making my media app integrate with Android Auto ecosystem :
I use the following code to notify any controllers that my items have undergone some change :
I have a root node which is my library root (the one I return under
onGetLibraryRoot
). It has two children (which Android Auto chooses to show as tabs because they're browsable and not playable): A playlist node and a tracklist node, both which have their own list of items under them.The media hierarchy is like this:
-- nodePLAYLIST
-- nodeTRACKLIST
However, the
notifyChildrenChanged
works fine on my phone, I can receive the callback on my activity just fine. But on Android Auto, it will not update the UI until I leave the tab and go back to it again. This is annoying because the user performs a LOT of library modifications throughout the lifetime of the app, it is essential the Android auto refreshes the list of items that are visible to the user as soon as the callback is executed.Do I need to do something else ? Or am I just doing it wrong ?
The text was updated successfully, but these errors were encountered: