MediaLibraryService.LibraryParams.Builder

public static final class MediaLibraryService.LibraryParams.Builder
extends Object

java.lang.Object
   ↳ androidx.media2.session.MediaLibraryService.LibraryParams.Builder


Builds MediaLibraryService.LibraryParams.

Summary

Public constructors

MediaLibraryService.LibraryParams.Builder()

Public methods

MediaLibraryService.LibraryParams build()

Builds MediaLibraryService.LibraryParams.

MediaLibraryService.LibraryParams.Builder setExtras(Bundle extras)

Set a bundle of extras, that browser and library session can understand each other.

MediaLibraryService.LibraryParams.Builder setOffline(boolean offline)

Sets whether offline media items, which can be played without an internet connection.

MediaLibraryService.LibraryParams.Builder setRecent(boolean recent)

Sets whether recently played media item.

MediaLibraryService.LibraryParams.Builder setSuggested(boolean suggested)

Sets whether suggested media items.

Inherited methods

Public constructors

MediaLibraryService.LibraryParams.Builder

public MediaLibraryService.LibraryParams.Builder ()

Public methods

setExtras

public MediaLibraryService.LibraryParams.Builder setExtras (Bundle extras)

Set a bundle of extras, that browser and library session can understand each other.

Parameters
extras Bundle: The extras or null.

Returns
MediaLibraryService.LibraryParams.Builder this builder

setOffline

public MediaLibraryService.LibraryParams.Builder setOffline (boolean offline)

Sets whether offline media items, which can be played without an internet connection.

When the browser supplies MediaLibraryService.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.

Parameters
offline boolean: true for offline items. false otherwise.

Returns
MediaLibraryService.LibraryParams.Builder this builder

setRecent

public MediaLibraryService.LibraryParams.Builder setRecent (boolean recent)

Sets whether recently played media item.

When the browser supplies the MediaLibraryService.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.

Parameters
recent boolean: true for recent items. false otherwise.

Returns
MediaLibraryService.LibraryParams.Builder this builder

setSuggested

public MediaLibraryService.LibraryParams.Builder setSuggested (boolean suggested)

Sets whether suggested media items.

When the browser supplies MediaLibraryService.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.

Parameters
suggested boolean: true for suggested items. false otherwise

Returns
MediaLibraryService.LibraryParams.Builder this builder