MediaBrowserServiceCompat

Added in 1.1.0
Deprecated in 1.8.0

abstract class MediaBrowserServiceCompat : 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

const String!
SERVICE_INTERFACE = "android.media.browse.MediaBrowserService"

This property is deprecated. Deprecated in Java

Public constructors

This function is deprecated. Deprecated in Java

Public functions

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

This function is deprecated. Deprecated in Java

Bundle!

This function is deprecated. Deprecated in Java

MediaSessionManager.RemoteUserInfo

This function is deprecated. Deprecated in Java

MediaSessionCompat.Token?

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
notifyChildrenChanged(parentId: String, options: Bundle)

This function is deprecated. Deprecated in Java

IBinder!
onBind(intent: Intent!)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

abstract Unit

This function is deprecated. Deprecated in Java

Unit
onLoadChildren(
    parentId: String,
    result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>,
    options: Bundle
)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
onSearch(
    query: String,
    extras: Bundle!,
    result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>
)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Inherited Constants

From android.content.ComponentCallbacks2
const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated. Deprecated in Java

From android.content.Context
const String!
ACCESSIBILITY_SERVICE = "accessibility"

This property is deprecated. Deprecated in Java

const String!
ACCOUNT_SERVICE = "account"

This property is deprecated. Deprecated in Java

const String!
ACTIVITY_SERVICE = "activity"

This property is deprecated. Deprecated in Java

const String!
ADVANCED_PROTECTION_SERVICE = "advanced_protection"

This property is deprecated. Deprecated in Java

const String!
ALARM_SERVICE = "alarm"

This property is deprecated. Deprecated in Java

const String!
APPWIDGET_SERVICE = "appwidget"

This property is deprecated. Deprecated in Java

const String!
APP_FUNCTION_SERVICE = "app_function"

This property is deprecated. Deprecated in Java

const String!
APP_OPS_SERVICE = "appops"

This property is deprecated. Deprecated in Java

const String!
APP_SEARCH_SERVICE = "app_search"

This property is deprecated. Deprecated in Java

const String!
AUDIO_SERVICE = "audio"

This property is deprecated. Deprecated in Java

const String!
AUTOFILL_SERVICE = "autofill"

This property is deprecated. Deprecated in Java

const String!
BATTERY_SERVICE = "batterymanager"

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int
BIND_EXTERNAL_SERVICE = -2147483648

This property is deprecated. Deprecated in Java

const Long
BIND_EXTERNAL_SERVICE_LONG = 4611686018427387904

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const String!
BIOMETRIC_SERVICE = "biometric"

This property is deprecated. Deprecated in Java

const String!
BLOB_STORE_SERVICE = "blob_store"

This property is deprecated. Deprecated in Java

const String!
BLUETOOTH_SERVICE = "bluetooth"

This property is deprecated. Deprecated in Java

const String!
BUGREPORT_SERVICE = "bugreport"

This property is deprecated. Deprecated in Java

const String!
CAMERA_SERVICE = "camera"

This property is deprecated. Deprecated in Java

const String!
CAPTIONING_SERVICE = "captioning"

This property is deprecated. Deprecated in Java

const String!
CARRIER_CONFIG_SERVICE = "carrier_config"

This property is deprecated. Deprecated in Java

const String!
CHOOSER_SERVICE = "chooser"

This property is deprecated. Deprecated in Java

const String!
CLIPBOARD_SERVICE = "clipboard"

This property is deprecated. Deprecated in Java

const String!
COMPANION_DEVICE_SERVICE = "companiondevice"

This property is deprecated. Deprecated in Java

const String!
CONNECTIVITY_DIAGNOSTICS_SERVICE = "connectivity_diagnostics"

This property is deprecated. Deprecated in Java

const String!
CONNECTIVITY_SERVICE = "connectivity"

This property is deprecated. Deprecated in Java

const String!
CONSUMER_IR_SERVICE = "consumer_ir"

This property is deprecated. Deprecated in Java

const String!
CONTACT_KEYS_SERVICE = "contact_keys"

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const String!
CREDENTIAL_SERVICE = "credential"

This property is deprecated. Deprecated in Java

const String!
CROSS_PROFILE_APPS_SERVICE = "crossprofileapps"

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const String!
DEVICE_LOCK_SERVICE = "device_lock"

