-
Notifications
You must be signed in to change notification settings - Fork 484
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
LibraryParams isRecent & isSuggested combinations #2159
Comments
I suppose |
I think it's perfectly reasonable to set both actually. The session service may not be able to provide a fully accurately sorted list for both values, but an app can choose what it wants to reply with anyway as this is on a best effort basis (e.g. the definition of suggestion or recent can vary by app). |
Thank you for the clarification. It could be useful to update the documentation a bit on intended usage of LibraryParams. The javadoc on the class itself suggests that it can be used somewhat arbitrarily on the MediaSession side, but some methods in MediaLibrarySession.Callback suggest giving the Browser what it wants. My conclusion has been to use the most accommodating approach possible: have the MediaSession accept whatever the Browser wants, and return something that it actually has, so that the Browser does not end up empty-handed, because it interprets things differently. So the Session says "You want 'suggested', so I'm giving you 'suggested'", but returning its usual results, because it does not actually support 'suggested', but that seems better than returning nothing to a Browser that uses a different interpretation of how things should work. It's unlikely that the Browser will perform a complex analysis of returned LibraryParams, so I return it data that is similar to what it actually requested. I wish LibraryParams usage was less wishy-washy. |
I think that's unavoidable to some extent because of how 'recent' and 'suggested' are open to interpretation.
I'll add a note that multiple flags can be set. |
Issue: #2159 PiperOrigin-RevId: 730805485
I'd like to add LibraryParams support to my MediaSession. I am not sure how to treat combinations of
isRecent
andisSuggested
, when both are true. I assume the intention is to make those two exclusive, but there is no mention or enforcement of it. Both say to order results in order of relevance. Thanks.The text was updated successfully, but these errors were encountered: