MediaBrowserServiceCompat

Added in 1.1.0
Deprecated in 1.8.0

public abstract class MediaBrowserServiceCompat extends Service


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 types

This class is deprecated.

androidx.media is deprecated.

This class is deprecated.

androidx.media is deprecated.

Constants

static final String
SERVICE_INTERFACE = "android.media.browse.MediaBrowserService"

This field is deprecated. Deprecated in Java

Public constructors

This method is deprecated. Deprecated in Java

Public methods

void
dump(FileDescriptor fd, PrintWriter writer, String[] args)

This method is deprecated. Deprecated in Java

final Bundle

This method is deprecated. Deprecated in Java

final @NonNull MediaSessionManager.RemoteUserInfo

This method is deprecated. Deprecated in Java

@Nullable MediaSessionCompat.Token

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

IBinder
onBind(Intent intent)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
onCustomAction(
    @NonNull String action,
    Bundle extras,
    @NonNull MediaBrowserServiceCompat.Result<Bundle> result
)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

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

This method is deprecated. Deprecated in Java

abstract void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Inherited Constants

From android.content.ComponentCallbacks2
static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated.

static final int

This field is deprecated.

static final int

This field is deprecated.

static final int

This field is deprecated.

static final int

This field is deprecated.

static final int

This field is deprecated. Deprecated in Java

From android.content.Context
static final String
ACCESSIBILITY_SERVICE = "accessibility"

This field is deprecated. Deprecated in Java

static final String
ACCOUNT_SERVICE = "account"

This field is deprecated. Deprecated in Java

static final String
ACTIVITY_SERVICE = "activity"

This field is deprecated. Deprecated in Java

static final String
ADVANCED_PROTECTION_SERVICE = "advanced_protection"

This field is deprecated. Deprecated in Java

static final String
ALARM_SERVICE = "alarm"

This field is deprecated. Deprecated in Java

static final String
APPWIDGET_SERVICE = "appwidget"

This field is deprecated. Deprecated in Java

static final String
APP_FUNCTION_SERVICE = "app_function"

This field is deprecated. Deprecated in Java

static final String
APP_OPS_SERVICE = "appops"

This field is deprecated. Deprecated in Java

static final String
APP_SEARCH_SERVICE = "app_search"

This field is deprecated. Deprecated in Java

static final String
AUDIO_SERVICE = "audio"

This field is deprecated. Deprecated in Java

static final String
AUTOFILL_SERVICE = "autofill"

This field is deprecated. Deprecated in Java

static final String
BATTERY_SERVICE = "batterymanager"

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int
BIND_EXTERNAL_SERVICE = -2147483648

This field is deprecated. Deprecated in Java

static final long
BIND_EXTERNAL_SERVICE_LONG = 4611686018427387904

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final String
BIOMETRIC_SERVICE = "biometric"

This field is deprecated. Deprecated in Java

static final String
BLOB_STORE_SERVICE = "blob_store"

This field is deprecated. Deprecated in Java

static final String
BLUETOOTH_SERVICE = "bluetooth"

This field is deprecated. Deprecated in Java

static final String
BUGREPORT_SERVICE = "bugreport"

This field is deprecated. Deprecated in Java

static final String
CAMERA_SERVICE = "camera"

This field is deprecated. Deprecated in Java

static final String
CAPTIONING_SERVICE = "captioning"

This field is deprecated. Deprecated in Java

static final String
CARRIER_CONFIG_SERVICE = "carrier_config"

This field is deprecated. Deprecated in Java

static final String
CHOOSER_SERVICE = "chooser"

This field is deprecated. Deprecated in Java

static final String
CLIPBOARD_SERVICE = "clipboard"

This field is deprecated. Deprecated in Java

static final String
COMPANION_DEVICE_SERVICE = "companiondevice"

This field is deprecated. Deprecated in Java

static final String
CONNECTIVITY_DIAGNOSTICS_SERVICE = "connectivity_diagnostics"

This field is deprecated. Deprecated in Java

