Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

MediaBrowserService.BrowserRoot

public static final class MediaBrowserService.BrowserRoot
extends Object

java.lang.Object
   ↳ android.service.media.MediaBrowserService.BrowserRoot


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

Summary

Constants

String EXTRA_OFFLINE

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

String EXTRA_RECENT

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

String EXTRA_SUGGESTED

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

Public constructors

MediaBrowserService.BrowserRoot(String rootId, Bundle extras)

Constructs a browser root.

Public methods

Bundle getExtras()

Gets any extras about the browser service.

String getRootId()

Gets the root id for browsing.

Inherited methods

Constants

EXTRA_OFFLINE

added in API level 24
public static final String EXTRA_OFFLINE

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 MediaBrowserService.onGetRoot(String, int, Bundle) is called back.

The root hint may contain multiple keys.

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

EXTRA_RECENT

added in API level 24
public static final String EXTRA_RECENT

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 MediaBrowserService.onGetRoot(String, int, Bundle) is called back.

The root hint may contain multiple keys.

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

EXTRA_SUGGESTED

added in API level 24
public static final String EXTRA_SUGGESTED

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 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 MediaBrowserService.onGetRoot(String, int, Bundle) is called back.

The root hint may contain multiple keys.

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

Public constructors

MediaBrowserService.BrowserRoot

added in API level 21
public MediaBrowserService.BrowserRoot (String rootId, 
                Bundle extras)

Constructs a browser root.

Parameters
rootId String: The root id for browsing.

This value must never be null.

extras Bundle: Any extras about the browser service.

This value may be null.

Public methods

getExtras

added in API level 21
public Bundle getExtras ()

Gets any extras about the browser service.

Returns
Bundle

getRootId

added in API level 21
public String getRootId ()

Gets the root id for browsing.

Returns
String