This property is deprecated. Deprecated in Java

const String!
DEVICE_POLICY_SERVICE = "device_policy"

This property is deprecated. Deprecated in Java

const String!
DISPLAY_HASH_SERVICE = "display_hash"

This property is deprecated. Deprecated in Java

const String!
DISPLAY_SERVICE = "display"

This property is deprecated. Deprecated in Java

const String!
DOMAIN_VERIFICATION_SERVICE = "domain_verification"

This property is deprecated. Deprecated in Java

const String!
DOWNLOAD_SERVICE = "download"

This property is deprecated. Deprecated in Java

const String!
DROPBOX_SERVICE = "dropbox"

This property is deprecated. Deprecated in Java

const String!
EUICC_SERVICE = "euicc"

This property is deprecated. Deprecated in Java

const String!
FILE_INTEGRITY_SERVICE = "file_integrity"

This property is deprecated. Deprecated in Java

const String!
FILE_SERVICE = "file"

This property is deprecated. Deprecated in Java

const String!
GAME_SERVICE = "game"

This property is deprecated. Deprecated in Java

const String!
GRAMMATICAL_INFLECTION_SERVICE = "grammatical_inflection"

This property is deprecated. Deprecated in Java

const String!
HARDWARE_PROPERTIES_SERVICE = "hardware_properties"

This property is deprecated. Deprecated in Java

const String!
HEALTHCONNECT_SERVICE = "healthconnect"

This property is deprecated. Deprecated in Java

const String!
INPUT_METHOD_SERVICE = "input_method"

This property is deprecated. Deprecated in Java

const String!
INPUT_SERVICE = "input"

This property is deprecated. Deprecated in Java

const String!
IPSEC_SERVICE = "ipsec"

This property is deprecated. Deprecated in Java

const String!
JOB_SCHEDULER_SERVICE = "jobscheduler"

This property is deprecated. Deprecated in Java

const String!
KEYGUARD_SERVICE = "keyguard"

This property is deprecated. Deprecated in Java

const String!
KEYSTORE_SERVICE = "keystore"

This property is deprecated. Deprecated in Java

const String!
LAUNCHER_APPS_SERVICE = "launcherapps"

This property is deprecated. Deprecated in Java

const String!
LAYOUT_INFLATER_SERVICE = "layout_inflater"

This property is deprecated. Deprecated in Java

const String!
LOCALE_SERVICE = "locale"

This property is deprecated. Deprecated in Java

const String!
LOCATION_SERVICE = "location"

This property is deprecated. Deprecated in Java

const String!
MEDIA_COMMUNICATION_SERVICE = "media_communication"

This property is deprecated. Deprecated in Java

const String!
MEDIA_METRICS_SERVICE = "media_metrics"

This property is deprecated. Deprecated in Java

const String!
MEDIA_PROJECTION_SERVICE = "media_projection"

This property is deprecated. Deprecated in Java

const String!
MEDIA_QUALITY_SERVICE = "media_quality"

This property is deprecated. Deprecated in Java

const String!
MEDIA_ROUTER_SERVICE = "media_router"

This property is deprecated. Deprecated in Java

const String!
MEDIA_SESSION_SERVICE = "media_session"

This property is deprecated. Deprecated in Java

const String!
MIDI_SERVICE = "midi"

This property is deprecated. Deprecated in Java

const Int
MODE_APPEND = 32768

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated.

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated.

const Int

This property is deprecated.

const String!

This property is deprecated. Deprecated in Java

const String!
NFC_SERVICE = "nfc"

This property is deprecated. Deprecated in Java

const String!
NOTIFICATION_SERVICE = "notification"

This property is deprecated. Deprecated in Java

const String!
NPU_SERVICE = "npu"

This property is deprecated. Deprecated in Java

const String!
NSD_SERVICE = "servicediscovery"

This property is deprecated. Deprecated in Java

const String!
OVERLAY_SERVICE = "overlay"

This property is deprecated. Deprecated in Java

const String!
PCC_SANDBOX_SERVICE = "pcc_sandbox"

This property is deprecated. Deprecated in Java

const String!
PEOPLE_SERVICE = "people"

This property is deprecated. Deprecated in Java

