MediaLibraryService.LibraryParams

Added in 1.0.0
Deprecated in 1.3.0

class MediaLibraryService.LibraryParams : VersionedParcelable


Contains information that the library service needs to send to the client.

When the browser supplies LibraryParams, it's optional field when getting the media item(s). The library session is recommended to do the best effort to provide such result. It's not an error even when the library session didn't return such items.

The library params returned in the library session callback must include the information about the returned media item(s).

Summary

Nested types

This class is deprecated.

androidx.media2 is deprecated.

Public functions

Bundle?

Gets the extras.

Boolean

Returns true for offline media items, which can be played without an internet connection.

Boolean

Returns true for recent media items.

Boolean

Returns true for suggested media items.

Public functions

getExtras

Added in 1.0.0
Deprecated in 1.3.0
fun getExtras(): Bundle?

Gets the extras.

Extras are the private contract between browser and library session.

isOffline

Added in 1.0.0
Deprecated in 1.3.0
fun isOffline(): Boolean

Returns true for offline media items, which can be played without an internet connection.

When the browser supplies LibraryParams with the true, library session is recommended to provide such media items. If so, the library session implementation must return the params with the true as well.

Returns
Boolean

true for offline items. false otherwise.

isRecent

Added in 1.0.0
Deprecated in 1.3.0
fun isRecent(): Boolean

Returns true for recent media items.

When the browser supplies LibraryParams with the true, library session is recommended to provide such media items. If so, the library session implementation must return the params with the true as well. The list of media items is considered ordered by relevance, first being the top suggestion.

Returns
Boolean

true for recent items. false otherwise.

isSuggested

Added in 1.0.0
Deprecated in 1.3.0
fun isSuggested(): Boolean

Returns true for suggested media items.

When the browser supplies LibraryParams with the true, library session is recommended to provide such media items. If so, the library session implementation must return the params with the true as well. The list of media items is considered ordered by relevance, first being the top suggestion.

Returns
Boolean

true for suggested items. false otherwise