static final String
CONNECTIVITY_SERVICE = "connectivity"

This field is deprecated. Deprecated in Java

static final String
CONSUMER_IR_SERVICE = "consumer_ir"

This field is deprecated. Deprecated in Java

static final String
CONTACT_KEYS_SERVICE = "contact_keys"

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final String
CREDENTIAL_SERVICE = "credential"

This field is deprecated. Deprecated in Java

static final String
CROSS_PROFILE_APPS_SERVICE = "crossprofileapps"

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final String
DEVICE_LOCK_SERVICE = "device_lock"

This field is deprecated. Deprecated in Java

static final String
DEVICE_POLICY_SERVICE = "device_policy"

This field is deprecated. Deprecated in Java

static final String
DISPLAY_HASH_SERVICE = "display_hash"

This field is deprecated. Deprecated in Java

static final String
DISPLAY_SERVICE = "display"

This field is deprecated. Deprecated in Java

static final String
DOMAIN_VERIFICATION_SERVICE = "domain_verification"

This field is deprecated. Deprecated in Java

static final String
DOWNLOAD_SERVICE = "download"

This field is deprecated. Deprecated in Java

static final String
DROPBOX_SERVICE = "dropbox"

This field is deprecated. Deprecated in Java

static final String
EUICC_SERVICE = "euicc"

This field is deprecated. Deprecated in Java

static final String
FILE_INTEGRITY_SERVICE = "file_integrity"

This field is deprecated. Deprecated in Java

static final String
FILE_SERVICE = "file"

This field is deprecated. Deprecated in Java

static final String
GAME_SERVICE = "game"

This field is deprecated. Deprecated in Java

static final String
GRAMMATICAL_INFLECTION_SERVICE = "grammatical_inflection"

This field is deprecated. Deprecated in Java

static final String
HARDWARE_PROPERTIES_SERVICE = "hardware_properties"

This field is deprecated. Deprecated in Java

static final String
HEALTHCONNECT_SERVICE = "healthconnect"

This field is deprecated. Deprecated in Java

static final String
INPUT_METHOD_SERVICE = "input_method"

This field is deprecated. Deprecated in Java

static final String
INPUT_SERVICE = "input"

This field is deprecated. Deprecated in Java

static final String
IPSEC_SERVICE = "ipsec"

This field is deprecated. Deprecated in Java

static final String
JOB_SCHEDULER_SERVICE = "jobscheduler"

This field is deprecated. Deprecated in Java

static final String
KEYGUARD_SERVICE = "keyguard"

This field is deprecated. Deprecated in Java

static final String
KEYSTORE_SERVICE = "keystore"

This field is deprecated. Deprecated in Java

static final String
LAUNCHER_APPS_SERVICE = "launcherapps"

This field is deprecated. Deprecated in Java

static final String
LAYOUT_INFLATER_SERVICE = "layout_inflater"

This field is deprecated. Deprecated in Java

static final String
LOCALE_SERVICE = "locale"

This field is deprecated. Deprecated in Java

static final String
LOCATION_SERVICE = "location"

This field is deprecated. Deprecated in Java

static final String
MEDIA_COMMUNICATION_SERVICE = "media_communication"

This field is deprecated. Deprecated in Java

static final String
MEDIA_METRICS_SERVICE = "media_metrics"

This field is deprecated. Deprecated in Java

static final String
MEDIA_PROJECTION_SERVICE = "media_projection"

This field is deprecated. Deprecated in Java

static final String
MEDIA_QUALITY_SERVICE = "media_quality"

This field is deprecated. Deprecated in Java

static final String
MEDIA_ROUTER_SERVICE = "media_router"

This field is deprecated. Deprecated in Java

static final String
MEDIA_SESSION_SERVICE = "media_session"

This field is deprecated. Deprecated in Java

static final String
MIDI_SERVICE = "midi"

This field is deprecated. Deprecated in Java

static final int
MODE_APPEND = 32768

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated.

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated.

static final int