const String!
PERFORMANCE_HINT_SERVICE = "performance_hint"

This property is deprecated. Deprecated in Java

const String!
PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block"

This property is deprecated. Deprecated in Java

const String!
POWER_SERVICE = "power"

This property is deprecated. Deprecated in Java

const String!
PRINT_SERVICE = "print"

This property is deprecated. Deprecated in Java

const String!
PROFILING_SERVICE = "profiling"

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const String!
RESTRICTIONS_SERVICE = "restrictions"

This property is deprecated. Deprecated in Java

const String!
ROLE_SERVICE = "role"

This property is deprecated. Deprecated in Java

const String!
SATELLITE_SERVICE = "satellite"

This property is deprecated. Deprecated in Java

const String!
SEARCH_SERVICE = "search"

This property is deprecated. Deprecated in Java

const String!
SECURITY_STATE_SERVICE = "security_state"

This property is deprecated. Deprecated in Java

const String!
SENSOR_SERVICE = "sensor"

This property is deprecated. Deprecated in Java

const String!
SERIAL_SERVICE = "serial"

This property is deprecated. Deprecated in Java

const String!
SHORTCUT_SERVICE = "shortcut"

This property is deprecated. Deprecated in Java

const String!
STATUS_BAR_SERVICE = "statusbar"

This property is deprecated. Deprecated in Java

const String!
STORAGE_SERVICE = "storage"

This property is deprecated. Deprecated in Java

const String!
STORAGE_STATS_SERVICE = "storagestats"

This property is deprecated. Deprecated in Java

const String!
SYSTEM_HEALTH_SERVICE = "systemhealth"

This property is deprecated. Deprecated in Java

const String!
TELECOM_SERVICE = "telecom"

This property is deprecated. Deprecated in Java

const String!
TELEPHONY_IMS_SERVICE = "telephony_ims"

This property is deprecated. Deprecated in Java

const String!
TELEPHONY_PHONE_NUMBER_SERVICE = "telephony_phone_number"

This property is deprecated. Deprecated in Java

const String!

This property is deprecated. Deprecated in Java

const String!
TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service"

This property is deprecated. Deprecated in Java

const String!
TETHERING_SERVICE = "tethering"

This property is deprecated. Deprecated in Java

const String!
TEXT_CLASSIFICATION_SERVICE = "textclassification"

This property is deprecated. Deprecated in Java

const String!

This property is deprecated. Deprecated in Java

const String!
TV_AD_SERVICE = "tv_ad"

This property is deprecated. Deprecated in Java

const String!
TV_INPUT_SERVICE = "tv_input"

This property is deprecated. Deprecated in Java

const String!
TV_INTERACTIVE_APP_SERVICE = "tv_interactive_app"

This property is deprecated. Deprecated in Java

const String!
UI_MODE_SERVICE = "uimode"

This property is deprecated. Deprecated in Java

const String!
USAGE_STATS_SERVICE = "usagestats"

This property is deprecated. Deprecated in Java

const String!
USB_SERVICE = "usb"

This property is deprecated. Deprecated in Java

const String!
USER_SERVICE = "user"

This property is deprecated. Deprecated in Java

const String!
VIBRATOR_MANAGER_SERVICE = "vibrator_manager"

This property is deprecated. Deprecated in Java

const String!
VIBRATOR_SERVICE = "vibrator"

This property is deprecated.

const String!
VIRTUAL_DEVICE_SERVICE = "virtualdevice"

This property is deprecated. Deprecated in Java

const String!
VPN_MANAGEMENT_SERVICE = "vpn_management"

This property is deprecated. Deprecated in Java

const String!
WALLPAPER_SERVICE = "wallpaper"

This property is deprecated. Deprecated in Java

const String!
WEB_APP_SERVICE = "web_app"

This property is deprecated. Deprecated in Java

const String!
WIFI_AWARE_SERVICE = "wifiaware"

This property is deprecated. Deprecated in Java

const String!
WIFI_P2P_SERVICE = "wifip2p"

This property is deprecated. Deprecated in Java

const String!

This property is deprecated. Deprecated in Java

const String!
WIFI_SERVICE = "wifi"

This property is deprecated. Deprecated in Java

const String!
WINDOW_SERVICE = "window"

This property is deprecated. Deprecated in Java

