public final class

MediaLibraryService.LibraryParams

extends java.lang.Object

implements Bundleable

 java.lang.Object

↳androidx.media3.session.MediaLibraryService.LibraryParams

Overview

Parameters for the interaction between MediaBrowser and MediaLibraryService.MediaLibrarySession.

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

Summary

Fields
public static final Bundleable.Creator<MediaLibraryService.LibraryParams>CREATOR

Object that can restore MediaLibraryService.LibraryParams from a .

public final Bundleextras

An extra for the private contract between MediaBrowser and MediaLibraryService.MediaLibrarySession.

public final booleanisOffline

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

public final booleanisRecent

Whether the media items are recently played.

public final booleanisSuggested

Whether the media items are suggested.

Methods
public BundletoBundle()

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

Fields

public final Bundle extras

An extra for the private contract between MediaBrowser and MediaLibraryService.MediaLibrarySession.

public final boolean isRecent

Whether the media items are recently played.

When a MediaBrowser specifies it as true, the MediaLibraryService.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 MediaLibraryService.MediaLibrarySession doesn't have to care about the recentness of media items.

public final boolean isOffline

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

When a MediaBrowser specifies it as true, the MediaLibraryService.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 MediaLibraryService.MediaLibrarySession doesn't have to care about the offline playability of media items.

public final boolean isSuggested

Whether the media items are suggested.

When a MediaBrowser specifies it as true, the MediaLibraryService.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 MediaLibraryService.MediaLibrarySession doesn't have to care about the suggestion for media items.

public static final Bundleable.Creator<MediaLibraryService.LibraryParams> CREATOR

Object that can restore MediaLibraryService.LibraryParams from a .

Methods

public Bundle toBundle()