media/docs/doc/reference/com/google/android/exoplayer2/offline/DownloadManager.html
2021-04-21 11:00:57 +01:00

962 lines
58 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet -->
<title>DownloadManager (ExoPlayer library)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DownloadManager (ExoPlayer library)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/android/exoplayer2/offline/DownloadIndex.html" title="interface in com.google.android.exoplayer2.offline"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/android/exoplayer2/offline/DownloadManager.html" target="_top">Frames</a></li>
<li><a href="DownloadManager.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="../../../../../com/google/android/exoplayer2/offline/package-summary.html">com.google.android.exoplayer2.offline</a></div>
<h2 title="Class DownloadManager" class="title">Class DownloadManager</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.google.android.exoplayer2.offline.DownloadManager</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public final class <span class="typeNameLabel">DownloadManager</span>
extends <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></pre>
<div class="block">Manages downloads.
<p>Normally a download manager should be accessed via a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadService.html" title="class in com.google.android.exoplayer2.offline"><code>DownloadService</code></a>. When a download
manager is used directly instead, downloads will be initially paused and so must be resumed by
calling <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#resumeDownloads--"><code>resumeDownloads()</code></a>.
<p>A download manager instance must be accessed only from the thread that created it, unless that
thread does not have a <a href="https://developer.android.com/reference/android/os/Looper.html" title="class or interface in android.os" class="externalLink" target="_top"><code>Looper</code></a>. 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 <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getApplicationLooper--"><code>getApplicationLooper()</code></a>.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline">DownloadManager.Listener</a></span></code></th>
<td class="colLast">
<div class="block">Listener for <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html" title="class in com.google.android.exoplayer2.offline"><code>DownloadManager</code></a> events.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DEFAULT_MAX_PARALLEL_DOWNLOADS">DEFAULT_MAX_PARALLEL_DOWNLOADS</a></span></code></th>
<td class="colLast">
<div class="block">The default maximum number of parallel downloads.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DEFAULT_MIN_RETRY_COUNT">DEFAULT_MIN_RETRY_COUNT</a></span></code></th>
<td class="colLast">
<div class="block">The default minimum number of times a download must be retried before failing.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.html" title="class in com.google.android.exoplayer2.scheduler">Requirements</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DEFAULT_REQUIREMENTS">DEFAULT_REQUIREMENTS</a></span></code></th>
<td class="colLast">
<div class="block">The default requirement is that the device has network connectivity.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DownloadManager-android.content.Context-com.google.android.exoplayer2.database.DatabaseProvider-com.google.android.exoplayer2.upstream.cache.Cache-com.google.android.exoplayer2.upstream.DataSource.Factory-">DownloadManager</a></span>&#8203;(<a href="https://developer.android.com/reference/android/content/Context.html" title="class or interface in android.content" class="externalLink" target="_top">Context</a>&nbsp;context,
<a href="../../../../../com/google/android/exoplayer2/database/DatabaseProvider.html" title="interface in com.google.android.exoplayer2.database">DatabaseProvider</a>&nbsp;databaseProvider,
<a href="../../../../../com/google/android/exoplayer2/upstream/cache/Cache.html" title="interface in com.google.android.exoplayer2.upstream.cache">Cache</a>&nbsp;cache,
<a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.Factory.html" title="interface in com.google.android.exoplayer2.upstream">DataSource.Factory</a>&nbsp;upstreamFactory)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DownloadManager-android.content.Context-com.google.android.exoplayer2.database.DatabaseProvider-com.google.android.exoplayer2.upstream.cache.Cache-com.google.android.exoplayer2.upstream.DataSource.Factory-java.util.concurrent.Executor-"><code>DownloadManager(Context, DatabaseProvider, Cache, Factory, Executor)</code></a>.</div>
</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DownloadManager-android.content.Context-com.google.android.exoplayer2.database.DatabaseProvider-com.google.android.exoplayer2.upstream.cache.Cache-com.google.android.exoplayer2.upstream.DataSource.Factory-java.util.concurrent.Executor-">DownloadManager</a></span>&#8203;(<a href="https://developer.android.com/reference/android/content/Context.html" title="class or interface in android.content" class="externalLink" target="_top">Context</a>&nbsp;context,
<a href="../../../../../com/google/android/exoplayer2/database/DatabaseProvider.html" title="interface in com.google.android.exoplayer2.database">DatabaseProvider</a>&nbsp;databaseProvider,
<a href="../../../../../com/google/android/exoplayer2/upstream/cache/Cache.html" title="interface in com.google.android.exoplayer2.upstream.cache">Cache</a>&nbsp;cache,
<a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.Factory.html" title="interface in com.google.android.exoplayer2.upstream">DataSource.Factory</a>&nbsp;upstreamFactory,
<a href="https://developer.android.com/reference/java/util/concurrent/Executor.html" title="class or interface in java.util.concurrent" class="externalLink" target="_top">Executor</a>&nbsp;executor)</code></th>
<td class="colLast">
<div class="block">Constructs a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html" title="class in com.google.android.exoplayer2.offline"><code>DownloadManager</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DownloadManager-android.content.Context-com.google.android.exoplayer2.offline.WritableDownloadIndex-com.google.android.exoplayer2.offline.DownloaderFactory-">DownloadManager</a></span>&#8203;(<a href="https://developer.android.com/reference/android/content/Context.html" title="class or interface in android.content" class="externalLink" target="_top">Context</a>&nbsp;context,
<a href="../../../../../com/google/android/exoplayer2/offline/WritableDownloadIndex.html" title="interface in com.google.android.exoplayer2.offline">WritableDownloadIndex</a>&nbsp;downloadIndex,
<a href="../../../../../com/google/android/exoplayer2/offline/DownloaderFactory.html" title="interface in com.google.android.exoplayer2.offline">DownloaderFactory</a>&nbsp;downloaderFactory)</code></th>
<td class="colLast">
<div class="block">Constructs a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html" title="class in com.google.android.exoplayer2.offline"><code>DownloadManager</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#addDownload-com.google.android.exoplayer2.offline.DownloadRequest-">addDownload</a></span>&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadRequest.html" title="class in com.google.android.exoplayer2.offline">DownloadRequest</a>&nbsp;request)</code></th>
<td class="colLast">
<div class="block">Adds a download defined by the given request.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#addDownload-com.google.android.exoplayer2.offline.DownloadRequest-int-">addDownload</a></span>&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadRequest.html" title="class in com.google.android.exoplayer2.offline">DownloadRequest</a>&nbsp;request,
int&nbsp;stopReason)</code></th>
<td class="colLast">
<div class="block">Adds a download defined by the given request and with the specified stop reason.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#addListener-com.google.android.exoplayer2.offline.DownloadManager.Listener-">addListener</a></span>&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline">DownloadManager.Listener</a>&nbsp;listener)</code></th>
<td class="colLast">
<div class="block">Adds a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><code>DownloadManager.Listener</code></a>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://developer.android.com/reference/android/os/Looper.html" title="class or interface in android.os" class="externalLink" target="_top">Looper</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getApplicationLooper--">getApplicationLooper</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the <a href="https://developer.android.com/reference/android/os/Looper.html" title="class or interface in android.os" class="externalLink" target="_top"><code>Looper</code></a> associated with the application thread that's used to access the
manager, and on which the manager will call its <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><code>Listeners</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="https://developer.android.com/reference/java/util/List.html" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../../../../../com/google/android/exoplayer2/offline/Download.html" title="class in com.google.android.exoplayer2.offline" target="_top">Download</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getCurrentDownloads--">getCurrentDownloads</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns current downloads.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/google/android/exoplayer2/offline/DownloadIndex.html" title="interface in com.google.android.exoplayer2.offline">DownloadIndex</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getDownloadIndex--">getDownloadIndex</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the used <a href="../../../../../com/google/android/exoplayer2/offline/DownloadIndex.html" title="interface in com.google.android.exoplayer2.offline"><code>DownloadIndex</code></a>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getDownloadsPaused--">getDownloadsPaused</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether downloads are currently paused.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getMaxParallelDownloads--">getMaxParallelDownloads</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the maximum number of parallel downloads.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getMinRetryCount--">getMinRetryCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the minimum number of times that a download will be retried.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getNotMetRequirements--">getNotMetRequirements</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the requirements needed for downloads to progress that are not currently met.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.html" title="class in com.google.android.exoplayer2.scheduler">Requirements</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getRequirements--">getRequirements</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the requirements needed to be met to progress.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#isIdle--">isIdle</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether the manager is currently idle.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#isInitialized--">isInitialized</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether the manager has completed initialization.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#isWaitingForRequirements--">isWaitingForRequirements</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this manager has one or more downloads that are not progressing for the sole
reason that the <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getRequirements--"><code>Requirements</code></a> are not met.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#pauseDownloads--">pauseDownloads</a></span>()</code></th>
<td class="colLast">
<div class="block">Pauses downloads.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#release--">release</a></span>()</code></th>
<td class="colLast">
<div class="block">Stops the downloads and releases resources.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#removeAllDownloads--">removeAllDownloads</a></span>()</code></th>
<td class="colLast">
<div class="block">Cancels all pending downloads and removes all downloaded data.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#removeDownload-java.lang.String-">removeDownload</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;id)</code></th>
<td class="colLast">
<div class="block">Cancels the download with the <code>id</code> and removes all downloaded data.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#removeListener-com.google.android.exoplayer2.offline.DownloadManager.Listener-">removeListener</a></span>&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline">DownloadManager.Listener</a>&nbsp;listener)</code></th>
<td class="colLast">
<div class="block">Removes a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><code>DownloadManager.Listener</code></a>.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#resumeDownloads--">resumeDownloads</a></span>()</code></th>
<td class="colLast">
<div class="block">Resumes downloads.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#setMaxParallelDownloads-int-">setMaxParallelDownloads</a></span>&#8203;(int&nbsp;maxParallelDownloads)</code></th>
<td class="colLast">
<div class="block">Sets the maximum number of parallel downloads.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#setMinRetryCount-int-">setMinRetryCount</a></span>&#8203;(int&nbsp;minRetryCount)</code></th>
<td class="colLast">
<div class="block">Sets the minimum number of times that a download will be retried.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#setRequirements-com.google.android.exoplayer2.scheduler.Requirements-">setRequirements</a></span>&#8203;(<a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.html" title="class in com.google.android.exoplayer2.scheduler">Requirements</a>&nbsp;requirements)</code></th>
<td class="colLast">
<div class="block">Sets the requirements that need to be met for downloads to progress.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#setStopReason-java.lang.String-int-">setStopReason</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;id,
int&nbsp;stopReason)</code></th>
<td class="colLast">
<div class="block">Sets the stop reason for one or all downloads.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></h3>
<code><a href="https://developer.android.com/reference/java/lang/Object.html#clone--" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang" class="externalLink" target="_top">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="DEFAULT_MAX_PARALLEL_DOWNLOADS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_MAX_PARALLEL_DOWNLOADS</h4>
<pre>public static final&nbsp;int DEFAULT_MAX_PARALLEL_DOWNLOADS</pre>
<div class="block">The default maximum number of parallel downloads.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.offline.DownloadManager.DEFAULT_MAX_PARALLEL_DOWNLOADS">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="DEFAULT_MIN_RETRY_COUNT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_MIN_RETRY_COUNT</h4>
<pre>public static final&nbsp;int DEFAULT_MIN_RETRY_COUNT</pre>
<div class="block">The default minimum number of times a download must be retried before failing.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.offline.DownloadManager.DEFAULT_MIN_RETRY_COUNT">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="DEFAULT_REQUIREMENTS">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DEFAULT_REQUIREMENTS</h4>
<pre>public static final&nbsp;<a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.html" title="class in com.google.android.exoplayer2.scheduler">Requirements</a> DEFAULT_REQUIREMENTS</pre>
<div class="block">The default requirement is that the device has network connectivity.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="DownloadManager-android.content.Context-com.google.android.exoplayer2.database.DatabaseProvider-com.google.android.exoplayer2.upstream.cache.Cache-com.google.android.exoplayer2.upstream.DataSource.Factory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DownloadManager</h4>
<pre><a href="https://developer.android.com/reference/java/lang/Deprecated.html" title="class or interface in java.lang" class="externalLink" target="_top">@Deprecated</a>
public&nbsp;DownloadManager&#8203;(<a href="https://developer.android.com/reference/android/content/Context.html" title="class or interface in android.content" class="externalLink" target="_top">Context</a>&nbsp;context,
<a href="../../../../../com/google/android/exoplayer2/database/DatabaseProvider.html" title="interface in com.google.android.exoplayer2.database">DatabaseProvider</a>&nbsp;databaseProvider,
<a href="../../../../../com/google/android/exoplayer2/upstream/cache/Cache.html" title="interface in com.google.android.exoplayer2.upstream.cache">Cache</a>&nbsp;cache,
<a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.Factory.html" title="interface in com.google.android.exoplayer2.upstream">DataSource.Factory</a>&nbsp;upstreamFactory)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#DownloadManager-android.content.Context-com.google.android.exoplayer2.database.DatabaseProvider-com.google.android.exoplayer2.upstream.cache.Cache-com.google.android.exoplayer2.upstream.DataSource.Factory-java.util.concurrent.Executor-"><code>DownloadManager(Context, DatabaseProvider, Cache, Factory, Executor)</code></a>.</div>
</div>
<div class="block">Constructs a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html" title="class in com.google.android.exoplayer2.offline"><code>DownloadManager</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - Any context.</dd>
<dd><code>databaseProvider</code> - Provides the SQLite database in which downloads are persisted.</dd>
<dd><code>cache</code> - A cache to be used to store downloaded data. The cache should be configured with
an <a href="../../../../../com/google/android/exoplayer2/upstream/cache/CacheEvictor.html" title="interface in com.google.android.exoplayer2.upstream.cache"><code>CacheEvictor</code></a> that will not evict downloaded content, for example <a href="../../../../../com/google/android/exoplayer2/upstream/cache/NoOpCacheEvictor.html" title="class in com.google.android.exoplayer2.upstream.cache"><code>NoOpCacheEvictor</code></a>.</dd>
<dd><code>upstreamFactory</code> - A <a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.Factory.html" title="interface in com.google.android.exoplayer2.upstream"><code>DataSource.Factory</code></a> for creating <a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.html" title="interface in com.google.android.exoplayer2.upstream"><code>DataSource</code></a>s for downloading data.</dd>
</dl>
</li>
</ul>
<a name="DownloadManager-android.content.Context-com.google.android.exoplayer2.database.DatabaseProvider-com.google.android.exoplayer2.upstream.cache.Cache-com.google.android.exoplayer2.upstream.DataSource.Factory-java.util.concurrent.Executor-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DownloadManager</h4>
<pre>public&nbsp;DownloadManager&#8203;(<a href="https://developer.android.com/reference/android/content/Context.html" title="class or interface in android.content" class="externalLink" target="_top">Context</a>&nbsp;context,
<a href="../../../../../com/google/android/exoplayer2/database/DatabaseProvider.html" title="interface in com.google.android.exoplayer2.database">DatabaseProvider</a>&nbsp;databaseProvider,
<a href="../../../../../com/google/android/exoplayer2/upstream/cache/Cache.html" title="interface in com.google.android.exoplayer2.upstream.cache">Cache</a>&nbsp;cache,
<a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.Factory.html" title="interface in com.google.android.exoplayer2.upstream">DataSource.Factory</a>&nbsp;upstreamFactory,
<a href="https://developer.android.com/reference/java/util/concurrent/Executor.html" title="class or interface in java.util.concurrent" class="externalLink" target="_top">Executor</a>&nbsp;executor)</pre>
<div class="block">Constructs a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html" title="class in com.google.android.exoplayer2.offline"><code>DownloadManager</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - Any context.</dd>
<dd><code>databaseProvider</code> - Provides the SQLite database in which downloads are persisted.</dd>
<dd><code>cache</code> - A cache to be used to store downloaded data. The cache should be configured with
an <a href="../../../../../com/google/android/exoplayer2/upstream/cache/CacheEvictor.html" title="interface in com.google.android.exoplayer2.upstream.cache"><code>CacheEvictor</code></a> that will not evict downloaded content, for example <a href="../../../../../com/google/android/exoplayer2/upstream/cache/NoOpCacheEvictor.html" title="class in com.google.android.exoplayer2.upstream.cache"><code>NoOpCacheEvictor</code></a>.</dd>
<dd><code>upstreamFactory</code> - A <a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.Factory.html" title="interface in com.google.android.exoplayer2.upstream"><code>DataSource.Factory</code></a> for creating <a href="../../../../../com/google/android/exoplayer2/upstream/DataSource.html" title="interface in com.google.android.exoplayer2.upstream"><code>DataSource</code></a>s for downloading data.</dd>
<dd><code>executor</code> - An <a href="https://developer.android.com/reference/java/util/concurrent/Executor.html" title="class or interface in java.util.concurrent" class="externalLink" target="_top"><code>Executor</code></a> used to download data. Passing <code>Runnable::run</code> will
cause each download task to download data on its own thread. Passing an <a href="https://developer.android.com/reference/java/util/concurrent/Executor.html" title="class or interface in java.util.concurrent" class="externalLink" target="_top"><code>Executor</code></a>
that uses multiple threads will speed up download tasks that can be split into smaller
parts for parallel execution.</dd>
</dl>
</li>
</ul>
<a name="DownloadManager-android.content.Context-com.google.android.exoplayer2.offline.WritableDownloadIndex-com.google.android.exoplayer2.offline.DownloaderFactory-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DownloadManager</h4>
<pre>public&nbsp;DownloadManager&#8203;(<a href="https://developer.android.com/reference/android/content/Context.html" title="class or interface in android.content" class="externalLink" target="_top">Context</a>&nbsp;context,
<a href="../../../../../com/google/android/exoplayer2/offline/WritableDownloadIndex.html" title="interface in com.google.android.exoplayer2.offline">WritableDownloadIndex</a>&nbsp;downloadIndex,
<a href="../../../../../com/google/android/exoplayer2/offline/DownloaderFactory.html" title="interface in com.google.android.exoplayer2.offline">DownloaderFactory</a>&nbsp;downloaderFactory)</pre>
<div class="block">Constructs a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html" title="class in com.google.android.exoplayer2.offline"><code>DownloadManager</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - Any context.</dd>
<dd><code>downloadIndex</code> - The download index used to hold the download information.</dd>
<dd><code>downloaderFactory</code> - A factory for creating <a href="../../../../../com/google/android/exoplayer2/offline/Downloader.html" title="interface in com.google.android.exoplayer2.offline"><code>Downloader</code></a>s.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getApplicationLooper--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getApplicationLooper</h4>
<pre>public&nbsp;<a href="https://developer.android.com/reference/android/os/Looper.html" title="class or interface in android.os" class="externalLink" target="_top">Looper</a>&nbsp;getApplicationLooper()</pre>
<div class="block">Returns the <a href="https://developer.android.com/reference/android/os/Looper.html" title="class or interface in android.os" class="externalLink" target="_top"><code>Looper</code></a> associated with the application thread that's used to access the
manager, and on which the manager will call its <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><code>Listeners</code></a>.</div>
</li>
</ul>
<a name="isInitialized--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInitialized</h4>
<pre>public&nbsp;boolean&nbsp;isInitialized()</pre>
<div class="block">Returns whether the manager has completed initialization.</div>
</li>
</ul>
<a name="isIdle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isIdle</h4>
<pre>public&nbsp;boolean&nbsp;isIdle()</pre>
<div class="block">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).</div>
</li>
</ul>
<a name="isWaitingForRequirements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isWaitingForRequirements</h4>
<pre>public&nbsp;boolean&nbsp;isWaitingForRequirements()</pre>
<div class="block">Returns whether this manager has one or more downloads that are not progressing for the sole
reason that the <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getRequirements--"><code>Requirements</code></a> are not met. This is true if:
<ul>
<li>The <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getRequirements--"><code>Requirements</code></a> are not met.
<li>The downloads are not paused (i.e. <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getDownloadsPaused--"><code>getDownloadsPaused()</code></a> is <code>false</code>).
<li>There are downloads in the <a href="../../../../../com/google/android/exoplayer2/offline/Download.html#STATE_QUEUED"><code>queued state</code></a>.
</ul></div>
</li>
</ul>
<a name="addListener-com.google.android.exoplayer2.offline.DownloadManager.Listener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addListener</h4>
<pre>public&nbsp;void&nbsp;addListener&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline">DownloadManager.Listener</a>&nbsp;listener)</pre>
<div class="block">Adds a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><code>DownloadManager.Listener</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - The listener to be added.</dd>
</dl>
</li>
</ul>
<a name="removeListener-com.google.android.exoplayer2.offline.DownloadManager.Listener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeListener</h4>
<pre>public&nbsp;void&nbsp;removeListener&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline">DownloadManager.Listener</a>&nbsp;listener)</pre>
<div class="block">Removes a <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><code>DownloadManager.Listener</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - The listener to be removed.</dd>
</dl>
</li>
</ul>
<a name="getRequirements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRequirements</h4>
<pre>public&nbsp;<a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.html" title="class in com.google.android.exoplayer2.scheduler">Requirements</a>&nbsp;getRequirements()</pre>
<div class="block">Returns the requirements needed to be met to progress.</div>
</li>
</ul>
<a name="getNotMetRequirements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNotMetRequirements</h4>
<pre><a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.RequirementFlags.html" title="annotation in com.google.android.exoplayer2.scheduler">@RequirementFlags</a>
public&nbsp;int&nbsp;getNotMetRequirements()</pre>
<div class="block">Returns the requirements needed for downloads to progress that are not currently met.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The not met <a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.RequirementFlags.html" title="annotation in com.google.android.exoplayer2.scheduler"><code>Requirements.RequirementFlags</code></a>, or 0 if all requirements are met.</dd>
</dl>
</li>
</ul>
<a name="setRequirements-com.google.android.exoplayer2.scheduler.Requirements-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRequirements</h4>
<pre>public&nbsp;void&nbsp;setRequirements&#8203;(<a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.html" title="class in com.google.android.exoplayer2.scheduler">Requirements</a>&nbsp;requirements)</pre>
<div class="block">Sets the requirements that need to be met for downloads to progress.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>requirements</code> - A <a href="../../../../../com/google/android/exoplayer2/scheduler/Requirements.html" title="class in com.google.android.exoplayer2.scheduler"><code>Requirements</code></a>.</dd>
</dl>
</li>
</ul>
<a name="getMaxParallelDownloads--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxParallelDownloads</h4>
<pre>public&nbsp;int&nbsp;getMaxParallelDownloads()</pre>
<div class="block">Returns the maximum number of parallel downloads.</div>
</li>
</ul>
<a name="setMaxParallelDownloads-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxParallelDownloads</h4>
<pre>public&nbsp;void&nbsp;setMaxParallelDownloads&#8203;(int&nbsp;maxParallelDownloads)</pre>
<div class="block">Sets the maximum number of parallel downloads.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>maxParallelDownloads</code> - The maximum number of parallel downloads. Must be greater than 0.</dd>
</dl>
</li>
</ul>
<a name="getMinRetryCount--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMinRetryCount</h4>
<pre>public&nbsp;int&nbsp;getMinRetryCount()</pre>
<div class="block">Returns the minimum number of times that a download will be retried. A download will fail if
the specified number of retries is exceeded without any progress being made.</div>
</li>
</ul>
<a name="setMinRetryCount-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMinRetryCount</h4>
<pre>public&nbsp;void&nbsp;setMinRetryCount&#8203;(int&nbsp;minRetryCount)</pre>
<div class="block">Sets the minimum number of times that a download will be retried. A download will fail if the
specified number of retries is exceeded without any progress being made.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>minRetryCount</code> - The minimum number of times that a download will be retried.</dd>
</dl>
</li>
</ul>
<a name="getDownloadIndex--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDownloadIndex</h4>
<pre>public&nbsp;<a href="../../../../../com/google/android/exoplayer2/offline/DownloadIndex.html" title="interface in com.google.android.exoplayer2.offline">DownloadIndex</a>&nbsp;getDownloadIndex()</pre>
<div class="block">Returns the used <a href="../../../../../com/google/android/exoplayer2/offline/DownloadIndex.html" title="interface in com.google.android.exoplayer2.offline"><code>DownloadIndex</code></a>.</div>
</li>
</ul>
<a name="getCurrentDownloads--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentDownloads</h4>
<pre>public&nbsp;<a href="https://developer.android.com/reference/java/util/List.html" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../../../../../com/google/android/exoplayer2/offline/Download.html" title="class in com.google.android.exoplayer2.offline" target="_top">Download</a>&gt;&nbsp;getCurrentDownloads()</pre>
<div class="block">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 <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getDownloadIndex--"><code>getDownloadIndex()</code></a> instead.</div>
</li>
</ul>
<a name="getDownloadsPaused--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDownloadsPaused</h4>
<pre>public&nbsp;boolean&nbsp;getDownloadsPaused()</pre>
<div class="block">Returns whether downloads are currently paused.</div>
</li>
</ul>
<a name="resumeDownloads--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resumeDownloads</h4>
<pre>public&nbsp;void&nbsp;resumeDownloads()</pre>
<div class="block">Resumes downloads.
<p>If the <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#setRequirements-com.google.android.exoplayer2.scheduler.Requirements-"><code>Requirements</code></a> are met up to <a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.html#getMaxParallelDownloads--"><code>maxParallelDownloads</code></a> will be started, excluding those with non-zero
<a href="../../../../../com/google/android/exoplayer2/offline/Download.html#stopReason"><code>stopReasons</code></a>.</div>
</li>
</ul>
<a name="pauseDownloads--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pauseDownloads</h4>
<pre>public&nbsp;void&nbsp;pauseDownloads()</pre>
<div class="block">Pauses downloads. Downloads that would otherwise be making progress will transition to <a href="../../../../../com/google/android/exoplayer2/offline/Download.html#STATE_QUEUED"><code>Download.STATE_QUEUED</code></a>.</div>
</li>
</ul>
<a name="setStopReason-java.lang.String-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStopReason</h4>
<pre>public&nbsp;void&nbsp;setStopReason&#8203;(@Nullable
<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;id,
int&nbsp;stopReason)</pre>
<div class="block">Sets the stop reason for one or all downloads. To clear the stop reason, pass <a href="../../../../../com/google/android/exoplayer2/offline/Download.html#STOP_REASON_NONE"><code>Download.STOP_REASON_NONE</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>id</code> - The content id of the download to update, or <code>null</code> to set the stop reason for
all downloads.</dd>
<dd><code>stopReason</code> - The stop reason, or <a href="../../../../../com/google/android/exoplayer2/offline/Download.html#STOP_REASON_NONE"><code>Download.STOP_REASON_NONE</code></a>.</dd>
</dl>
</li>
</ul>
<a name="addDownload-com.google.android.exoplayer2.offline.DownloadRequest-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addDownload</h4>
<pre>public&nbsp;void&nbsp;addDownload&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadRequest.html" title="class in com.google.android.exoplayer2.offline">DownloadRequest</a>&nbsp;request)</pre>
<div class="block">Adds a download defined by the given request.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>request</code> - The download request.</dd>
</dl>
</li>
</ul>
<a name="addDownload-com.google.android.exoplayer2.offline.DownloadRequest-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addDownload</h4>
<pre>public&nbsp;void&nbsp;addDownload&#8203;(<a href="../../../../../com/google/android/exoplayer2/offline/DownloadRequest.html" title="class in com.google.android.exoplayer2.offline">DownloadRequest</a>&nbsp;request,
int&nbsp;stopReason)</pre>
<div class="block">Adds a download defined by the given request and with the specified stop reason.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>request</code> - The download request.</dd>
<dd><code>stopReason</code> - An initial stop reason for the download, or <a href="../../../../../com/google/android/exoplayer2/offline/Download.html#STOP_REASON_NONE"><code>Download.STOP_REASON_NONE</code></a>
if the download should be started.</dd>
</dl>
</li>
</ul>
<a name="removeDownload-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeDownload</h4>
<pre>public&nbsp;void&nbsp;removeDownload&#8203;(<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;id)</pre>
<div class="block">Cancels the download with the <code>id</code> and removes all downloaded data.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>id</code> - The unique content id of the download to be started.</dd>
</dl>
</li>
</ul>
<a name="removeAllDownloads--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAllDownloads</h4>
<pre>public&nbsp;void&nbsp;removeAllDownloads()</pre>
<div class="block">Cancels all pending downloads and removes all downloaded data.</div>
</li>
</ul>
<a name="release--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>release</h4>
<pre>public&nbsp;void&nbsp;release()</pre>
<div class="block">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.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/android/exoplayer2/offline/DownloadIndex.html" title="interface in com.google.android.exoplayer2.offline"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/google/android/exoplayer2/offline/DownloadManager.Listener.html" title="interface in com.google.android.exoplayer2.offline"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/android/exoplayer2/offline/DownloadManager.html" target="_top">Frames</a></li>
<li><a href="DownloadManager.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>