From android.app.Service
const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated.

const Int

This property is deprecated. Deprecated in Java

Inherited functions

From android.content.Context
Int

This function is deprecated. Deprecated in Java

ColorStateList!

This function is deprecated. Deprecated in Java

Drawable!

This function is deprecated. Deprecated in Java

String!
getString(resId: Int)

This function is deprecated. Deprecated in Java

T!
<T> getSystemService(serviceClass: Class<T!>!)

This function is deprecated. Deprecated in Java

CharSequence!
getText(resId: Int)

This function is deprecated. Deprecated in Java

Context.BindServiceFlags!

This function is deprecated. Deprecated in Java

TypedArray!

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
sendBroadcastWithMultiplePermissions(
    intent: Intent!,
    receiverPermissions: Array<String!>!
)

This function is deprecated. Deprecated in Java

From android.content.ContextWrapper
Boolean
bindIsolatedService(
    service: Intent!,
    flags: Int,
    instanceName: String!,
    executor: Executor!,
    conn: ServiceConnection!
)

This function is deprecated. Deprecated in Java

Boolean
bindService(
    service: Intent!,
    flags: Context.BindServiceFlags!,
    executor: Executor!,
    conn: ServiceConnection!
)

This function is deprecated. Deprecated in Java

Boolean
bindServiceAsUser(
    service: Intent!,
    conn: ServiceConnection!,
    flags: Context.BindServiceFlags!,
    user: UserHandle!
)

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

Array<Int>!
checkCallingOrSelfUriPermissions(
    uris: (Mutable)List<Uri!>!,
    modeFlags: Int
)

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

Int
checkCallingUriPermission(uri: Uri!, modeFlags: Int)

This function is deprecated. Deprecated in Java

Array<Int>!
checkCallingUriPermissions(uris: (Mutable)List<Uri!>!, modeFlags: Int)

This function is deprecated. Deprecated in Java

Int
checkContentUriPermissionFull(uri: Uri!, pid: Int, uid: Int, modeFlags: Int)

This function is deprecated. Deprecated in Java

Int
checkPermission(permission: String!, pid: Int, uid: Int)

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

Int
checkUriPermission(uri: Uri!, pid: Int, uid: Int, modeFlags: Int)

This function is deprecated. Deprecated in Java

Array<Int>!
checkUriPermissions(
    uris: (Mutable)List<Uri!>!,
    pid: Int,
    uid: Int,
    modeFlags: Int
)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated.

Context!
createAttributionContext(attributionTag: String!)

This function is deprecated. Deprecated in Java

Context!
createConfigurationContext(overrideConfiguration: Configuration!)

This function is deprecated. Deprecated in Java

Context!
createContext(contextParams: ContextParams!)

This function is deprecated. Deprecated in Java

Context!

This function is deprecated. Deprecated in Java

Context!

This function is deprecated. Deprecated in Java

Context!

This function is deprecated. Deprecated in Java

Context!

This function is deprecated. Deprecated in Java

Context!
createPackageContext(packageName: String!, flags: Int)

This function is deprecated. Deprecated in Java

Context!
createWindowContext(display: Display!, type: Int, options: Bundle!)

This function is deprecated. Deprecated in Java

Array<String!>!

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Unit
enforceCallingOrSelfPermission(permission: String!, message: String!)

This function is deprecated. Deprecated in Java

Unit
enforceCallingOrSelfUriPermission(
    uri: Uri!,
    modeFlags: Int,
    message: String!
)

This function is deprecated. Deprecated in Java

Unit
enforceCallingPermission(permission: String!, message: String!)

This function is deprecated. Deprecated in Java

Unit
enforceCallingUriPermission(uri: Uri!, modeFlags: Int, message: String!)

This function is deprecated. Deprecated in Java

Unit
enforcePermission(permission: String!, pid: Int, uid: Int, message: String!)

This function is deprecated. Deprecated in Java

Unit
enforceUriPermission(
    uri: Uri!,
    pid: Int,
    uid: Int,
    modeFlags: Int,
    message: String!
)

This function is deprecated. Deprecated in Java

Array<String!>!

This function is deprecated. Deprecated in Java

Context!

This function is deprecated. Deprecated in Java

ApplicationInfo!

This function is deprecated. Deprecated in Java