This field is deprecated.

static final String

This field is deprecated. Deprecated in Java

static final String
NFC_SERVICE = "nfc"

This field is deprecated. Deprecated in Java

static final String
NOTIFICATION_SERVICE = "notification"

This field is deprecated. Deprecated in Java

static final String
NPU_SERVICE = "npu"

This field is deprecated. Deprecated in Java

static final String
NSD_SERVICE = "servicediscovery"

This field is deprecated. Deprecated in Java

static final String
OVERLAY_SERVICE = "overlay"

This field is deprecated. Deprecated in Java

static final String
PCC_SANDBOX_SERVICE = "pcc_sandbox"

This field is deprecated. Deprecated in Java

static final String
PEOPLE_SERVICE = "people"

This field is deprecated. Deprecated in Java

static final String
PERFORMANCE_HINT_SERVICE = "performance_hint"

This field is deprecated. Deprecated in Java

static final String
PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block"

This field is deprecated. Deprecated in Java

static final String
POWER_SERVICE = "power"

This field is deprecated. Deprecated in Java

static final String
PRINT_SERVICE = "print"

This field is deprecated. Deprecated in Java

static final String
PROFILING_SERVICE = "profiling"

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final String
RESTRICTIONS_SERVICE = "restrictions"

This field is deprecated. Deprecated in Java

static final String
ROLE_SERVICE = "role"

This field is deprecated. Deprecated in Java

static final String
SATELLITE_SERVICE = "satellite"

This field is deprecated. Deprecated in Java

static final String
SEARCH_SERVICE = "search"

This field is deprecated. Deprecated in Java

static final String
SECURITY_STATE_SERVICE = "security_state"

This field is deprecated. Deprecated in Java

static final String
SENSOR_SERVICE = "sensor"

This field is deprecated. Deprecated in Java

static final String
SERIAL_SERVICE = "serial"

This field is deprecated. Deprecated in Java

static final String
SHORTCUT_SERVICE = "shortcut"

This field is deprecated. Deprecated in Java

static final String
STATUS_BAR_SERVICE = "statusbar"

This field is deprecated. Deprecated in Java

static final String
STORAGE_SERVICE = "storage"

This field is deprecated. Deprecated in Java

static final String
STORAGE_STATS_SERVICE = "storagestats"

This field is deprecated. Deprecated in Java

static final String
SYSTEM_HEALTH_SERVICE = "systemhealth"

This field is deprecated. Deprecated in Java

static final String
TELECOM_SERVICE = "telecom"

This field is deprecated. Deprecated in Java

static final String
TELEPHONY_IMS_SERVICE = "telephony_ims"

This field is deprecated. Deprecated in Java

static final String
TELEPHONY_PHONE_NUMBER_SERVICE = "telephony_phone_number"

This field is deprecated. Deprecated in Java

static final String

This field is deprecated. Deprecated in Java

static final String
TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service"

This field is deprecated. Deprecated in Java

static final String
TETHERING_SERVICE = "tethering"

This field is deprecated. Deprecated in Java

static final String
TEXT_CLASSIFICATION_SERVICE = "textclassification"

This field is deprecated. Deprecated in Java

static final String

This field is deprecated. Deprecated in Java

static final String
TV_AD_SERVICE = "tv_ad"

This field is deprecated. Deprecated in Java

static final String
TV_INPUT_SERVICE = "tv_input"

This field is deprecated. Deprecated in Java

static final String
TV_INTERACTIVE_APP_SERVICE = "tv_interactive_app"

This field is deprecated. Deprecated in Java

static final String
UI_MODE_SERVICE = "uimode"

This field is deprecated. Deprecated in Java

static final String
USAGE_STATS_SERVICE = "usagestats"

This field is deprecated. Deprecated in Java

static final String
USB_SERVICE = "usb"

This field is deprecated. Deprecated in Java

static final String
USER_SERVICE = "user"

This field is deprecated. Deprecated in Java

static final String
VIBRATOR_MANAGER_SERVICE = "vibrator_manager"

