public final class

MediaLibraryService.LibraryParams

extends java.lang.Object

implements VersionedParcelable

 java.lang.Object

↳androidx.media2.MediaLibraryService.LibraryParams

Overview

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

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

Methods
public BundlegetExtras()

Gets the extras.

public booleanisOffline()

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

public booleanisRecent()

Returns true for recent media items.

public booleanisSuggested()

Returns true for suggested media items.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods

public boolean isRecent()

Returns true for recent 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.

Returns:

true for recent items. false otherwise.

public boolean isOffline()

Returns true for 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.

Returns:

true for offline items. false otherwise.

public boolean isSuggested()

Returns true for 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.

Returns:

true for suggested items. false otherwise

public Bundle getExtras()

Gets the extras.

Extras are the private contract between browser and library session.