AssetManager!

This function is deprecated. Deprecated in Java

AttributionSource!

This function is deprecated. Deprecated in Java

String!

This function is deprecated. Deprecated in Java

Context!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

ClassLoader!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

ContentResolver!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

File!
getDir(name: String!, mode: Int)

This function is deprecated. Deprecated in Java

Display!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

Array<File!>!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

Array<File!>!

This function is deprecated. Deprecated in Java

Array<File!>!

This function is deprecated.

File!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

Executor!

This function is deprecated. Deprecated in Java

Looper!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

File!

This function is deprecated. Deprecated in Java

Array<File!>!

This function is deprecated. Deprecated in Java

String!

This function is deprecated. Deprecated in Java

String!

This function is deprecated. Deprecated in Java

PackageManager!

This function is deprecated. Deprecated in Java

String!

This function is deprecated. Deprecated in Java

String!

This function is deprecated. Deprecated in Java

ContextParams!

This function is deprecated. Deprecated in Java

Resources!

This function is deprecated. Deprecated in Java

SharedPreferences!
getSharedPreferences(name: String!, mode: Int)

This function is deprecated. Deprecated in Java

Any!

This function is deprecated. Deprecated in Java

String!
getSystemServiceName(serviceClass: Class<*>!)

This function is deprecated. Deprecated in Java

Resources.Theme!

This function is deprecated. Deprecated in Java

Drawable!

This function is deprecated.

Int

This function is deprecated.

Int

This function is deprecated.

Unit
grantUriPermission(toPackage: String!, uri: Uri!, modeFlags: Int)

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Boolean
moveDatabaseFrom(sourceContext: Context!, name: String!)

This function is deprecated. Deprecated in Java

Boolean
moveSharedPreferencesFrom(sourceContext: Context!, name: String!)

This function is deprecated. Deprecated in Java

FileInputStream!

This function is deprecated. Deprecated in Java

FileOutputStream!
openFileOutput(name: String!, mode: Int)

This function is deprecated. Deprecated in Java

SQLiteDatabase!
openOrCreateDatabase(
    name: String!,
    mode: Int,
    factory: SQLiteDatabase.CursorFactory!
)

This function is deprecated. Deprecated in Java

Drawable!

This function is deprecated.

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Intent!

This function is deprecated. Deprecated in Java

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated. Deprecated in Java

Unit
revokeUriPermission(uri: Uri!, modeFlags: Int)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
sendOrderedBroadcast(
    intent: Intent!,
    initialCode: Int,
    receiverPermission: String!,
    receiverAppOp: String!,
    resultReceiver: BroadcastReceiver!,
    scheduler: Handler!,
    initialData: String!,
    initialExtras: Bundle!,
    options: Bundle!
)

This function is deprecated. Deprecated in Java

Unit
sendOrderedBroadcastAsUser(
    intent: Intent!,
    user: UserHandle!,
    receiverPermission: String!,
    resultReceiver: BroadcastReceiver!,
    scheduler: Handler!,
    initialCode: Int,
    initialData: String!,
    initialExtras: Bundle!
)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
sendStickyOrderedBroadcast(
    intent: Intent!,
    resultReceiver: BroadcastReceiver!,
    scheduler: Handler!,
    initialCode: Int,
    initialData: String!,
    initialExtras: Bundle!
)

This function is deprecated.

Unit
sendStickyOrderedBroadcastAsUser(
    intent: Intent!,
    user: UserHandle!,
    resultReceiver: BroadcastReceiver!,
    scheduler: Handler!,
    initialCode: Int,
    initialData: String!,
    initialExtras: Bundle!
)

This function is deprecated.

Unit
setTheme(resid: Int)

This function is deprecated. Deprecated in Java

Unit
setWallpaper(bitmap: Bitmap!)

This function is deprecated.

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

ComponentName!

This function is deprecated. Deprecated in Java

Boolean
startInstrumentation(
    className: ComponentName!,
    profileFile: String!,
    arguments: Bundle!
)

This function is deprecated. Deprecated in Java

Unit
startIntentSender(
    intent: IntentSender!,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)

This function is deprecated. Deprecated in Java

ComponentName!
startService(service: Intent!)

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
updateServiceGroup(conn: ServiceConnection!, group: Int, importance: Int)

