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

BrowserRoot

class BrowserRoot
kotlin.Any
   ↳ androidx.media.MediaBrowserServiceCompat.BrowserRoot

Contains information that the browser service needs to send to the client when first connected.

Summary

Constants
static String

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

static String

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

static String

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

static String

The lookup key for a string that indicates specific keywords which will be considered when the browser service suggests media items.

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

Constructs a browser root.

Public methods
String!

Gets the root id for browsing.

Bundle!

Gets any extras about the browser service.

Constants

EXTRA_RECENT

static val EXTRA_RECENT: String

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

When creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving media items that are recently played. If the media browser service can provide such media items, the implementation must return the key in the root hint when onGetRoot(String, int, Bundle) is called back.

The root hint may contain multiple keys.

Value: "android.service.media.extra.RECENT"

EXTRA_OFFLINE

static val EXTRA_OFFLINE: String

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

When creating a media browser for a given media browser 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 browser service can provide such media items, the implementation must return the key in the root hint when onGetRoot(String, int, Bundle) is called back.

The root hint may contain multiple keys.

Value: "android.service.media.extra.OFFLINE"

EXTRA_SUGGESTED

static val EXTRA_SUGGESTED: String

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

When creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving the media items suggested by the media browser service. The list of media items passed in MediaBrowserCompat.SubscriptionCallback#onChildrenLoaded(String, List) is considered ordered by relevance, first being the top suggestion. If the media browser service can provide such media items, the implementation must return the key in the root hint when onGetRoot(String, int, Bundle) is called back.

The root hint may contain multiple keys.

Value: "android.service.media.extra.SUGGESTED"

EXTRA_SUGGESTION_KEYWORDS

static val EXTRA_SUGGESTION_KEYWORDS: String

The lookup key for a string that indicates specific keywords which will be considered when the browser service suggests media items.

When creating a media browser for a given media browser service, this key can be supplied as a root hint together with EXTRA_SUGGESTED for retrieving suggested media items related with the keywords. The list of media items passed in android.media.browse.MediaBrowser.SubscriptionCallback#onChildrenLoaded(String, List) is considered ordered by relevance, first being the top suggestion. If the media browser service can provide such media items, the implementation must return the key in the root hint when onGetRoot(String, int, Bundle) is called back.

The root hint may contain multiple keys.

Value: "android.service.media.extra.SUGGESTION_KEYWORDS"

Public constructors

<init>

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

Constructs a browser root.

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

Public methods

getRootId

fun getRootId(): String!

Gets the root id for browsing.

getExtras

fun getExtras(): Bundle!

Gets any extras about the browser service.