Media browse services enable applications to browse media content provided by an application
and ask the application to start playing it. They may also be used to control content that
is already playing by way of a MediaSessionCompat.

To extend this class, you must declare the service in your manifest file with
an intent filter with the SERVICE_INTERFACE action.
For example:

Public methods

dump

getBrowserRootHints

Gets the root hints sent from the currently connected MediaBrowserCompat.
The root hints are service-specific arguments included in an optional bundle sent to the
media browser service when connecting and retrieving the root id for browsing, or null if
none. The contents of this bundle may affect the information returned when browsing.

Note that this will return null when connected to MediaBrowser
and running on API 23 or lower.

onGetRoot

Called to get the root information for browsing by a particular client.

The implementation should verify that the client package has permission
to access browse media information before returning the root id; it
should return null if the client is not allowed to access this
information.

Parameters

clientPackageName

String: The package name of the application which is
requesting access to browse media.

clientUid

int: The uid of the application which is requesting access to
browse media.

rootHints

Bundle: An optional bundle of service-specific arguments to send
to the media browse service when connecting and retrieving the
root id for browsing, or null if none. The contents of this
bundle may affect the information returned when browsing.

onLoadChildren

Implementations must call result.sendResult
with the list of children. If loading the children will be an expensive
operation that should be performed on another thread,
result.detach may be called before returning from
this function, and then result.sendResult
called when the loading is complete.

onLoadChildren

Implementations must call result.sendResult
with the list of children. If loading the children will be an expensive
operation that should be performed on another thread,
result.detach may be called before returning from
this function, and then result.sendResult
called when the loading is complete.