# DownloadManager

# DownloadManager

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/DownloadManager.java+class:androidx.media3.exoplayer.offline.DownloadManager)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/offline/DownloadManager "View this page in Java")

<br />

```
@UnstableApi
class DownloadManager
```

<br />

*** ** * ** ***

Manages downloads.

Normally a download manager should be accessed via a[DownloadService](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadService). When a download manager is used directly instead, downloads will be initially paused and so must be resumed by calling[resumeDownloads](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#resumeDownloads()).

A download manager instance must be accessed only from the thread that created it, unless that thread does not have a[Looper](https://developer.android.com/reference/android/os/Looper.html). In that case, it must be accessed only from the application's main thread. Registered listeners will be called on the same thread. In all cases the`Looper`of the thread from which the manager must be accessed can be queried using[getApplicationLooper](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getApplicationLooper()).

## Summary

|                                                                                                                                     ### Nested types                                                                                                                                     |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `interface `[DownloadManager.Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener) Listener for[DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager)events. |

|                                                       ### Constants                                                        |
|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                        | [DEFAULT_MAX_PARALLEL_DOWNLOADS](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#DEFAULT_MAX_PARALLEL_DOWNLOADS())` = 3` The default maximum number of parallel downloads.                |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                        | [DEFAULT_MIN_RETRY_COUNT](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#DEFAULT_MIN_RETRY_COUNT())` = 5` The default minimum number of times a download must be retried before failing. |
| `const `[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements)`!` | [DEFAULT_REQUIREMENTS](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#DEFAULT_REQUIREMENTS()) The default requirement is that the device has network connectivity.                       |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#DownloadManager(android.content.Context,androidx.media3.exoplayer.offline.WritableDownloadIndex,androidx.media3.exoplayer.offline.DownloaderFactory))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!,` ` downloadIndex: `[WritableDownloadIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/WritableDownloadIndex)`!,` ` downloaderFactory: `[DownloaderFactory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloaderFactory)`!` `)` Constructs a[DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager).                                                                                                                                                                                                                                                |
| [DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#DownloadManager(android.content.Context,androidx.media3.database.DatabaseProvider,androidx.media3.datasource.cache.Cache,androidx.media3.datasource.DataSource.Factory,java.util.concurrent.Executor))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!,` ` databaseProvider: `[DatabaseProvider](https://developer.android.com/reference/kotlin/androidx/media3/database/DatabaseProvider)`!,` ` cache: `[Cache](https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/Cache)`!,` ` upstreamFactory: `[DataSource.Factory](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource.Factory)`!,` ` executor: `[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html)`!` `)` Constructs a[DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager). |

|                                                                                                                                               ### Public functions                                                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [addDownload](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#addDownload(androidx.media3.exoplayer.offline.DownloadRequest))`(request: `[DownloadRequest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest)`!)` Adds a download defined by the given request.                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [addDownload](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#addDownload(androidx.media3.exoplayer.offline.DownloadRequest,int))`(request: `[DownloadRequest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest)`!, stopReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Adds a download defined by the given request and with the specified stop reason. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [addListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#addListener(androidx.media3.exoplayer.offline.DownloadManager.Listener))`(listener: `[DownloadManager.Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener)`!)` Adds a[Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener).                        |
| [Looper](https://developer.android.com/reference/android/os/Looper.html)`!`                                                                                                                                                                                                                                      | [getApplicationLooper](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getApplicationLooper())`()` Returns the[Looper](https://developer.android.com/reference/android/os/Looper.html)associated with the application thread that's used to access the manager, and on which the manager will call its[Listeners](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener).                    |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Download](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download)`!>!` | [getCurrentDownloads](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getCurrentDownloads())`()` Returns current downloads.                                                                                                                                                                                                                                                                                                                      |
| [DownloadIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadIndex)`!`                                                                                                                                                                                               | [getDownloadIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getDownloadIndex())`()` Returns the used[DownloadIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadIndex).                                                                                                                                                                                                                      |
| [Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements)`!`                                                                                                                                                                                               | [getRequirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getRequirements())`()` Returns the requirements needed to be met to progress.                                                                                                                                                                                                                                                                                                  |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                              | [isIdle](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#isIdle())`()` Returns whether the manager is currently idle.                                                                                                                                                                                                                                                                                                                            |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                              | [isInitialized](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#isInitialized())`()` Returns whether the manager has completed initialization.                                                                                                                                                                                                                                                                                                   |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                              | [isWaitingForRequirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#isWaitingForRequirements())`()` Returns whether this manager has one or more downloads that are not progressing for the sole reason that the[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getRequirements())are not met.                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [pauseDownloads](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#pauseDownloads())`()` Pauses downloads.                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [release](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#release())`()` Stops the downloads and releases resources.                                                                                                                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [removeAllDownloads](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#removeAllDownloads())`()` Cancels all pending downloads and removes all downloaded data.                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [removeDownload](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#removeDownload(java.lang.String))`(id: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Cancels the download with the`id`and removes all downloaded data.                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [removeListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#removeListener(androidx.media3.exoplayer.offline.DownloadManager.Listener))`(listener: `[DownloadManager.Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener)`!)` Removes a[Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener).               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [resumeDownloads](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#resumeDownloads())`()` Resumes downloads.                                                                                                                                                                                                                                                                                                                                      |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [setRequirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#setRequirements(androidx.media3.exoplayer.scheduler.Requirements))`(requirements: `[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements)`!)` Sets the requirements that need to be met for downloads to progress.                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                    | [setStopReason](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#setStopReason(java.lang.String,int))`(id: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?, stopReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets the stop reason for one or all downloads.                                                                                                       |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [downloadsPaused](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#downloadsPaused())           |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [maxParallelDownloads](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#maxParallelDownloads()) |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [minRetryCount](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#minRetryCount())               |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [notMetRequirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#notMetRequirements())     |

## Constants

### DEFAULT_MAX_PARALLEL_DOWNLOADS

```
const val DEFAULT_MAX_PARALLEL_DOWNLOADS = 3: Int
```

The default maximum number of parallel downloads.  

### DEFAULT_MIN_RETRY_COUNT

```
const val DEFAULT_MIN_RETRY_COUNT = 5: Int
```

The default minimum number of times a download must be retried before failing.  

### DEFAULT_REQUIREMENTS

```
const val DEFAULT_REQUIREMENTS: Requirements!
```

The default requirement is that the device has network connectivity.  

## Public constructors

### DownloadManager

```
DownloadManager(
    context: Context!,
    downloadIndex: WritableDownloadIndex!,
    downloaderFactory: DownloaderFactory!
)
```

Constructs a[DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager).  

|                                                                     Parameters                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!`                                                       | Any context.                                                                                                                      |
| `downloadIndex: `[WritableDownloadIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/WritableDownloadIndex)`!` | The download index used to hold the download information.                                                                         |
| `downloaderFactory: `[DownloaderFactory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloaderFactory)`!`     | A factory for creating[Downloader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Downloader)s. |

### DownloadManager

```
DownloadManager(
    context: Context!,
    databaseProvider: DatabaseProvider!,
    cache: Cache!,
    upstreamFactory: DataSource.Factory!,
    executor: Executor!
)
```

Constructs a[DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager).  

|                                                                Parameters                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!`                                            | Any context.                                                                                                                                                                                                                                                                                                                                                                                                                |
| `databaseProvider: `[DatabaseProvider](https://developer.android.com/reference/kotlin/androidx/media3/database/DatabaseProvider)`!`      | Provides the SQLite database in which downloads are persisted.                                                                                                                                                                                                                                                                                                                                                              |
| `cache: `[Cache](https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/Cache)`!`                               | A cache to be used to store downloaded data. The cache should be configured with an[CacheEvictor](https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/CacheEvictor)that will not evict downloaded content, for example[NoOpCacheEvictor](https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/NoOpCacheEvictor).                                                     |
| `upstreamFactory: `[DataSource.Factory](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource.Factory)`!` | A[Factory](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource.Factory)for creating[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)s for downloading data.                                                                                                                                                                               |
| `executor: `[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html)`!`                                    | An[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html)used to download data. Passing`Runnable::run`will cause each download task to download data on its own thread. Passing an[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html)that uses multiple threads will speed up download tasks that can be split into smaller parts for parallel execution. |

## Public functions

### addDownload

```
fun addDownload(request: DownloadRequest!): Unit
```

Adds a download defined by the given request.  

|                                                            Parameters                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| `request: `[DownloadRequest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest)`!` | The download request. |

### addDownload

```
fun addDownload(request: DownloadRequest!, stopReason: Int): Unit
```

Adds a download defined by the given request and with the specified stop reason.  

|                                                            Parameters                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `request: `[DownloadRequest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadRequest)`!` | The download request.                                                                                                                                                                                         |
| `stopReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                         | An initial stop reason for the download, or[STOP_REASON_NONE](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE())if the download should be started. |

### addListener

```
fun addListener(listener: DownloadManager.Listener!): Unit
```

Adds a[Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener).  

|                                                                      Parameters                                                                      |
|------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| `listener: `[DownloadManager.Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener)`!` | The listener to be added. |

### getApplicationLooper

```
fun getApplicationLooper(): Looper!
```

Returns the[Looper](https://developer.android.com/reference/android/os/Looper.html)associated with the application thread that's used to access the manager, and on which the manager will call its[Listeners](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener).  

### getCurrentDownloads

```
fun getCurrentDownloads(): (Mutable)List<Download!>!
```

Returns current downloads. Downloads that are in terminal states (i.e. completed or failed) are not included. To query all downloads including those in terminal states, use[getDownloadIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getDownloadIndex())instead.  

### getDownloadIndex

```
fun getDownloadIndex(): DownloadIndex!
```

Returns the used[DownloadIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadIndex).  

### getRequirements

```
fun getRequirements(): Requirements!
```

Returns the requirements needed to be met to progress.  

### isIdle

```
fun isIdle(): Boolean
```

Returns whether the manager is currently idle. The manager is idle if all downloads are in a terminal state (i.e. completed or failed), or if no progress can be made (e.g. because the download requirements are not met).  

### isInitialized

```
fun isInitialized(): Boolean
```

Returns whether the manager has completed initialization.  

### isWaitingForRequirements

```
fun isWaitingForRequirements(): Boolean
```

Returns whether this manager has one or more downloads that are not progressing for the sole reason that the[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getRequirements())are not met. This is true if:

- The[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getRequirements())are not met.
- The downloads are not paused (i.e.[getDownloadsPaused](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getDownloadsPaused())is`false`).
- There are downloads in the[queued state](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STATE_QUEUED()).  

### pauseDownloads

```
fun pauseDownloads(): Unit
```

Pauses downloads. Downloads that would otherwise be making progress will transition to[STATE_QUEUED](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STATE_QUEUED()).  

### release

```
fun release(): Unit
```

Stops the downloads and releases resources. Waits until the downloads are persisted to the download index. The manager must not be accessed after this method has been called.  

### removeAllDownloads

```
fun removeAllDownloads(): Unit
```

Cancels all pending downloads and removes all downloaded data.  

### removeDownload

```
fun removeDownload(id: String!): Unit
```

Cancels the download with the`id`and removes all downloaded data.  

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|------------------------------------------------------|
| `id: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The unique content id of the download to be started. |

### removeListener

```
fun removeListener(listener: DownloadManager.Listener!): Unit
```

Removes a[Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener).  

|                                                                      Parameters                                                                      |
|------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| `listener: `[DownloadManager.Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener)`!` | The listener to be removed. |

### resumeDownloads

```
fun resumeDownloads(): Unit
```

Resumes downloads.

If the[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#setRequirements(androidx.media3.exoplayer.scheduler.Requirements))are met up to[maxParallelDownloads](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager#getMaxParallelDownloads())will be started, excluding those with non-zero[stopReasons](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#stopReason()).  

### setRequirements

```
fun setRequirements(requirements: Requirements!): Unit
```

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

|                                                             Parameters                                                             |
|------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| `requirements: `[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements)`!` | A[Requirements](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/scheduler/Requirements). |

### setStopReason

```
fun setStopReason(id: String?, stopReason: Int): Unit
```

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

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | The content id of the download to update, or`null`to set the stop reason for all downloads.                                                          |
| `stopReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | The stop reason, or[STOP_REASON_NONE](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Download#STOP_REASON_NONE()). |

## Public properties

### downloadsPaused

```
val downloadsPaused: Boolean
```  

### maxParallelDownloads

```
var maxParallelDownloads: Int
```  

### minRetryCount

```
var minRetryCount: Int
```  

### notMetRequirements

```
val notMetRequirements: Int
```