Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
02eb6e96
authored
Jul 26, 2022
by
Googler
Committed by
Marc Baechinger
Oct 19, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
DownloadService: Attempt to clarify the static map
PiperOrigin-RevId: 463315188
parent
b994f8bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java
View file @
02eb6e96
...
...
@@ -170,9 +170,11 @@ public abstract class DownloadService extends Service {
private
static
final
String
TAG
=
"DownloadService"
;
// Keep a DownloadManagerHelper for each DownloadService as long as the process is running. The
// helper is needed to restart the DownloadService when there's no scheduler. Even when there is a
// scheduler, the DownloadManagerHelper is typically able to restart the DownloadService faster.
// Maps each concrete DownloadService subclass to a single DownloadManagerHelper instance. This
// ensures getDownloadManager is only called once per subclass, even if a new instance of the
// service is created. The DownloadManagerHelper wrapper also takes care of restarting the service
// when there's no scheduler, and is often able to restart the service faster than the scheduler
// even when there is one.
private
static
final
HashMap
<
Class
<?
extends
DownloadService
>,
DownloadManagerHelper
>
downloadManagerHelpers
=
new
HashMap
<>();
...
...
@@ -710,8 +712,11 @@ public abstract class DownloadService extends Service {
}
/**
* Returns a {@link DownloadManager} to be used to downloaded content. Called only once in the
* life cycle of the process.
* Returns a {@link DownloadManager} to be used to downloaded content. For each concrete download
* service subclass, this is called once in the lifecycle of the process when {@link #onCreate} is
* called on the first instance of the service. If the service is destroyed and a new instance is
* created later, the new instance will use the previously returned {@link DownloadManager}
* without this method being called again.
*/
protected
abstract
DownloadManager
getDownloadManager
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment