Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

LibraryRoot

class LibraryRoot
kotlin.Any
   ↳ androidx.media2.MediaLibraryService2.LibraryRoot

Contains information that the library service needs to send to the client when MediaBrowser2#getLibraryRoot(Bundle) is called.

Summary

Constants
static String

The lookup key for a boolean that indicates whether the library service should return a librar root for recently played media items.

static String

The lookup key for a boolean that indicates whether the library service should return a library root for offline media items.

static String

The lookup key for a boolean that indicates whether the library service should return a library root for suggested media items.

Public constructors
<init>(@NonNull rootId: String, @Nullable extras: Bundle?)

Constructs a library root.

Public methods
String!

Gets the root id for browsing.

Bundle!

Gets any extras about the library service.

Constants

EXTRA_RECENT

static val EXTRA_RECENT: String

The lookup key for a boolean that indicates whether the library service should return a librar root for recently played media items.

When creating a media browser for a given media library service, this key can be supplied as a root hint for retrieving media items that are recently played. If the media library service can provide such media items, the implementation must return the key in the root hint when MediaLibrarySessionCallback#onGetLibraryRoot is called back.

The root hint may contain multiple keys.

Value: "android.media.extra.RECENT"

EXTRA_OFFLINE

static val EXTRA_OFFLINE: String

The lookup key for a boolean that indicates whether the library service should return a library root for offline media items.

When creating a media browser for a given media library service, this key can be supplied as a root hint for retrieving media items that are can be played without an internet connection. If the media library service can provide such media items, the implementation must return the key in the root hint when MediaLibrarySessionCallback#onGetLibraryRoot is called back.

The root hint may contain multiple keys.

Value: "android.media.extra.OFFLINE"

EXTRA_SUGGESTED

static val EXTRA_SUGGESTED: String

The lookup key for a boolean that indicates whether the library service should return a library root for suggested media items.

When creating a media browser for a given media library service, this key can be supplied as a root hint for retrieving the media items suggested by the media library service. The list of media items is considered ordered by relevance, first being the top suggestion. If the media library service can provide such media items, the implementation must return the key in the root hint when MediaLibrarySessionCallback#onGetLibraryRoot is called back.

The root hint may contain multiple keys.

Value: "android.media.extra.SUGGESTED"

Public constructors

<init>

LibraryRoot(@NonNull rootId: String, @Nullable extras: Bundle?)

Constructs a library root.

Parameters
rootId String: The root id for browsing.
extras String: Any extras about the library service.

Public methods

getRootId

fun getRootId(): String!

Gets the root id for browsing.

getExtras

fun getExtras(): Bundle!

Gets any extras about the library service.