# MediaSessionService

Artifact: [androidx.media3:media3-session](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/session/MediaSessionService.java+class:androidx.media3.session.MediaSessionService)

*** ** * ** ***


```
abstract class MediaSessionService : LifecycleService
```

<br />

|---|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||||
| ↳ | [android.content.Context](https://developer.android.com/reference/android/content/Context.html) |||||
|   | ↳ | [android.content.ContextWrapper](https://developer.android.com/reference/android/content/ContextWrapper.html) ||||
|   |   | ↳ | [android.app.Service](https://developer.android.com/reference/android/app/Service.html) |||
|   |   |   | ↳ | [androidx.lifecycle.LifecycleService](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleService) ||
|   |   |   |   | ↳ | [androidx.media3.session.MediaSessionService](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService) |

Known direct subclasses [MediaLibraryService](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService` | Superclass to be extended by services hosting `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession`. |

*** ** * ** ***

Superclass to be extended by services hosting `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession`.

It's highly recommended for an app to use this class if media playback should continue while in the background. The service allows other apps to know that your app supports `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` even when your app isn't running. This way, a user voice command may be able to start your app to play media.

To extend this class, declare the intent filter in your `AndroidManifest.xml`:

```kotlin
<service
  android:name="NameOfYourService"
  android:foregroundServiceType="mediaPlayback"
  android:exported="true">
  <intent-filter>
    <action android:name="androidx.media3.session.MediaSessionService"/>
  </intent-filter>
</service>
```

You may also declare the action `android.media.browse.MediaBrowserService` for compatibility with `android.support.v4.media.MediaBrowserCompat`. This service can handle the case automatically.

It's recommended for an app to have a single service declared in the manifest. Otherwise, your app might be shown twice in the list of the controller apps, or another app might fail to pick the right service when it wants to start a playback on this app. If you want to provide multiple sessions, take a look at [Supporting Multiple Sessions](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#MultipleSessions).

Topics covered here:

1. [Service Lifecycle](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#ServiceLifecycle)
2. [Supporting Multiple Sessions](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#MultipleSessions)
3. [Backward Interoperability](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#BackwardCompatibility)

## Service Lifecycle

A media session service is a bound service and its [foreground service type](https://developer.android.com/guide/topics/manifest/service-element#foregroundservicetype) must include *mediaPlayback* . When a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaController` is created for the service, the controller binds to the service. `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)` will be called from `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onBind(android.content.Intent)`.

After binding, the session's `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.Callback#onConnectAsync(androidx.media3.session.MediaSession,androidx.media3.session.MediaSession.ControllerInfo)` will be called to accept or reject the connection request from the controller. If it's accepted, the controller will be available and keep the binding. If it's rejected, the controller will unbind.

`https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession,boolean)` will be called whenever a notification needs to be shown, updated or cancelled. The default implementation will display notifications using a default UI or using a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaNotification.Provider` that's set with `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setMediaNotificationProvider(androidx.media3.session.MediaNotification.Provider)`. In addition, when playback starts, the service will become a [foreground service](https://developer.android.com/guide/components/foreground-services). It's required to keep the playback after the controller is destroyed. The service will become a background service when all playbacks are stopped. Apps targeting `SDK_INT >= 28` must request the permission, `https://developer.android.com/reference/android/Manifest.permission.html#FOREGROUND_SERVICE`, in order to make the service foreground. You can control when to show or hide notifications by overriding `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession,boolean)`. In this case, you must also start or stop the service from the foreground, when playback starts or stops respectively.

The service will be destroyed when all sessions are `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaController#release()`, or no controller is binding to the service while the service is in the background.

## Supporting Multiple Sessions

Generally, multiple sessions aren't necessary for most media apps. One exception is if your app can play multiple media contents at the same time, but only for playback of video-only media or remote playback, since the [audio focus policy](https://developer.android.com/media/optimize/audio-focus) recommends not playing multiple audio contents at the same time. Also, keep in mind that multiple media sessions would make Android Auto and Bluetooth devices with a display to show your apps multiple times, because they list up media sessions, not media apps.

However, if you're capable of handling multiple playbacks and want to keep their sessions while the app is in the background, create multiple sessions and add them to this service with `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)`.

Note that a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaController` can be created with `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionToken` to connect to a session in this service. In that case, `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)` will be called to decide which session to handle the connection request. Pick the best session among the added sessions, or create a new session and return it from `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`.

## Backward Interoperability

When a legacy controller (such as `
android.support.v4.media.session.MediaControllerCompat`) connects, it connects using the session token published by the underlying platform session rather than binding directly to `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService`.

When a legacy media browser (such as `android.support.v4.media.MediaBrowserCompat`) binds to the service using the `android.media.browse.MediaBrowserService` action, `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)` is called with a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo` whose package name is `https://developer.android.com/reference/android/service/media/MediaBrowserService.html#SERVICE_INTERFACE`. Returning a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` allows the legacy browser to connect and control playback, but media browsing operations are not supported. If media browsing is required, extend `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService` and return a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession`.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi interface https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.Listener` Listener for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService`. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/kotlin/androidx/annotation/IntDef(value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.ShowNotificationForIdlePlayerMode` The behavior for showing notifications when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` is in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()`. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#CONNECTION_HINT_KEY_CONTROLLER_INFO_TYPE() = "androidx.media3.session.hint.controller_info_type"` Key for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` to hint the type of a fallback controller. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#CONNECTION_HINT_KEY_INTENT_EXTRAS() = "androidx.media3.session.hint.intent_extras"` Key for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` to hint the extras of the `https://developer.android.com/reference/android/content/Intent.html` of the event that created a fallback controller. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#CONNECTION_HINT_KEY_SESSION_ID() = "androidx.media3.session.hint.session_id"` Key for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` to hint the session URI for which a session is requested. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#DEFAULT_FOREGROUND_SERVICE_TIMEOUT_MS() = 600000` The default timeout for a session to stay in a foreground service state after it paused, stopped, failed or ended. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#SERVICE_INTERFACE() = "androidx.media3.session.MediaSessionService"` The action for `https://developer.android.com/reference/android/content/Intent.html` filter that must be declared by the service. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#SHOW_NOTIFICATION_FOR_IDLE_PLAYER_AFTER_STOP_OR_ERROR() = 3` Shows a notification when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` is in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()` due to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#stop()` or an error, has media, and the notification wasn't explicitly dismissed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#SHOW_NOTIFICATION_FOR_IDLE_PLAYER_ALWAYS() = 1` Always show a notification when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` is in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()`, has media, and the notification wasn't explicitly dismissed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#SHOW_NOTIFICATION_FOR_IDLE_PLAYER_NEVER() = 2` Never show a notification when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` is in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#MediaSessionService()()` Creates a service. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)(session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!)` Adds a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` to this service. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#clearListener()()` Clears the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.Listener`. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#getSessions()()` Returns the list of `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` that you've added to this service via `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)` or `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#isPlaybackOngoing()()` Returns whether there is a session with ongoing user-engaged playback that is run in a foreground service. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#isSessionAdded(androidx.media3.session.MediaSession)(session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!)` Returns whether `session` has been added to this service via `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)` or `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`. |
| `https://developer.android.com/reference/android/os/IBinder.html?` | `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onBind(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html?)` Called when a component is about to bind to the service. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onCreate()()` Called when the service is created. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onDestroy()()` Called when the service is no longer used and is being removed. |
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession?` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)(controllerInfo: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo!)` Called when a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaController` is created with this service's `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionToken`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onStartCommand(android.content.Intent,int,int)(intent: https://developer.android.com/reference/android/content/Intent.html?, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, startId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Called when a component calls `https://developer.android.com/reference/android/content/Context.html#startService(android.content.Intent)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onTaskRemoved(android.content.Intent)(rootIntent: https://developer.android.com/reference/android/content/Intent.html?)` This method can be overridden to customize the behavior of when the app is dismissed from the recent apps. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[onUpdateNotification](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession))(session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!)` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession,boolean)` instead. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession,boolean)( session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!, startInForegroundRequired: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Called when a notification needs to be updated. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/java/lang/Void.html!>!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotificationAsync(androidx.media3.session.MediaSession,boolean)( session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!, startInForegroundRequired: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Called when a notification needs to be updated. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#pauseAllPlayersAndStopSelf()()` Pauses the player of each session managed by the service, ensures the foreground service is stopped, and calls `https://developer.android.com/reference/android/app/Service.html#stopSelf()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#removeSession(androidx.media3.session.MediaSession)(session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!)` Removes a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` from this service. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setForegroundServiceTimeoutMs(long)(foregroundServiceTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the timeout for a session to stay in a foreground service state after it paused, stopped, failed or ended. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setListener(androidx.media3.session.MediaSessionService.Listener)(listener: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.Listener!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.Listener`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setShowNotificationForIdlePlayer(int)( @https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.ShowNotificationForIdlePlayerMode showNotificationForIdlePlayerMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets whether and when a notification for a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()` should be shown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#triggerNotificationUpdate()()` Manually trigger a notification update. |

| ### Protected functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setMediaNotificationProvider(androidx.media3.session.MediaNotification.Provider)( mediaNotificationProvider: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaNotification.Provider! )` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaNotification.Provider` to customize notifications. |

### Inherited Constants

From [android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_BACKGROUND = 40` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_COMPLETE = 80`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_MODERATE = 60`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_CRITICAL = 15`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_LOW = 10`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_MODERATE = 5`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_UI_HIDDEN = 20` From [android.content.Context](https://developer.android.com/reference/android/content/Context.html) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#ACCESSIBILITY_SERVICE = "accessibility"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#ACCOUNT_SERVICE = "account"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#ACTIVITY_SERVICE = "activity"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#ADVANCED_PROTECTION_SERVICE = "advanced_protection"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#ALARM_SERVICE = "alarm"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#APPWIDGET_SERVICE = "appwidget"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#APP_FUNCTION_SERVICE = "app_function"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#APP_OPS_SERVICE = "appops"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#APP_SEARCH_SERVICE = "app_search"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#AUDIO_SERVICE = "audio"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#AUTOFILL_SERVICE = "autofill"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#BATTERY_SERVICE = "batterymanager"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_ABOVE_CLIENT = 8` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_ADJUST_WITH_ACTIVITY = 128` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_ALLOW_ACTIVITY_STARTS = 512` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_ALLOW_OOM_MANAGEMENT = 16` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_AUTO_CREATE = 1` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_DEBUG_UNBIND = 2` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_EXTERNAL_SERVICE = -2147483648` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_EXTERNAL_SERVICE_LONG = 4611686018427387904` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_IMPORTANT = 64` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_INCLUDE_CAPABILITIES = 4096` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_NOT_FOREGROUND = 4` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_NOT_PERCEPTIBLE = 256` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_PACKAGE_ISOLATED_PROCESS = 16384` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_SHARED_ISOLATED_PROCESS = 8192` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#BIND_WAIVE_PRIORITY = 32` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#BIOMETRIC_SERVICE = "biometric"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#BLOB_STORE_SERVICE = "blob_store"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#BLUETOOTH_SERVICE = "bluetooth"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#BUGREPORT_SERVICE = "bugreport"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CAMERA_SERVICE = "camera"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CAPTIONING_SERVICE = "captioning"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CARRIER_CONFIG_SERVICE = "carrier_config"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CHOOSER_SERVICE = "chooser"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CLIPBOARD_SERVICE = "clipboard"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#COMPANION_DEVICE_SERVICE = "companiondevice"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CONNECTIVITY_DIAGNOSTICS_SERVICE = "connectivity_diagnostics"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CONNECTIVITY_SERVICE = "connectivity"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CONSUMER_IR_SERVICE = "consumer_ir"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CONTACT_KEYS_SERVICE = "contact_keys"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#CONTEXT_IGNORE_SECURITY = 2` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#CONTEXT_INCLUDE_CODE = 1` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#CONTEXT_RESTRICTED = 4` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CREDENTIAL_SERVICE = "credential"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#CROSS_PROFILE_APPS_SERVICE = "crossprofileapps"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#DEVICE_ID_DEFAULT = 0` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#DEVICE_ID_INVALID = -1` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#DEVICE_LOCK_SERVICE = "device_lock"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#DEVICE_POLICY_SERVICE = "device_policy"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#DISPLAY_HASH_SERVICE = "display_hash"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#DISPLAY_SERVICE = "display"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#DOMAIN_VERIFICATION_SERVICE = "domain_verification"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#DOWNLOAD_SERVICE = "download"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#DROPBOX_SERVICE = "dropbox"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#EUICC_SERVICE = "euicc"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#FILE_INTEGRITY_SERVICE = "file_integrity"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#FILE_SERVICE = "file"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#GAME_SERVICE = "game"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#GRAMMATICAL_INFLECTION_SERVICE = "grammatical_inflection"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#HARDWARE_PROPERTIES_SERVICE = "hardware_properties"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#HEALTHCONNECT_SERVICE = "healthconnect"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#INPUT_METHOD_SERVICE = "input_method"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#INPUT_SERVICE = "input"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#IPSEC_SERVICE = "ipsec"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#JOB_SCHEDULER_SERVICE = "jobscheduler"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#KEYGUARD_SERVICE = "keyguard"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#KEYSTORE_SERVICE = "keystore"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#LAUNCHER_APPS_SERVICE = "launcherapps"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#LAYOUT_INFLATER_SERVICE = "layout_inflater"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#LOCALE_SERVICE = "locale"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#LOCATION_SERVICE = "location"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#MEDIA_COMMUNICATION_SERVICE = "media_communication"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#MEDIA_METRICS_SERVICE = "media_metrics"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#MEDIA_PROJECTION_SERVICE = "media_projection"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#MEDIA_QUALITY_SERVICE = "media_quality"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#MEDIA_ROUTER_SERVICE = "media_router"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#MEDIA_SESSION_SERVICE = "media_session"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#MIDI_SERVICE = "midi"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#MODE_APPEND = 32768` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#MODE_ENABLE_WRITE_AHEAD_LOGGING = 8` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#MODE_MULTI_PROCESS = 4`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#MODE_NO_LOCALIZED_COLLATORS = 16` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#MODE_PRIVATE = 0` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#MODE_WORLD_READABLE = 1`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#MODE_WORLD_WRITEABLE = 2`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#NETWORK_STATS_SERVICE = "netstats"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#NFC_SERVICE = "nfc"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#NOTIFICATION_SERVICE = "notification"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#NPU_SERVICE = "npu"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#NSD_SERVICE = "servicediscovery"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#OVERLAY_SERVICE = "overlay"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#PCC_SANDBOX_SERVICE = "pcc_sandbox"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#PEOPLE_SERVICE = "people"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#PERFORMANCE_HINT_SERVICE = "performance_hint"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#POWER_SERVICE = "power"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#PRINT_SERVICE = "print"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#PROFILING_SERVICE = "profiling"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#RECEIVER_EXPORTED = 2` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#RECEIVER_NOT_EXPORTED = 4` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#RECEIVER_VISIBLE_TO_INSTANT_APPS = 1` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#RESTRICTIONS_SERVICE = "restrictions"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#ROLE_SERVICE = "role"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#SATELLITE_SERVICE = "satellite"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#SEARCH_SERVICE = "search"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#SECURITY_STATE_SERVICE = "security_state"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#SENSOR_SERVICE = "sensor"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#SERIAL_SERVICE = "serial"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#SHORTCUT_SERVICE = "shortcut"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#STATUS_BAR_SERVICE = "statusbar"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#STORAGE_SERVICE = "storage"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#STORAGE_STATS_SERVICE = "storagestats"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#SYSTEM_HEALTH_SERVICE = "systemhealth"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TELECOM_SERVICE = "telecom"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_IMS_SERVICE = "telephony_ims"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_PHONE_NUMBER_SERVICE = "telephony_phone_number"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_SERVICE = "phone"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TETHERING_SERVICE = "tethering"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TEXT_CLASSIFICATION_SERVICE = "textclassification"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TEXT_SERVICES_MANAGER_SERVICE = "textservices"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TV_AD_SERVICE = "tv_ad"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TV_INPUT_SERVICE = "tv_input"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#TV_INTERACTIVE_APP_SERVICE = "tv_interactive_app"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#UI_MODE_SERVICE = "uimode"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#USAGE_STATS_SERVICE = "usagestats"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#USB_SERVICE = "usb"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#USER_SERVICE = "user"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#VIBRATOR_MANAGER_SERVICE = "vibrator_manager"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#VIBRATOR_SERVICE = "vibrator"`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#VIRTUAL_DEVICE_SERVICE = "virtualdevice"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#VPN_MANAGEMENT_SERVICE = "vpn_management"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#WALLPAPER_SERVICE = "wallpaper"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#WEB_APP_SERVICE = "web_app"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#WIFI_AWARE_SERVICE = "wifiaware"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#WIFI_P2P_SERVICE = "wifip2p"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#WIFI_RTT_RANGING_SERVICE = "wifirtt"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#WIFI_SERVICE = "wifi"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#WINDOW_SERVICE = "window"` From [android.app.Service](https://developer.android.com/reference/android/app/Service.html) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#START_CONTINUATION_MASK = 15` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#START_FLAG_REDELIVERY = 1` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#START_FLAG_RETRY = 2` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#START_NOT_STICKY = 2` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#START_REDELIVER_INTENT = 3` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#START_STICKY = 1` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#START_STICKY_COMPATIBILITY = 0` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#STOP_FOREGROUND_DETACH = 2` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#STOP_FOREGROUND_LEGACY = 0`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#STOP_FOREGROUND_REMOVE = 1`

### Inherited functions

From [android.content.Context](https://developer.android.com/reference/android/content/Context.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/Context.html#getColor(int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/content/res/ColorStateList.html!` `https://developer.android.com/reference/android/content/Context.html#getColorStateList(int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/content/Context.html#getDrawable(int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/Context.html#getString(int)(resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `T!` `<T> https://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.Class&lt;T&gt;)(serviceClass: https://developer.android.com/reference/java/lang/Class.html<T!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` `https://developer.android.com/reference/android/content/Context.html#getText(int)(resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/content/Context.BindServiceFlags.html!` `https://developer.android.com/reference/android/content/Context.html#getUpdateableFlags()()` `https://developer.android.com/reference/android/content/res/TypedArray.html!` `https://developer.android.com/reference/android/content/Context.html#obtainStyledAttributes(android.util.AttributeSet, int[])(set: https://developer.android.com/reference/android/util/AttributeSet.html!, attrs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/Context.html#revokeSelfPermissionOnKill(java.lang.String)(permName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/Context.html#sendBroadcastWithMultiplePermissions(android.content.Intent, java.lang.String[])(
intent: https://developer.android.com/reference/android/content/Intent.html!,
receiverPermissions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!
)` From [android.content.ContextWrapper](https://developer.android.com/reference/android/content/ContextWrapper.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindIsolatedService(android.content.Intent, int, java.lang.String, java.util.concurrent.Executor, android.content.ServiceConnection)(
service: https://developer.android.com/reference/android/content/Intent.html!,
flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
instanceName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!,
conn: https://developer.android.com/reference/android/content/ServiceConnection.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindService(android.content.Intent, android.content.Context.BindServiceFlags, java.util.concurrent.Executor, android.content.ServiceConnection)(
service: https://developer.android.com/reference/android/content/Intent.html!,
flags: https://developer.android.com/reference/android/content/Context.BindServiceFlags.html!,
executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!,
conn: https://developer.android.com/reference/android/content/ServiceConnection.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindServiceAsUser(android.content.Intent, android.content.ServiceConnection, android.content.Context.BindServiceFlags, android.os.UserHandle)(
service: https://developer.android.com/reference/android/content/Intent.html!,
conn: https://developer.android.com/reference/android/content/ServiceConnection.html!,
flags: https://developer.android.com/reference/android/content/Context.BindServiceFlags.html!,
user: https://developer.android.com/reference/android/os/UserHandle.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingOrSelfPermission(java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingOrSelfUriPermission(android.net.Uri, int)(uri: https://developer.android.com/reference/android/net/Uri.html!, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingOrSelfUriPermissions(java.util.List&lt;android.net.Uri&gt;, int)(
uris: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html!>!,
modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingPermission(java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingUriPermission(android.net.Uri, int)(uri: https://developer.android.com/reference/android/net/Uri.html!, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingUriPermissions(java.util.List&lt;android.net.Uri&gt;, int)(uris: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html!>!, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkContentUriPermissionFull(android.net.Uri, int, int, int)(uri: https://developer.android.com/reference/android/net/Uri.html!, pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkPermission(java.lang.String, int, int)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkSelfPermission(java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkUriPermission(android.net.Uri, int, int, int)(uri: https://developer.android.com/reference/android/net/Uri.html!, pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkUriPermissions(java.util.List&lt;android.net.Uri&gt;, int, int, int)(
uris: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html!>!,
pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#clearWallpaper()()`

**This function is deprecated.**
`https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createAttributionContext(java.lang.String)(attributionTag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createConfigurationContext(android.content.res.Configuration)(overrideConfiguration: https://developer.android.com/reference/android/content/res/Configuration.html!)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createContext(android.content.ContextParams)(contextParams: https://developer.android.com/reference/android/content/ContextParams.html!)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createContextForSplit(java.lang.String)(splitName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createDeviceContext(int)(deviceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createDeviceProtectedStorageContext()()` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createDisplayContext(android.view.Display)(display: https://developer.android.com/reference/android/view/Display.html!)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createPackageContext(java.lang.String, int)(packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#createWindowContext(android.view.Display, int, android.os.Bundle)(display: https://developer.android.com/reference/android/view/Display.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, options: https://developer.android.com/reference/android/os/Bundle.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#databaseList()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#deleteDatabase(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#deleteFile(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#deleteSharedPreferences(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingOrSelfPermission(java.lang.String, java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingOrSelfUriPermission(android.net.Uri, int, java.lang.String)(
uri: https://developer.android.com/reference/android/net/Uri.html!,
modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingPermission(java.lang.String, java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingUriPermission(android.net.Uri, int, java.lang.String)(uri: https://developer.android.com/reference/android/net/Uri.html!, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforcePermission(java.lang.String, int, int, java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceUriPermission(android.net.Uri, int, int, int, java.lang.String)(
uri: https://developer.android.com/reference/android/net/Uri.html!,
pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#fileList()()` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getApplicationContext()()` `https://developer.android.com/reference/android/content/pm/ApplicationInfo.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getApplicationInfo()()` `https://developer.android.com/reference/android/content/res/AssetManager.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAssets()()` `https://developer.android.com/reference/android/content/AttributionSource.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAttributionSource()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAttributionTag()()` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getBaseContext()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getCacheDir()()` `https://developer.android.com/reference/java/lang/ClassLoader.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getClassLoader()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getCodeCacheDir()()` `https://developer.android.com/reference/android/content/ContentResolver.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getContentResolver()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDataDir()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDatabasePath(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDeviceId()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDir(java.lang.String, int)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/view/Display.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDisplay()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalCacheDir()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/io/File.html!>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalCacheDirs()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalFilesDir(java.lang.String)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/io/File.html!>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalFilesDirs(java.lang.String)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/io/File.html!>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalMediaDirs()()`

**This function is deprecated.**
`https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getFileStreamPath(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getFilesDir()()` `https://developer.android.com/reference/java/util/concurrent/Executor.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getMainExecutor()()` `https://developer.android.com/reference/android/os/Looper.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getMainLooper()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getNoBackupFilesDir()()` `https://developer.android.com/reference/java/io/File.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getObbDir()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/io/File.html!>!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getObbDirs()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getOpPackageName()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageCodePath()()` `https://developer.android.com/reference/android/content/pm/PackageManager.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageManager()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageName()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageResourcePath()()` `https://developer.android.com/reference/android/content/ContextParams.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getParams()()` `https://developer.android.com/reference/android/content/res/Resources.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getResources()()` `https://developer.android.com/reference/android/content/SharedPreferences.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getSharedPreferences(java.lang.String, int)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getSystemService(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getSystemServiceName(java.lang.Class&lt;?&gt;)(serviceClass: https://developer.android.com/reference/java/lang/Class.html<*>!)` `https://developer.android.com/reference/android/content/res/Resources.Theme.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getTheme()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#getWallpaper()()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getWallpaperDesiredMinimumHeight()()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getWallpaperDesiredMinimumWidth()()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#grantUriPermission(java.lang.String, android.net.Uri, int)(toPackage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, uri: https://developer.android.com/reference/android/net/Uri.html!, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#isDeviceProtectedStorage()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#isRestricted()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#isUiContext()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#moveDatabaseFrom(android.content.Context, java.lang.String)(sourceContext: https://developer.android.com/reference/android/content/Context.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#moveSharedPreferencesFrom(android.content.Context, java.lang.String)(sourceContext: https://developer.android.com/reference/android/content/Context.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://developer.android.com/reference/java/io/FileInputStream.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#openFileInput(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://developer.android.com/reference/java/io/FileOutputStream.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#openFileOutput(java.lang.String, int)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase.CursorFactory)(
name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
factory: https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory.html!
)` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#peekWallpaper()()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#rebindService(android.content.ServiceConnection, android.content.Context.BindServiceFlags)(conn: https://developer.android.com/reference/android/content/ServiceConnection.html!, flags: https://developer.android.com/reference/android/content/Context.BindServiceFlags.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerComponentCallbacks(android.content.ComponentCallbacks)(callback: https://developer.android.com/reference/android/content/ComponentCallbacks.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerDeviceIdChangeListener(java.util.concurrent.Executor, java.util.function.IntConsumer)(executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!, listener: https://developer.android.com/reference/java/util/function/IntConsumer.html!)` `https://developer.android.com/reference/android/content/Intent.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)(receiver: https://developer.android.com/reference/android/content/BroadcastReceiver.html!, filter: https://developer.android.com/reference/android/content/IntentFilter.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#removeStickyBroadcast(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle)(intent: https://developer.android.com/reference/android/content/Intent.html!, user: https://developer.android.com/reference/android/os/UserHandle.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#revokeSelfPermissionsOnKill(java.util.Collection&lt;java.lang.String&gt;)(permissions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#revokeUriPermission(android.net.Uri, int)(uri: https://developer.android.com/reference/android/net/Uri.html!, modeFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcast(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcastAsUser(android.content.Intent, android.os.UserHandle)(intent: https://developer.android.com/reference/android/content/Intent.html!, user: https://developer.android.com/reference/android/os/UserHandle.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcast(android.content.Intent, int, java.lang.String, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, java.lang.String, android.os.Bundle, android.os.Bundle)(
intent: https://developer.android.com/reference/android/content/Intent.html!,
initialCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
receiverPermission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
receiverAppOp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
resultReceiver: https://developer.android.com/reference/android/content/BroadcastReceiver.html!,
scheduler: https://developer.android.com/reference/android/os/Handler.html!,
initialData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
initialExtras: https://developer.android.com/reference/android/os/Bundle.html!,
options: https://developer.android.com/reference/android/os/Bundle.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(
intent: https://developer.android.com/reference/android/content/Intent.html!,
user: https://developer.android.com/reference/android/os/UserHandle.html!,
receiverPermission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
resultReceiver: https://developer.android.com/reference/android/content/BroadcastReceiver.html!,
scheduler: https://developer.android.com/reference/android/os/Handler.html!,
initialCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
initialData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
initialExtras: https://developer.android.com/reference/android/os/Bundle.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyBroadcast(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle)(intent: https://developer.android.com/reference/android/content/Intent.html!, user: https://developer.android.com/reference/android/os/UserHandle.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyOrderedBroadcast(android.content.Intent, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(
intent: https://developer.android.com/reference/android/content/Intent.html!,
resultReceiver: https://developer.android.com/reference/android/content/BroadcastReceiver.html!,
scheduler: https://developer.android.com/reference/android/os/Handler.html!,
initialCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
initialData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
initialExtras: https://developer.android.com/reference/android/os/Bundle.html!
)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(
intent: https://developer.android.com/reference/android/content/Intent.html!,
user: https://developer.android.com/reference/android/os/UserHandle.html!,
resultReceiver: https://developer.android.com/reference/android/content/BroadcastReceiver.html!,
scheduler: https://developer.android.com/reference/android/os/Handler.html!,
initialCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
initialData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
initialExtras: https://developer.android.com/reference/android/os/Bundle.html!
)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#setTheme(int)(resid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#setWallpaper(android.graphics.Bitmap)(bitmap: https://developer.android.com/reference/android/graphics/Bitmap.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivities(android.content.Intent[])(intents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/Intent.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivity(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)` `https://developer.android.com/reference/android/content/ComponentName.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#startForegroundService(android.content.Intent)(service: https://developer.android.com/reference/android/content/Intent.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#startInstrumentation(android.content.ComponentName, java.lang.String, android.os.Bundle)(
className: https://developer.android.com/reference/android/content/ComponentName.html!,
profileFile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
arguments: https://developer.android.com/reference/android/os/Bundle.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int)(
intent: https://developer.android.com/reference/android/content/IntentSender.html!,
fillInIntent: https://developer.android.com/reference/android/content/Intent.html!,
flagsMask: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
flagsValues: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
extraFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html
)` `https://developer.android.com/reference/android/content/ComponentName.html!` `https://developer.android.com/reference/android/content/ContextWrapper.html#startService(android.content.Intent)(service: https://developer.android.com/reference/android/content/Intent.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#stopService(android.content.Intent)(name: https://developer.android.com/reference/android/content/Intent.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#unbindService(android.content.ServiceConnection)(conn: https://developer.android.com/reference/android/content/ServiceConnection.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#unregisterComponentCallbacks(android.content.ComponentCallbacks)(callback: https://developer.android.com/reference/android/content/ComponentCallbacks.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)(listener: https://developer.android.com/reference/java/util/function/IntConsumer.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#unregisterReceiver(android.content.BroadcastReceiver)(receiver: https://developer.android.com/reference/android/content/BroadcastReceiver.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#updateServiceBindings(java.util.Collection&lt;android.content.Context.UpdateBindingParams&gt;)(
params: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/android/content/Context.UpdateBindingParams.html!>!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#updateServiceGroup(android.content.ServiceConnection, int, int)(conn: https://developer.android.com/reference/android/content/ServiceConnection.html!, group: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, importance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` From [androidx.lifecycle.LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner) `abstract https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle!` `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner#getLifecycle()()`

The `https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle` of this owner.
From [androidx.lifecycle.LifecycleService](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleService) `https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle!` `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleService#getLifecycle()()`

The `https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle` of this owner.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleService#onStart(android.content.Intent,int)(intent: https://developer.android.com/reference/android/content/Intent.html!, startId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
From [android.app.Service](https://developer.android.com/reference/android/app/Service.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#attachBaseContext(android.content.Context)(newBase: https://developer.android.com/reference/android/content/Context.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[])(fd: https://developer.android.com/reference/java/io/FileDescriptor.html!, writer: https://developer.android.com/reference/java/io/PrintWriter.html!, args: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` `https://developer.android.com/reference/android/app/Application.html!` `https://developer.android.com/reference/android/app/Service.html#getApplication()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#getForegroundServiceType()()` `abstract https://developer.android.com/reference/android/os/IBinder.html!` `https://developer.android.com/reference/android/app/Service.html#onBind(android.content.Intent)(p: https://developer.android.com/reference/android/content/Intent.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onConfigurationChanged(android.content.res.Configuration)(newConfig: https://developer.android.com/reference/android/content/res/Configuration.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onCreate()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onDestroy()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onLowMemory()()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onRebind(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onStart(android.content.Intent, int)(intent: https://developer.android.com/reference/android/content/Intent.html!, startId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent, int, int)(intent: https://developer.android.com/reference/android/content/Intent.html!, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, startId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onTimeout(int)(startId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#onTrimMemory(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/app/Service.html#onUnbind(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#startForeground(int, android.app.Notification)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, notification: https://developer.android.com/reference/android/app/Notification.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#stopForeground(boolean)(removeNotification: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/app/Service.html#stopSelf()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/app/Service.html#stopSelfResult(int)(startId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

## Constants

### CONNECTION_HINT_KEY_CONTROLLER_INFO_TYPE

```
@UnstableApi
const val CONNECTION_HINT_KEY_CONTROLLER_INFO_TYPE = "androidx.media3.session.hint.controller_info_type": String!
```

Key for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` to hint the type of a fallback controller.

A fallback controller is created when a media button event starts the service and a session is requested through `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`.

### CONNECTION_HINT_KEY_INTENT_EXTRAS

```
@UnstableApi
const val CONNECTION_HINT_KEY_INTENT_EXTRAS = "androidx.media3.session.hint.intent_extras": String!
```

Key for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` to hint the extras of the `https://developer.android.com/reference/android/content/Intent.html` of the event that created a fallback controller.

A fallback controller is created when a media button event starts the service and a session is requested through `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`.

### CONNECTION_HINT_KEY_SESSION_ID

```
@UnstableApi
const val CONNECTION_HINT_KEY_SESSION_ID = "androidx.media3.session.hint.session_id": String!
```

Key for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` to hint the session URI for which a session is requested. The session URI hint may be unset if no session URI was provided by the media button event.

A fallback controller is created when a media button event starts the service and a session is requested through `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`.

### DEFAULT_FOREGROUND_SERVICE_TIMEOUT_MS

```
@UnstableApi
const val DEFAULT_FOREGROUND_SERVICE_TIMEOUT_MS = 600000: Long
```

The default timeout for a session to stay in a foreground service state after it paused, stopped, failed or ended.

### SERVICE_INTERFACE

```
const val SERVICE_INTERFACE = "androidx.media3.session.MediaSessionService": String!
```

The action for `https://developer.android.com/reference/android/content/Intent.html` filter that must be declared by the service.

### SHOW_NOTIFICATION_FOR_IDLE_PLAYER_AFTER_STOP_OR_ERROR

```
@UnstableApi
const val SHOW_NOTIFICATION_FOR_IDLE_PLAYER_AFTER_STOP_OR_ERROR = 3: Int
```

Shows a notification when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` is in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()` due to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#stop()` or an error, has media, and the notification wasn't explicitly dismissed.

### SHOW_NOTIFICATION_FOR_IDLE_PLAYER_ALWAYS

```
@UnstableApi
const val SHOW_NOTIFICATION_FOR_IDLE_PLAYER_ALWAYS = 1: Int
```

Always show a notification when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` is in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()`, has media, and the notification wasn't explicitly dismissed.

### SHOW_NOTIFICATION_FOR_IDLE_PLAYER_NEVER

```
@UnstableApi
const val SHOW_NOTIFICATION_FOR_IDLE_PLAYER_NEVER = 2: Int
```

Never show a notification when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` is in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()`.

## Public constructors

### MediaSessionService

```
MediaSessionService()
```

Creates a service.

## Public functions

### addSession

```
fun addSession(session: MediaSession!): Unit
```

Adds a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` to this service. This is not necessary for most media apps. See [Supporting Multiple Sessions](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#MultipleSessions) for details.

The added session will be removed automatically `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession#release()`.

This method can be called from any thread.

| Parameters |
|---|---|
| `session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!` | A session to be added. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#removeSession(androidx.media3.session.MediaSession)` |   |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#getSessions()` |   |

### clearListener

```
@UnstableApi
fun clearListener(): Unit
```

Clears the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.Listener`.

This method can be called from any thread.

### getSessions

```
fun getSessions(): (Mutable)List<MediaSession!>!
```

Returns the list of `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` that you've added to this service via `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)` or `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`.

This method can be called from any thread.

### isPlaybackOngoing

```
@UnstableApi
fun isPlaybackOngoing(): Boolean
```

Returns whether there is a session with ongoing user-engaged playback that is run in a foreground service.

It is only possible to terminate the service with `https://developer.android.com/reference/android/app/Service.html#stopSelf()` if this method returns `false`.

Note that sessions are kept in foreground and this method returns `true` for the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setForegroundServiceTimeoutMs(long)` after they paused, stopped, failed or ended. Use `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#pauseAllPlayersAndStopSelf()` to pause all ongoing playbacks immediately and terminate the service.

This method must be called on the main thread.

### isSessionAdded

```
fun isSessionAdded(session: MediaSession!): Boolean
```

Returns whether `session` has been added to this service via `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)` or `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onGetSession(androidx.media3.session.MediaSession.ControllerInfo)`.

This method can be called from any thread.

### onBind

```
@CallSuper
fun onBind(intent: Intent?): IBinder?
```

Called when a component is about to bind to the service.

The default implementation handles the incoming requests from `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaController`. In this case, the intent will have the action `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#SERVICE_INTERFACE()`. Override this method if this service also needs to handle actions other than `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#SERVICE_INTERFACE()`.

This method will be called on the main thread.

### onCreate

```
@CallSuper
fun onCreate(): Unit
```

Called when the service is created.

Override this method if you need your own initialization.

This method will be called on the main thread.

### onDestroy

```
@CallSuper
fun onDestroy(): Unit
```

Called when the service is no longer used and is being removed.

Override this method if you need your own clean up.

This method will be called on the main thread.

### onGetSession

```
abstract fun onGetSession(controllerInfo: MediaSession.ControllerInfo!): MediaSession?
```

Called when a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaController` is created with this service's `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionToken`. Return a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` that the controller will connect to, or `null` to reject the connection request.

Note: This method must not be called directly by app code.

The service automatically maintains the returned sessions. In other words, a session returned by this method will be added to the service, and removed from the service when the session is `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession#release()`. You don't need to manually call `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)` nor `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#removeSession(androidx.media3.session.MediaSession)`.

There are two special cases where the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getPackageName()` returns a non-existent package name:

- When the service is started by a media button event. In such a case the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` are marked with a string bundle entry with key `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#CONNECTION_HINT_KEY_CONTROLLER_INFO_TYPE()` with value `https://developer.android.com/reference/android/content/Intent.html#ACTION_MEDIA_BUTTON`. If the media button intent requests a specific session to be started the requested session ID can be looked up as a string entry with key `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#CONNECTION_HINT_KEY_SESSION_ID()` (optional). If you want to allow the service to be started by media button events, do not return `null`. Note that in such a case the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo` is a placeholder only and does not represent an actual controller that is connected to the service.
- When a legacy `https://developer.android.com/reference/android/media/browse/MediaBrowser.html` or a `
  android.support.v4.media.MediaBrowserCompat` tries to connect, the package name will be `https://developer.android.com/reference/android/service/media/MediaBrowserService.html#SERVICE_INTERFACE`. If you want to allow the service to be bound by the legacy media browsers, do not return `null`. Note that returning a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` allows legacy browsers to control playback, but browsing operations are not supported unless the session is a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession`.

For those special cases, the values returned by `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getUid()` and `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo#getConnectionHints()` have no meaning.

This method will be called on the main thread.

| Parameters |
|---|---|
| `controllerInfo: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.ControllerInfo!` | The information of the controller that is trying to connect. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession?` | A `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` for the controller, or `null` to reject the connection. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession.Builder` |   |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#getSessions()` |   |

### onStartCommand

```
@CallSuper
fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int
```

Called when a component calls `https://developer.android.com/reference/android/content/Context.html#startService(android.content.Intent)`.

The default implementation handles the incoming media button events. In this case, the intent will have the action `https://developer.android.com/reference/android/content/Intent.html#ACTION_MEDIA_BUTTON`. Override this method if this service also needs to handle actions other than `https://developer.android.com/reference/android/content/Intent.html#ACTION_MEDIA_BUTTON`.

This method will be called on the main thread.

### onTaskRemoved

```
fun onTaskRemoved(rootIntent: Intent?): Unit
```

This method can be overridden to customize the behavior of when the app is dismissed from the recent apps.

The default behavior is that if `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#isPlaybackOngoing()`, which means the service is already running in the foreground, and at least one media session `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#isPlaying()`, the service is kept running. Otherwise, playbacks are paused and the service is stopped by calling `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#pauseAllPlayersAndStopSelf()` which terminates the service lifecycle and triggers `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onDestroy()` that an app can override to release the sessions and other resources.

An app can safely override this method without calling super to implement a different behaviour, for instance unconditionally calling `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#pauseAllPlayersAndStopSelf()` to stop the service even when playing. However, if `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#isPlaybackOngoing()`, the service must be terminated otherwise the service will be crashed and restarted by the system.

Note: The service [can't be stopped](https://developer.android.com/develop/background-work/services/bound-services#Lifecycle) until all media controllers have been unbound. Hence, an app needs to release all internal controllers that have connected to the service (for instance from an activity in `Activity.onStop()`). If an app allows external apps to connect a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaController` to the service, these controllers also need to be disconnected. In such a scenario of external bound clients, an app needs to override this method to release the session before calling `https://developer.android.com/reference/android/app/Service.html#stopSelf()`.

### onUpdateNotification

```
fun [onUpdateNotification](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession))(session: MediaSession!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession,boolean)` instead.

### onUpdateNotification

```
fun onUpdateNotification(
    session: MediaSession!,
    startInForegroundRequired: Boolean
): Unit
```

Called when a notification needs to be updated. Override this method to show or cancel your own notifications.

This method is replaced by `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotificationAsync(androidx.media3.session.MediaSession,boolean)` to enable the default implementation of the library to provide multi thread scenarios. An app must not override both methods. While this method is still supported, we recommend migrating to the newer version and return an `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/Futures.html#immediateFuture(V)` if no real async execution is required for your app.

Note: This method must not be called directly by app code.

This method is called whenever the service has detected a change that requires to show, update or cancel a notification with a flag `startInForegroundRequired` suggested by the service whether starting in the foreground is required. The method will be called on the application thread of the app that the service belongs to.

Override this method to create your own notification and customize the foreground handling of your service.

The default implementation will present a default notification or the notification provided by the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaNotification.Provider` that is `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setMediaNotificationProvider(androidx.media3.session.MediaNotification.Provider)` by the app. Further, the service is started in the [foreground](https://developer.android.com/guide/components/foreground-services) when playback is ongoing and put back into background otherwise.

Apps targeting `SDK_INT >= 28` must request the permission, `https://developer.android.com/reference/android/Manifest.permission.html#FOREGROUND_SERVICE`.

This method will be called on the main thread.

| Parameters |
|---|---|
| `session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!` | A session that needs notification update. |
| `startInForegroundRequired: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is required to start in the foreground. |

### onUpdateNotificationAsync

```
@UnstableApi
fun onUpdateNotificationAsync(
    session: MediaSession!,
    startInForegroundRequired: Boolean
): ListenableFuture<Void!>!
```

Called when a notification needs to be updated. Override this method to show or cancel your own notifications.

Note: This method must not be called directly by app code.

This method is called whenever the service has detected a change that requires to show, update or cancel a notification with a flag `startInForegroundRequired` suggested by the service whether starting in the foreground is required. The method will be called on the application thread of the app that the service belongs to.

Override this method to create your own notification and customize the foreground handling of your service.

The default implementation will present a default notification or the notification provided by the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaNotification.Provider` that is `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#setMediaNotificationProvider(androidx.media3.session.MediaNotification.Provider)` by the app. Further, the service is started in the [foreground](https://developer.android.com/guide/components/foreground-services) when playback is ongoing and put back into background otherwise.

Apps targeting `SDK_INT >= 28` must request the permission, `https://developer.android.com/reference/android/Manifest.permission.html#FOREGROUND_SERVICE`.

This method will be called on the main thread.

This method is replacing `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onUpdateNotification(androidx.media3.session.MediaSession,boolean)` to enable the default implementation of the library to provide multi thread setup scenarios. An app must not override both methods.

| Parameters |
|---|---|
| `session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!` | A session that needs notification update. |
| `startInForegroundRequired: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is required to start in the foreground. |

| Returns |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/java/lang/Void.html!>!` | A future that completes when the notification has been updated. |

### pauseAllPlayersAndStopSelf

```
@UnstableApi
fun pauseAllPlayersAndStopSelf(): Unit
```

Pauses the player of each session managed by the service, ensures the foreground service is stopped, and calls `https://developer.android.com/reference/android/app/Service.html#stopSelf()`.

This terminates the service lifecycle and triggers `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onDestroy()` that an app can override to release the sessions and other resources.

This method must be called on the main thread.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getApplicationLooper()` is not the looper of the main thread. In such a case, the service needs to be stopped manually. |

### removeSession

```
fun removeSession(session: MediaSession!): Unit
```

Removes a `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession` from this service. This is not necessary for most media apps. See [Supporting Multiple Sessions](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#MultipleSessions) for details.

This method can be called from any thread.

| Parameters |
|---|---|
| `session: https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSession!` | A session to be removed. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#addSession(androidx.media3.session.MediaSession)` |   |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#getSessions()` |   |

### setForegroundServiceTimeoutMs

```
@UnstableApi
fun setForegroundServiceTimeoutMs(foregroundServiceTimeoutMs: Long): Unit
```

Sets the timeout for a session to stay in a foreground service state after it paused, stopped, failed or ended.

Can only be called once the `https://developer.android.com/reference/android/content/Context.html` of the service is initialized in `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#onCreate()`.

Has no effect on already running timeouts.

The default and maximum value is `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#DEFAULT_FOREGROUND_SERVICE_TIMEOUT_MS()`. If a larger value is provided, it will be clamped down to `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService#DEFAULT_FOREGROUND_SERVICE_TIMEOUT_MS()`.

This method must be called on the main thread.

| Parameters |
|---|---|
| `foregroundServiceTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The timeout in milliseconds. |

### setListener

```
@UnstableApi
fun setListener(listener: MediaSessionService.Listener!): Unit
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.Listener`.

This method can be called from any thread.

### setShowNotificationForIdlePlayer

```
@UnstableApi
fun setShowNotificationForIdlePlayer(
    @MediaSessionService.ShowNotificationForIdlePlayerMode showNotificationForIdlePlayerMode: Int
): Unit
```

Sets whether and when a notification for a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE()` should be shown.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.ShowNotificationForIdlePlayerMode showNotificationForIdlePlayerMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaSessionService.ShowNotificationForIdlePlayerMode`. |

### triggerNotificationUpdate

```
@UnstableApi
fun triggerNotificationUpdate(): Unit
```

Manually trigger a notification update.

In most cases, this should not be required unless an external event that can't be detected by the session itself requires to update the notification.

## Protected functions

### setMediaNotificationProvider

```
@UnstableApi
protected fun setMediaNotificationProvider(
    mediaNotificationProvider: MediaNotification.Provider!
): Unit
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaNotification.Provider` to customize notifications.

This method can be called from any thread.