Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

MediaBrowserServiceCompat

abstract class MediaBrowserServiceCompat : Service
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ androidx.media.MediaBrowserServiceCompat

Base class for media browse services.

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:

<service android:name=".MyMediaBrowserServiceCompat"
           android:label="@string/service_name" >
      <intent-filter>
          <action android:name="android.media.browse.MediaBrowserService" />
      </intent-filter>
  </service>
  

Summary

Nested classes

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

open

Completion handler for asynchronous callback methods in MediaBrowserServiceCompat.

Constants
static String

The Intent that must be declared as handled by the service.

Public constructors

Base class for media browse services.

Public methods
open Unit
dump(fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!)

Bundle!

Gets the root hints sent from the currently connected MediaBrowserCompat.

MediaSessionManager.RemoteUserInfo

Gets the browser information who sent the current request.

open MediaSessionCompat.Token?

Gets the session token, or null if it has not yet been created or if it has been destroyed.

open Unit
notifyChildrenChanged(@NonNull parentId: String)

Notifies all connected media browsers that the children of the specified parent id have changed in some way.

open Unit
notifyChildrenChanged(@NonNull parentId: String, @NonNull options: Bundle)

Notifies all connected media browsers that the children of the specified parent id have changed in some way.

open IBinder?
onBind(intent: Intent!)

open Unit

open Unit
onCustomAction(@NonNull action: String, extras: Bundle!, @NonNull result: MediaBrowserServiceCompat.Result<Bundle!>)

Called to request a custom action to this service.

abstract MediaBrowserServiceCompat.BrowserRoot?
onGetRoot(@NonNull clientPackageName: String, clientUid: Int, @Nullable rootHints: Bundle?)

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

abstract Unit

Called to get information about the children of a media item.

open Unit
onLoadChildren(@NonNull parentId: String, @NonNull result: MediaBrowserServiceCompat.Result<MutableList<MediaBrowserCompat.MediaItem!>!>, @NonNull options: Bundle)

Called to get information about the children of a media item.

open Unit

Called to get information about a specific media item.

open Unit

Called to get the search result.

open Unit

Call to set the media session.

Constants

SERVICE_INTERFACE

static val SERVICE_INTERFACE: String

The Intent that must be declared as handled by the service.

Value: "android.media.browse.MediaBrowserService"

Public constructors

<init>

MediaBrowserServiceCompat()

Base class for media browse services.

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:

<service android:name=".MyMediaBrowserServiceCompat"
           android:label="@string/service_name" >
      <intent-filter>
          <action android:name="android.media.browse.MediaBrowserService" />
      </intent-filter>
  </service>
  

Public methods

dump

open fun dump(
    fd: FileDescriptor!,
    writer: PrintWriter!,
    args: Array<String!>!
): Unit

getBrowserRootHints

fun getBrowserRootHints(): Bundle!

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 android.media.browse.MediaBrowser and running on API 23 or lower.

Exceptions
IllegalStateException If this method is called outside of #onLoadChildren, onLoadItem or onSearch.

getCurrentBrowserInfo

@NonNull fun getCurrentBrowserInfo(): MediaSessionManager.RemoteUserInfo

Gets the browser information who sent the current request.

Exceptions
IllegalStateException If this method is called outside of onGetRoot or #onLoadChildren or onLoadItem.

getSessionToken

@Nullable open fun getSessionToken(): MediaSessionCompat.Token?

Gets the session token, or null if it has not yet been created or if it has been destroyed.

notifyChildrenChanged

open fun notifyChildrenChanged(@NonNull parentId: String): Unit

Notifies all connected media browsers that the children of the specified parent id have changed in some way. This will cause browsers to fetch subscribed content again.

Parameters
parentId String: The id of the parent media item whose children changed.

notifyChildrenChanged

open fun notifyChildrenChanged(
    @NonNull parentId: String,
    @NonNull options: Bundle
): Unit

Notifies all connected media browsers that the children of the specified parent id have changed in some way. This will cause browsers to fetch subscribed content again.

Parameters
parentId String: The id of the parent media item whose children changed.
options Bundle: A bundle of service-specific arguments to send to the media browse. The contents of this bundle may contain the information about the change.

onBind

open fun onBind(intent: Intent!): IBinder?

onCreate

open fun onCreate(): Unit

onCustomAction

open fun onCustomAction(
    @NonNull action: String,
    extras: Bundle!,
    @NonNull result: MediaBrowserServiceCompat.Result<