public final class

MediaLibraryService.LibraryParams.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media2.MediaLibraryService.LibraryParams.Builder

Overview

Builds MediaLibraryService.LibraryParams.

Summary

Constructors
publicBuilder()

Methods
public MediaLibraryService.LibraryParamsbuild()

Builds MediaLibraryService.LibraryParams.

public MediaLibraryService.LibraryParams.BuildersetExtras(Bundle extras)

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

public MediaLibraryService.LibraryParams.BuildersetOffline(boolean offline)

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

public MediaLibraryService.LibraryParams.BuildersetRecent(boolean recent)

Sets whether recently played media item.

public MediaLibraryService.LibraryParams.BuildersetSuggested(boolean suggested)

Sets whether suggested media items.

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

Constructors

public Builder()

Methods

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: true for recent items. false otherwise.

Returns:

this builder

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: true for offline items. false otherwise.

Returns:

this builder

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: true for suggested items. false otherwise

Returns:

this builder

public MediaLibraryService.LibraryParams.Builder setExtras(Bundle extras)

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

Parameters:

extras: The extras or null.

Returns:

this builder

Builds MediaLibraryService.LibraryParams.

Returns:

new LibraryParams