This field is deprecated. Deprecated in Java

static final String
VIBRATOR_SERVICE = "vibrator"

This field is deprecated.

static final String
VIRTUAL_DEVICE_SERVICE = "virtualdevice"

This field is deprecated. Deprecated in Java

static final String
VPN_MANAGEMENT_SERVICE = "vpn_management"

This field is deprecated. Deprecated in Java

static final String
WALLPAPER_SERVICE = "wallpaper"

This field is deprecated. Deprecated in Java

static final String
WEB_APP_SERVICE = "web_app"

This field is deprecated. Deprecated in Java

static final String
WIFI_AWARE_SERVICE = "wifiaware"

This field is deprecated. Deprecated in Java

static final String
WIFI_P2P_SERVICE = "wifip2p"

This field is deprecated. Deprecated in Java

static final String

This field is deprecated. Deprecated in Java

static final String
WIFI_SERVICE = "wifi"

This field is deprecated. Deprecated in Java

static final String
WINDOW_SERVICE = "window"

This field is deprecated. Deprecated in Java

From android.app.Service
static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated.

static final int

This field is deprecated. Deprecated in Java

Inherited methods

From android.content.Context
final int
getColor(int id)

This method is deprecated. Deprecated in Java

final ColorStateList

This method is deprecated. Deprecated in Java

final Drawable
getDrawable(int id)

This method is deprecated. Deprecated in Java

final String
getString(int resId)

This method is deprecated. Deprecated in Java

final T
<T> getSystemService(Class<T> serviceClass)

This method is deprecated. Deprecated in Java

final CharSequence
getText(int resId)

This method is deprecated. Deprecated in Java

Context.BindServiceFlags

This method is deprecated. Deprecated in Java

final TypedArray

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
sendBroadcastWithMultiplePermissions(
    Intent intent,
    String[] receiverPermissions
)

This method is deprecated. Deprecated in Java

From android.content.ContextWrapper
boolean
bindIsolatedService(
    Intent service,
    int flags,
    String instanceName,
    Executor executor,
    ServiceConnection conn
)

This method is deprecated. Deprecated in Java

boolean
bindService(
    Intent service,
    Context.BindServiceFlags flags,
    Executor executor,
    ServiceConnection conn
)

This method is deprecated. Deprecated in Java

boolean
bindServiceAsUser(
    Intent service,
    ServiceConnection conn,
    Context.BindServiceFlags flags,
    UserHandle user
)

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

int
checkCallingOrSelfUriPermission(Uri uri, int modeFlags)

This method is deprecated. Deprecated in Java

int[]
checkCallingOrSelfUriPermissions(List<Uri> uris, int modeFlags)

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

int
checkCallingUriPermission(Uri uri, int modeFlags)

This method is deprecated. Deprecated in Java

int[]
checkCallingUriPermissions(List<Uri> uris, int modeFlags)

This method is deprecated. Deprecated in Java

int
checkContentUriPermissionFull(Uri uri, int pid, int uid, int modeFlags)

This method is deprecated. Deprecated in Java

int
checkPermission(String permission, int pid, int uid)

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

int
checkUriPermission(Uri uri, int pid, int uid, int modeFlags)

This method is deprecated. Deprecated in Java

int[]
checkUriPermissions(List<Uri> uris, int pid, int uid, int modeFlags)

This method is deprecated. Deprecated in Java

void

This method is deprecated.

Context

This method is deprecated. Deprecated in Java

Context

This method is deprecated. Deprecated in Java

Context

This method is deprecated. Deprecated in Java

Context

This method is deprecated. Deprecated in Java

Context
createDeviceContext(int deviceId)

This method is deprecated. Deprecated in Java

Context

This method is deprecated. Deprecated in Java

Context

This method is deprecated. Deprecated in Java

Context
createPackageContext(String packageName, int flags)

This method is deprecated. Deprecated in Java

Context
createWindowContext(Display display, int type, Bundle options)