This function is deprecated. Deprecated in Java

From android.app.Service
Unit

This function is deprecated. Deprecated in Java

Application!

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated.

Unit
onRebind(intent: Intent!)

This function is deprecated. Deprecated in Java

Unit
onStart(intent: Intent!, startId: Int)

This function is deprecated.

Int
onStartCommand(intent: Intent!, flags: Int, startId: Int)

This function is deprecated. Deprecated in Java

Unit
onTaskRemoved(rootIntent: Intent!)

This function is deprecated. Deprecated in Java

Unit
onTimeout(startId: Int)

This function is deprecated. Deprecated in Java

Unit
onTrimMemory(level: Int)

This function is deprecated. Deprecated in Java

Boolean
onUnbind(intent: Intent!)

This function is deprecated. Deprecated in Java

Unit
startForeground(id: Int, notification: Notification!)

This function is deprecated. Deprecated in Java

Unit
stopForeground(removeNotification: Boolean)

This function is deprecated.

Unit

This function is deprecated. Deprecated in Java

Boolean
stopSelfResult(startId: Int)

This function is deprecated. Deprecated in Java

Constants

SERVICE_INTERFACE

Added in 1.1.0
Deprecated in 1.8.0
const val SERVICE_INTERFACE = "android.media.browse.MediaBrowserService": String!

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

Public constructors

MediaBrowserServiceCompat

Added in 1.1.0
Deprecated in 1.8.0
MediaBrowserServiceCompat()

Public functions

dump

Added in 1.1.0
Deprecated in 1.8.0
fun dump(fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!): Unit

getBrowserRootHints

Added in 1.1.0
Deprecated in 1.8.0
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.

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
fun getCurrentBrowserInfo(): MediaSessionManager.RemoteUserInfo

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
fun getSessionToken(): MediaSessionCompat.Token?

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
fun notifyChildrenChanged(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

Added in 1.1.0
Deprecated in 1.8.0
fun notifyChildrenChanged(parentId: String, 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

Added in 1.1.0
Deprecated in 1.8.0
fun onBind(intent: Intent!): IBinder!

onCreate

fun onCreate(): Unit

onCustomAction

Added in 1.1.0
Deprecated in 1.8.0
fun onCustomAction(
    action: String,
    extras: Bundle!,
    result: MediaBrowserServiceCompat.Result<Bundle!>
): Unit

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
action: String

The custom action sent from the media browser.

extras: Bundle!

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

result: MediaBrowserServiceCompat.Result<Bundle!>

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

onDestroy

@CallSuper
@MainThread
fun onDestroy(): Unit

onGetRoot

Added in 1.1.0
Deprecated in 1.8.0
abstract fun onGetRoot(clientPackageName: String, clientUid: Int, rootHints: Bundle?): MediaBrowserServiceCompat.BrowserRoot?

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.

Returns
MediaBrowserServiceCompat.BrowserRoot?

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

onLoadChildren

Added in 1.1.0
Deprecated in 1.8.0
abstract fun onLoadChildren(
    parentId: String,
    result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>
): Unit

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
parentId: String

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

result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>

The Result to send the list of children to.

onLoadChildren

Added in 1.1.0
Deprecated in 1.8.0
fun onLoadChildren(
    parentId: String,
    result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>,
    options: Bundle
): Unit

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
parentId: String

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

result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>

The Result to send the list of children to.

options: Bundle

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
fun onLoadItem(
    itemId: String!,
    result: MediaBrowserServiceCompat.Result<MediaBrowserCompat.MediaItem!>
): Unit

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
itemId: String!

The id for the specific MediaBrowserCompat.MediaItem.

result: MediaBrowserServiceCompat.Result<MediaBrowserCompat.MediaItem!>

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
fun onSearch(
    query: String,
    extras: Bundle!,
    result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>
): Unit

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
query: String

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

extras: Bundle!

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

result: MediaBrowserServiceCompat.Result<(Mutable)List<MediaBrowserCompat.MediaItem!>!>

The Result to send the search result.

setSessionToken

Added in 1.1.0
Deprecated in 1.8.0
fun setSessionToken(token: MediaSessionCompat.Token!): Unit

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
token: MediaSessionCompat.Token!

The token for the service's MediaSessionCompat.