MediaLibraryService.LibraryParams


public final class MediaLibraryService.LibraryParams


Parameters for the interaction between MediaBrowser and MediaLibrarySession.

When a MediaBrowser specifies the parameters, the MediaLibrarySession is recommended to do the best effort to provide a result regarding the parameters, but it's not an error even though MediaLibrarySession doesn't return the parameters since they are optional.

Summary

Nested types

A builder for LibraryParams.

Public fields

final Bundle

An extra Bundle for the private contract between MediaBrowser and .

final boolean

Whether the media items can be played without an internet connection.

final boolean

Whether the media items are recently played.

final boolean

Whether the media items are suggested.

Public methods

static MediaLibraryService.LibraryParams

Restores a LibraryParams from a Bundle.

Bundle

Public fields

extras

@UnstableApi
public final Bundle extras

An extra Bundle for the private contract between MediaBrowser and .

isOffline

public final boolean isOffline

Whether the media items can be played without an internet connection.

When a MediaBrowser specifies it as true, the MediaLibrarySession is recommended to provide offline media items. If so, the implementation must return the parameter with true as well.

When a MediaBrowser specifies it as false, the MediaLibrarySession doesn't have to care about the offline playability of media items.

isRecent

public final boolean isRecent

Whether the media items are recently played.

When a MediaBrowser specifies it as true, the MediaLibrarySession is recommended to provide the recently played media items. If so, the implementation must return the parameter with true as well. The list of media items is sorted by relevance, the first being the most recent.

When a MediaBrowser specifies it as false, the MediaLibrarySession doesn't have to care about the recentness of media items.

isSuggested

public final boolean isSuggested

Whether the media items are suggested.

When a MediaBrowser specifies it as true, the MediaLibrarySession is recommended to provide suggested media items. If so, the implementation must return the parameter with true as well. The list of media items is sorted by relevance, the first being the top suggestion.

When a MediaBrowser specifies it as false, the MediaLibrarySession doesn't have to care about the suggestion for media items.

Public methods

fromBundle

@UnstableApi
public static MediaLibraryService.LibraryParams fromBundle(Bundle bundle)

Restores a LibraryParams from a Bundle.

toBundle

@UnstableApi
public Bundle toBundle()