This method is deprecated. Deprecated in Java

String[]

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
enforceCallingOrSelfUriPermission(
    Uri uri,
    int modeFlags,
    String message
)

This method is deprecated. Deprecated in Java

void
enforceCallingPermission(String permission, String message)

This method is deprecated. Deprecated in Java

void
enforceCallingUriPermission(Uri uri, int modeFlags, String message)

This method is deprecated. Deprecated in Java

void
enforcePermission(String permission, int pid, int uid, String message)

This method is deprecated. Deprecated in Java

void
enforceUriPermission(
    Uri uri,
    int pid,
    int uid,
    int modeFlags,
    String message
)

This method is deprecated. Deprecated in Java

String[]

This method is deprecated. Deprecated in Java

Context

This method is deprecated. Deprecated in Java

ApplicationInfo

This method is deprecated. Deprecated in Java

AssetManager

This method is deprecated. Deprecated in Java

AttributionSource

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

Context

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

ClassLoader

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

ContentResolver

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

File
getDir(String name, int mode)

This method is deprecated. Deprecated in Java

Display

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

File[]

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

File[]

This method is deprecated. Deprecated in Java

File[]

This method is deprecated.

File

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

Executor

This method is deprecated. Deprecated in Java

Looper

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

File

This method is deprecated. Deprecated in Java

File[]

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

PackageManager

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

ContextParams

This method is deprecated. Deprecated in Java

Resources

This method is deprecated. Deprecated in Java

SharedPreferences
getSharedPreferences(String name, int mode)

This method is deprecated. Deprecated in Java

Object

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

Resources.Theme

This method is deprecated. Deprecated in Java

Drawable

This method is deprecated.

int

This method is deprecated.

int

This method is deprecated.

void
grantUriPermission(String toPackage, Uri uri, int modeFlags)

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

boolean
moveDatabaseFrom(Context sourceContext, String name)

This method is deprecated. Deprecated in Java

boolean
moveSharedPreferencesFrom(Context sourceContext, String name)

This method is deprecated. Deprecated in Java

FileInputStream

This method is deprecated. Deprecated in Java

FileOutputStream
openFileOutput(String name, int mode)

This method is deprecated. Deprecated in Java

SQLiteDatabase
openOrCreateDatabase(
    String name,
    int mode,
    SQLiteDatabase.CursorFactory factory
)

This method is deprecated. Deprecated in Java

Drawable

This method is deprecated.

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Intent

This method is deprecated. Deprecated in Java

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated. Deprecated in Java

void
revokeUriPermission(Uri uri, int modeFlags)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
sendOrderedBroadcast(
    Intent intent,
    int initialCode,
    String receiverPermission,
    String receiverAppOp,
    BroadcastReceiver resultReceiver,
    Handler scheduler,
    String initialData,
    Bundle initialExtras,
    Bundle options
)

This method is deprecated. Deprecated in Java

void
sendOrderedBroadcastAsUser(
    Intent intent,
    UserHandle user,
    String receiverPermission,
    BroadcastReceiver resultReceiver,
    Handler scheduler,
    int initialCode,
    String initialData,
    Bundle initialExtras
)

This method is deprecated. Deprecated in Java

void

This method is deprecated.

void

This method is deprecated.

void
sendStickyOrderedBroadcast(
    Intent intent,
    BroadcastReceiver resultReceiver,
    Handler scheduler,
    int initialCode,
    String initialData,
    Bundle initialExtras
)

This method is deprecated.

void
sendStickyOrderedBroadcastAsUser(
    Intent intent,
    UserHandle user,
    BroadcastReceiver resultReceiver,
    Handler scheduler,
    int initialCode,
    String initialData,
    Bundle initialExtras
)

This method is deprecated.

void
setTheme(int resid)

This method is deprecated. Deprecated in Java

void

This method is deprecated.

void
startActivities(Intent[] intents)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

ComponentName

This method is deprecated. Deprecated in Java

boolean
startInstrumentation(
    ComponentName className,
    String profileFile,
    Bundle arguments
)

