# DownloadService

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

*** ** * ** ***

<br />

```
@UnstableApi
abstract class DownloadService : Service
```

<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.media3.exoplayer.offline.DownloadService](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService) |

*** ** * ** ***

A `https://developer.android.com/reference/android/app/Service.html` for downloading media.

Apps with target SDK 33 and greater need to add the ` android.permission.POST_NOTIFICATIONS` permission to the manifest and request the permission at runtime before starting downloads. Without that permission granted by the user, notifications posted by this service are not displayed. See [the official UI guide](https://developer.android.com/develop/ui/views/notifications/notification-permission) for more detailed information.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_ADD_DOWNLOAD() = "androidx.media3.exoplayer.downloadService.action.ADD_DOWNLOAD"` Adds a new download. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_INIT() = "androidx.media3.exoplayer.downloadService.action.INIT"` Starts a download service to resume any ongoing downloads. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_PAUSE_DOWNLOADS() = "androidx.media3.exoplayer.downloadService.action.PAUSE_DOWNLOADS"` Pauses all downloads. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_REMOVE_ALL_DOWNLOADS() = "androidx.media3.exoplayer.downloadService.action.REMOVE_ALL_DOWNLOADS"` Removes all downloads. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_REMOVE_DOWNLOAD() = "androidx.media3.exoplayer.downloadService.action.REMOVE_DOWNLOAD"` Removes a download. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_RESUME_DOWNLOADS() = "androidx.media3.exoplayer.downloadService.action.RESUME_DOWNLOADS"` Resumes all downloads except those that have a non-zero `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#stopReason()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_REQUIREMENTS() = "androidx.media3.exoplayer.downloadService.action.SET_REQUIREMENTS"` Sets the requirements that need to be met for downloads to progress. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_STOP_REASON() = "androidx.media3.exoplayer.downloadService.action.SET_STOP_REASON"` Sets the stop reason for one or all downloads. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL() = 1000` Default foreground notification update interval in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE() = 0` Invalid foreground notification id that can be used to run the service in the background. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_CONTENT_ID() = "content_id"` Key for the `https://developer.android.com/reference/java/lang/String.html` content id in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_STOP_REASON()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_REMOVE_DOWNLOAD()` intents. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_DOWNLOAD_REQUEST() = "download_request"` Key for the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest` in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_ADD_DOWNLOAD()` intents. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND() = "foreground"` Key for a boolean extra that can be set on any intent to indicate whether the service was started in the foreground. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_REQUIREMENTS() = "requirements"` Key for the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements` in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_REQUIREMENTS()` intents. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_STOP_REASON() = "stop_reason"` Key for the integer stop reason in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_STOP_REASON()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_ADD_DOWNLOAD()` intents. |

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#DownloadService(int)(foregroundNotificationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a DownloadService. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#DownloadService(int,long)( foregroundNotificationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, foregroundNotificationUpdateInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Creates a DownloadService. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#DownloadService(int,long,java.lang.String,int,int)( foregroundNotificationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, foregroundNotificationUpdateInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, channelId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, channelNameResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, channelDescriptionResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates a DownloadService. |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildAddDownloadIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,androidx.media3.exoplayer.offline.DownloadRequest,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` for adding a new download. |
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildAddDownloadIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,androidx.media3.exoplayer.offline.DownloadRequest,int,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!, stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` for adding a new download. |
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildPauseDownloadsIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` to pause all downloads. |
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildRemoveAllDownloadsIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` for removing all downloads. |
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildRemoveDownloadIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,java.lang.String,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` for removing the download with the `id`. |
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildResumeDownloadsIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` for resuming all downloads. |
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildSetRequirementsIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,androidx.media3.exoplayer.scheduler.Requirements,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, requirements: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` for setting the requirements that need to be met for downloads to progress. |
| `java-static https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#buildSetStopReasonIntent(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,java.lang.String,int,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Builds an `https://developer.android.com/reference/android/content/Intent.html` for setting the stop reason for one or all downloads. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#clearDownloadManagerHelpers()()` Clear all `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService.DownloadManagerHelper` before restarting the service. |
| `https://developer.android.com/reference/android/os/IBinder.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#onBind(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html!)` Throws `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` because this service is not designed to be bound. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#onCreate()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#onDestroy()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#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/kotlin/androidx/media3/exoplayer/offline/DownloadService#onTaskRemoved(android.content.Intent)(rootIntent: 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/kotlin/androidx/media3/exoplayer/offline/DownloadService#onTimeout(int,int)(startId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, fgsType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendAddDownload(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,androidx.media3.exoplayer.offline.DownloadRequest,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and adds a new download. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendAddDownload(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,androidx.media3.exoplayer.offline.DownloadRequest,int,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!, stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and adds a new download. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendPauseDownloads(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and pauses all downloads. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendRemoveAllDownloads(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and removes all downloads. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendRemoveDownload(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,java.lang.String,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and removes a download. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendResumeDownloads(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and resumes all downloads. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendSetRequirements(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,androidx.media3.exoplayer.scheduler.Requirements,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, requirements: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements!, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and sets the requirements that need to be met for downloads to progress. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#sendSetStopReason(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>,java.lang.String,int,boolean)( context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Starts the service if not started already and sets the stop reason for one or all downloads. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#start(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>)(context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!)` Starts a download service to resume any ongoing downloads. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#startForeground(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>)(context: https://developer.android.com/reference/android/content/Context.html!, clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!)` Starts the service in the foreground without adding a new download request. |

| ### Protected functions |
|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#getDownloadManager()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager` to be used to downloaded content. |
| `abstract https://developer.android.com/reference/android/app/Notification.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#getForegroundNotification(java.util.List<androidx.media3.exoplayer.offline.Download>,int)( downloads: (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/exoplayer/offline/Download!>!, @https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements.RequirementFlags notMetRequirements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns a notification to be displayed when this service running in the foreground. |
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#getScheduler()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler` to restart the service when requirements for downloads to continue are met. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#invalidateForegroundNotification()()` Invalidates the current foreground notification and causes `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#getForegroundNotification(java.util.List<androidx.media3.exoplayer.offline.Download>,int)` to be invoked again if the service isn't stopped. |

### 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 [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()()` `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#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/-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

### ACTION_ADD_DOWNLOAD

```
const val ACTION_ADD_DOWNLOAD = "androidx.media3.exoplayer.downloadService.action.ADD_DOWNLOAD": String!
```

Adds a new download. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_DOWNLOAD_REQUEST()` - A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest` defining the download to be added.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_STOP_REASON()` - An initial stop reason for the download. If omitted `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()` is used.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### ACTION_INIT

```
const val ACTION_INIT = "androidx.media3.exoplayer.downloadService.action.INIT": String!
```

Starts a download service to resume any ongoing downloads. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### ACTION_PAUSE_DOWNLOADS

```
const val ACTION_PAUSE_DOWNLOADS = "androidx.media3.exoplayer.downloadService.action.PAUSE_DOWNLOADS": String!
```

Pauses all downloads. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### ACTION_REMOVE_ALL_DOWNLOADS

```
const val ACTION_REMOVE_ALL_DOWNLOADS = "androidx.media3.exoplayer.downloadService.action.REMOVE_ALL_DOWNLOADS": String!
```

Removes all downloads. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### ACTION_REMOVE_DOWNLOAD

```
const val ACTION_REMOVE_DOWNLOAD = "androidx.media3.exoplayer.downloadService.action.REMOVE_DOWNLOAD": String!
```

Removes a download. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_CONTENT_ID()` - The content id of a download to remove.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### ACTION_RESUME_DOWNLOADS

```
const val ACTION_RESUME_DOWNLOADS = "androidx.media3.exoplayer.downloadService.action.RESUME_DOWNLOADS": String!
```

Resumes all downloads except those that have a non-zero `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#stopReason()`. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### ACTION_SET_REQUIREMENTS

```
const val ACTION_SET_REQUIREMENTS = "androidx.media3.exoplayer.downloadService.action.SET_REQUIREMENTS": String!
```

Sets the requirements that need to be met for downloads to progress. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_REQUIREMENTS()` - A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements`.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### ACTION_SET_STOP_REASON

```
const val ACTION_SET_STOP_REASON = "androidx.media3.exoplayer.downloadService.action.SET_STOP_REASON": String!
```

Sets the stop reason for one or all downloads. To clear the stop reason, pass `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()`. Extras:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_CONTENT_ID()` - The content id of a single download to update with the stop reason. If omitted, all downloads will be updated.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_STOP_REASON()` - An application provided reason for stopping the download or downloads, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()` to clear the stop reason.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()` - See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#KEY_FOREGROUND()`.

### DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL

```
const val DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL = 1000: Long
```

Default foreground notification update interval in milliseconds.

### FOREGROUND_NOTIFICATION_ID_NONE

```
const val FOREGROUND_NOTIFICATION_ID_NONE = 0: Int
```

Invalid foreground notification id that can be used to run the service in the background.

### KEY_CONTENT_ID

```
const val KEY_CONTENT_ID = "content_id": String!
```

Key for the `https://developer.android.com/reference/java/lang/String.html` content id in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_STOP_REASON()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_REMOVE_DOWNLOAD()` intents.

### KEY_DOWNLOAD_REQUEST

```
const val KEY_DOWNLOAD_REQUEST = "download_request": String!
```

Key for the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest` in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_ADD_DOWNLOAD()` intents.

### KEY_FOREGROUND

```
const val KEY_FOREGROUND = "foreground": String!
```

Key for a boolean extra that can be set on any intent to indicate whether the service was started in the foreground. If set, the service is guaranteed to call `https://developer.android.com/reference/android/app/Service.html#startForeground(int, android.app.Notification)`.

### KEY_REQUIREMENTS

```
const val KEY_REQUIREMENTS = "requirements": String!
```

Key for the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements` in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_REQUIREMENTS()` intents.

### KEY_STOP_REASON

```
const val KEY_STOP_REASON = "stop_reason": String!
```

Key for the integer stop reason in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_SET_STOP_REASON()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#ACTION_ADD_DOWNLOAD()` intents.

## Protected constructors

### DownloadService

```
protected DownloadService(foregroundNotificationId: Int)
```

Creates a DownloadService.

If `foregroundNotificationId` is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()` then the service will only ever run in the background, and no foreground notification will be displayed.

If `foregroundNotificationId` is not `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()` then the service will run in the foreground. The foreground notification will be updated at least as often as the interval specified by `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL()`.

| Parameters |
|---|---|
| `foregroundNotificationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The notification id for the foreground notification, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()` if the service should only ever run in the background. |

### DownloadService

```
protected DownloadService(
    foregroundNotificationId: Int,
    foregroundNotificationUpdateInterval: Long
)
```

Creates a DownloadService.

| Parameters |
|---|---|
| `foregroundNotificationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The notification id for the foreground notification, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()` if the service should only ever run in the background. |
| `foregroundNotificationUpdateInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The maximum interval between updates to the foreground notification, in milliseconds. Ignored if `foregroundNotificationId` is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()`. |

### DownloadService

```
protected DownloadService(
    foregroundNotificationId: Int,
    foregroundNotificationUpdateInterval: Long,
    channelId: String?,
    channelNameResourceId: @StringRes Int,
    channelDescriptionResourceId: @StringRes Int
)
```

Creates a DownloadService.

| Parameters |
|---|---|
| `foregroundNotificationId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The notification id for the foreground notification, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()` if the service should only ever run in the background. |
| `foregroundNotificationUpdateInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The maximum interval between updates to the foreground notification, in milliseconds. Ignored if `foregroundNotificationId` is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()`. |
| `channelId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | An id for a low priority notification channel to create, or `null` if the app will take care of creating a notification channel if needed. If specified, must be unique per package. The value may be truncated if it's too long. Ignored if ` foregroundNotificationId` is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()`. |
| `channelNameResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A string resource identifier for the user visible name of the notification channel. The recommended maximum length is 40 characters. The value may be truncated if it's too long. Ignored if `channelId` is null or if ` foregroundNotificationId` is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()`. |
| `channelDescriptionResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A string resource identifier for the user visible description of the notification channel, or 0 if no description is provided. The recommended maximum length is 300 characters. The value may be truncated if it is too long. Ignored if `channelId` is null or if `foregroundNotificationId` is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()`. |

## Public functions

### buildAddDownloadIntent

```
java-static fun buildAddDownloadIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    downloadRequest: DownloadRequest!,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` for adding a new download.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!` | The request to be executed. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### buildAddDownloadIntent

```
java-static fun buildAddDownloadIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    downloadRequest: DownloadRequest!,
    stopReason: Int,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` for adding a new download.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!` | The request to be executed. |
| `stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An initial stop reason for the download, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()` if the download should be started. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### buildPauseDownloadsIntent

```
java-static fun buildPauseDownloadsIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` to pause all downloads.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### buildRemoveAllDownloadsIntent

```
java-static fun buildRemoveAllDownloadsIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` for removing all downloads.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### buildRemoveDownloadIntent

```
java-static fun buildRemoveDownloadIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    id: String!,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` for removing the download with the `id`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The content id. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### buildResumeDownloadsIntent

```
java-static fun buildResumeDownloadsIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` for resuming all downloads.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### buildSetRequirementsIntent

```
java-static fun buildSetRequirementsIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    requirements: Requirements!,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` for setting the requirements that need to be met for downloads to progress.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `requirements: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements`. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### buildSetStopReasonIntent

```
java-static fun buildSetStopReasonIntent(
    context: Context!,
    clazz: Class<DownloadService!>!,
    id: String?,
    stopReason: Int,
    foreground: Boolean
): Intent!
```

Builds an `https://developer.android.com/reference/android/content/Intent.html` for setting the stop reason for one or all downloads. To clear the stop reason, pass `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service being targeted by the intent. |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The content id, or `null` to set the stop reason for all downloads. |
| `stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An application defined stop reason. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this intent will be used to start the service in the foreground. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The created intent. |

### clearDownloadManagerHelpers

```
java-static fun clearDownloadManagerHelpers(): Unit
```

Clear all `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService.DownloadManagerHelper` before restarting the service.

Calling this method is normally only required if an app supports downloading content for multiple users for which different download directories should be used.

### onBind

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

Throws `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` because this service is not designed to be bound.

### onCreate

```
fun onCreate(): Unit
```

### onDestroy

```
fun onDestroy(): Unit
```

### onStartCommand

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

### onTaskRemoved

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

### onTimeout

```
fun onTimeout(startId: Int, fgsType: Int): Unit
```

### sendAddDownload

```
java-static fun sendAddDownload(
    context: Context!,
    clazz: Class<DownloadService!>!,
    downloadRequest: DownloadRequest!,
    foreground: Boolean
): Unit
```

Starts the service if not started already and adds a new download.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!` | The request to be executed. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### sendAddDownload

```
java-static fun sendAddDownload(
    context: Context!,
    clazz: Class<DownloadService!>!,
    downloadRequest: DownloadRequest!,
    stopReason: Int,
    foreground: Boolean
): Unit
```

Starts the service if not started already and adds a new download.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `downloadRequest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest!` | The request to be executed. |
| `stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An initial stop reason for the download, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()` if the download should be started. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### sendPauseDownloads

```
java-static fun sendPauseDownloads(
    context: Context!,
    clazz: Class<DownloadService!>!,
    foreground: Boolean
): Unit
```

Starts the service if not started already and pauses all downloads.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### sendRemoveAllDownloads

```
java-static fun sendRemoveAllDownloads(
    context: Context!,
    clazz: Class<DownloadService!>!,
    foreground: Boolean
): Unit
```

Starts the service if not started already and removes all downloads.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### sendRemoveDownload

```
java-static fun sendRemoveDownload(
    context: Context!,
    clazz: Class<DownloadService!>!,
    id: String!,
    foreground: Boolean
): Unit
```

Starts the service if not started already and removes a download.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The content id. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### sendResumeDownloads

```
java-static fun sendResumeDownloads(
    context: Context!,
    clazz: Class<DownloadService!>!,
    foreground: Boolean
): Unit
```

Starts the service if not started already and resumes all downloads.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### sendSetRequirements

```
java-static fun sendSetRequirements(
    context: Context!,
    clazz: Class<DownloadService!>!,
    requirements: Requirements!,
    foreground: Boolean
): Unit
```

Starts the service if not started already and sets the requirements that need to be met for downloads to progress.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `requirements: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements`. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### sendSetStopReason

```
java-static fun sendSetStopReason(
    context: Context!,
    clazz: Class<DownloadService!>!,
    id: String?,
    stopReason: Int,
    foreground: Boolean
): Unit
```

Starts the service if not started already and sets the stop reason for one or all downloads. To clear stop reason, pass `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The content id, or `null` to set the stop reason for all downloads. |
| `stopReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An application defined stop reason. |
| `foreground: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the service is started in the foreground. |

### start

```
java-static fun start(context: Context!, clazz: Class<DownloadService!>!): Unit
```

Starts a download service to resume any ongoing downloads.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#startForeground(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>)` |   |

### startForeground

```
java-static fun startForeground(context: Context!, clazz: Class<DownloadService!>!): Unit
```

Starts the service in the foreground without adding a new download request. If there are any not finished downloads and the requirements are met, the service resumes downloading. Otherwise it stops immediately.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `clazz: https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService!>!` | The concrete download service to be started. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#start(android.content.Context,java.lang.Class<? extends androidx.media3.exoplayer.offline.DownloadService>)` |   |

## Protected functions

### getDownloadManager

```
protected abstract fun getDownloadManager(): DownloadManager!
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager` to be used to downloaded content. For each concrete download service subclass, this is called once in the lifecycle of the process when `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#onCreate()` is called on the first instance of the service. If the service is destroyed and a new instance is created later, the new instance will use the previously returned `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager` without this method being called again.

### getForegroundNotification

```
protected abstract fun getForegroundNotification(
    downloads: (Mutable)List<Download!>!,
    @Requirements.RequirementFlags notMetRequirements: Int
): Notification!
```

Returns a notification to be displayed when this service running in the foreground.

Download services that do not wish to run in the foreground should be created by setting the `foregroundNotificationId` constructor argument to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()`. This method is not called for such services, meaning it can be implemented to throw `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html`.

| Parameters |
|---|---|
| `downloads: (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/exoplayer/offline/Download!>!` | The current downloads. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements.RequirementFlags notMetRequirements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Any requirements for downloads that are not currently met. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/app/Notification.html!` | The foreground notification to display. |

### getScheduler

```
protected abstract fun getScheduler(): Scheduler?
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler` to restart the service when requirements for downloads to continue are met.

This method is not called on all devices or for all service configurations. When it is called, it's called only once in the life cycle of the process. If a service has unfinished downloads that cannot make progress due to unmet requirements, it will behave according to the first matching case below:

- If the service has `foregroundNotificationId` set to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#FOREGROUND_NOTIFICATION_ID_NONE()`, then this method will not be called. The service will remain in the background until the downloads are able to continue to completion or the service is killed by the platform.
- If the device API level is less than 31, a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler` is returned from this method, and the returned `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler``https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler#getSupportedRequirements(androidx.media3.exoplayer.scheduler.Requirements)` all of the requirements that have been specified for downloads to continue, then the service will stop itself and the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler` will be used to restart it in the foreground when the requirements are met.
- If the device API level is less than 31 and either `null` or a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler` that does not `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler#getSupportedRequirements(androidx.media3.exoplayer.scheduler.Requirements)` all of the requirements is returned from this method, then the service will remain in the foreground until the downloads are able to continue to completion.
- If the device API level is 31 or above, then this method will not be called and the service will remain in the foreground until the downloads are able to continue to completion. A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Scheduler` cannot be used for this case due to [Android 12 foreground service launch restrictions](https://developer.android.com/about/versions/12/foreground-services).
- 

### invalidateForegroundNotification

```
protected fun invalidateForegroundNotification(): Unit
```

Invalidates the current foreground notification and causes `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService#getForegroundNotification(java.util.List<androidx.media3.exoplayer.offline.Download>,int)` to be invoked again if the service isn't stopped.