This method is deprecated. Deprecated in Java

void
startIntentSender(
    IntentSender intent,
    Intent fillInIntent,
    int flagsMask,
    int flagsValues,
    int extraFlags
)

This method is deprecated. Deprecated in Java

ComponentName

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
updateServiceGroup(ServiceConnection conn, int group, int importance)

This method is deprecated. Deprecated in Java

From android.app.Service
void

This method is deprecated. Deprecated in Java

final Application

This method is deprecated. Deprecated in Java

final int

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated.

void
onRebind(Intent intent)

This method is deprecated. Deprecated in Java

void
onStart(Intent intent, int startId)

This method is deprecated.

int
onStartCommand(Intent intent, int flags, int startId)

This method is deprecated. Deprecated in Java

void
onTaskRemoved(Intent rootIntent)

This method is deprecated. Deprecated in Java

void
onTimeout(int startId)

This method is deprecated. Deprecated in Java

void
onTrimMemory(int level)

This method is deprecated. Deprecated in Java

boolean
onUnbind(Intent intent)

This method is deprecated. Deprecated in Java

final void
startForeground(int id, Notification notification)

This method is deprecated. Deprecated in Java

final void
stopForeground(boolean removeNotification)

This method is deprecated.

final void

This method is deprecated. Deprecated in Java

final boolean
stopSelfResult(int startId)

This method is deprecated. Deprecated in Java

Constants

SERVICE_INTERFACE

Added in 1.1.0
Deprecated in 1.8.0
public static final String SERVICE_INTERFACE = "android.media.browse.MediaBrowserService"

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

Public constructors

MediaBrowserServiceCompat

Added in 1.1.0
Deprecated in 1.8.0
public MediaBrowserServiceCompat()

Public methods

dump

Added in 1.1.0
Deprecated in 1.8.0
public void dump(FileDescriptor fd, PrintWriter writer, String[] args)

getBrowserRootHints

Added in 1.1.0
Deprecated in 1.8.0
public final Bundle 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 android.media.browse.MediaBrowser and running on API 23 or lower.

Throws
java.lang.IllegalStateException

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

getCurrentBrowserInfo

Added in 1.1.0
Deprecated in 1.8.0
public final @NonNull MediaSessionManager.RemoteUserInfo getCurrentBrowserInfo()

Gets the browser information who sent the current request.

Throws
java.lang.IllegalStateException

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

getSessionToken

Added in 1.1.0
Deprecated in 1.8.0
public @Nullable MediaSessionCompat.Token getSessionToken()

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

notifyChildrenChanged

Added in 1.1.0
Deprecated in 1.8.0
public void notifyChildrenChanged(@NonNull String parentId)

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
@NonNull String parentId

The id of the parent media item whose children changed.

notifyChildrenChanged

Added in 1.1.0
Deprecated in 1.8.0
public void notifyChildrenChanged(@NonNull String parentId, @NonNull Bundle options)

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
@NonNull String parentId

The id of the parent media item whose children changed.

@NonNull Bundle options

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

Added in 1.1.0
Deprecated in 1.8.0
public IBinder onBind(Intent intent)

onCreate

public void onCreate()

onCustomAction

Added in 1.1.0
Deprecated in 1.8.0
public void onCustomAction(
    @NonNull String action,
    Bundle extras,
    @NonNull MediaBrowserServiceCompat.Result<Bundle> result
)

Called to request a custom action to this service.

Implementations must call either sendResult or sendError. If the requested custom action will be an expensive operation detach may be called before returning from this function, and then the service can send the result later when the custom action is completed. Implementation can also call sendProgressUpdate to send an interim update to the requester.

If the requested custom action is not supported by this service, call sendError. The default implementation will invoke sendError.

Parameters
@NonNull String action

The custom action sent from the media browser.

Bundle extras

The bundle of service-specific arguments sent from the media browser.

@NonNull MediaBrowserServiceCompat.Result<Bundle> result

The Result to send the result of the requested custom action.

onDestroy

@CallSuper
@MainThread
public void onDestroy()

onGetRoot

Added in 1.1.0
Deprecated in 1.8.0
public abstract @Nullable MediaBrowserServiceCompat.BrowserRoot onGetRoot(
    @NonNull String clientPackageName,
    int clientUid,
    @Nullable Bundle rootHints
)

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
@NonNull String clientPackageName

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

int clientUid

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

@Nullable Bundle rootHints

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.

Returns
@Nullable MediaBrowserServiceCompat.BrowserRoot

The BrowserRoot for accessing this app's content or null.

onLoadChildren

Added in 1.1.0
Deprecated in 1.8.0
public abstract void onLoadChildren(
    @NonNull String parentId,
    @NonNull MediaBrowserServiceCompat.Result<List<MediaBrowserCompat.MediaItem>> result
)

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

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.

In case the media item does not have any children, call sendResult with an empty list. When the given parentId is invalid, implementations must call result.sendResult with null, which will invoke onError.

Parameters
@NonNull String parentId

The id of the parent media item whose children are to be queried.

@NonNull MediaBrowserServiceCompat.Result<List<MediaBrowserCompat.MediaItem>> result

The Result to send the list of children to.

onLoadChildren

Added in 1.1.0
Deprecated in 1.8.0
public void onLoadChildren(
    @NonNull String parentId,
    @NonNull MediaBrowserServiceCompat.Result<List<MediaBrowserCompat.MediaItem>> result,
    @NonNull Bundle options
)

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

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.

In case the media item does not have any children, call sendResult with an empty list. When the given parentId is invalid, implementations must call result.sendResult with null, which will invoke onError.

Parameters
@NonNull String parentId

The id of the parent media item whose children are to be queried.

@NonNull MediaBrowserServiceCompat.Result<List<MediaBrowserCompat.MediaItem>> result

The Result to send the list of children to.

@NonNull Bundle options

A bundle of service-specific arguments sent from the media browse. The information returned through the result should be affected by the contents of this bundle.

onLoadItem

Added in 1.1.0
Deprecated in 1.8.0
public void onLoadItem(
    String itemId,
    @NonNull MediaBrowserServiceCompat.Result<MediaBrowserCompat.MediaItem> result
)

Called to get information about a specific media item.

Implementations must call result.sendResult. If loading the item will be an expensive operation result.detach may be called before returning from this function, and then result.sendResult called when the item has been loaded.

When the given itemId is invalid, implementations must call result.sendResult with null.

The default implementation will invoke onError.

Parameters
String itemId

The id for the specific MediaBrowserCompat.MediaItem.

@NonNull MediaBrowserServiceCompat.Result<MediaBrowserCompat.MediaItem> result

The Result to send the item to, or null if the id is invalid.

onSearch

Added in 1.1.0
Deprecated in 1.8.0
public void onSearch(
    @NonNull String query,
    Bundle extras,
    @NonNull MediaBrowserServiceCompat.Result<List<MediaBrowserCompat.MediaItem>> result
)

Called to get the search result.

Implementations must call result.sendResult. If the search will be an expensive operation result.detach may be called before returning from this function, and then result.sendResult called when the search has been completed.

In case there are no search results, call result.sendResult with an empty list. In case there are some errors happened, call result.sendResult with null, which will invoke onError.

The default implementation will invoke onError.

Parameters
@NonNull String query

The search query sent from the media browser. It contains keywords separated by space.

Bundle extras

The bundle of service-specific arguments sent from the media browser.

@NonNull MediaBrowserServiceCompat.Result<List<MediaBrowserCompat.MediaItem>> result

The Result to send the search result.

setSessionToken

Added in 1.1.0
Deprecated in 1.8.0
public void setSessionToken(MediaSessionCompat.Token token)

Call to set the media session.

This should be called as soon as possible during the service's startup. It may only be called once.

Parameters
MediaSessionCompat.Token token

The token for the service's MediaSessionCompat.