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
4da14e46
authored
Apr 24, 2019
by
eguven
Committed by
Oliver Woodman
Apr 26, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add DownloadService SET_REQUIREMENTS action
PiperOrigin-RevId: 245014381
parent
f7f6489f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
28 deletions
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadManager.java
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java
library/core/src/main/java/com/google/android/exoplayer2/scheduler/Requirements.java
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadManager.java
View file @
4da14e46
...
...
@@ -268,9 +268,9 @@ public final class DownloadManager {
}
/**
* Sets the requirements
needed to be met to start download
s.
* Sets the requirements
that need to be met for downloads to progres
s.
*
* @param requirements
Need to be met to start downloads
.
* @param requirements
A {@link Requirements}
.
*/
public
void
setRequirements
(
Requirements
requirements
)
{
if
(
requirements
.
equals
(
requirementsWatcher
.
getRequirements
()))
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java
View file @
4da14e46
This diff is collapsed.
Click to expand it.
library/core/src/main/java/com/google/android/exoplayer2/scheduler/Requirements.java
View file @
4da14e46
...
...
@@ -23,6 +23,8 @@ import android.net.Network;
import
android.net.NetworkCapabilities
;
import
android.net.NetworkInfo
;
import
android.os.BatteryManager
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.PowerManager
;
import
androidx.annotation.IntDef
;
import
com.google.android.exoplayer2.util.Log
;
...
...
@@ -31,10 +33,8 @@ import java.lang.annotation.Documented;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
/**
* Defines a set of device state requirements.
*/
public
final
class
Requirements
{
/** Defines a set of device state requirements. */
public
final
class
Requirements
implements
Parcelable
{
/**
* Requirement flags. Possible flag values are {@link #NETWORK}, {@link #NETWORK_UNMETERED},
...
...
@@ -205,4 +205,30 @@ public final class Requirements {
public
int
hashCode
()
{
return
requirements
;
}
// Parcelable implementation.
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeInt
(
requirements
);
}
public
static
final
Parcelable
.
Creator
<
Requirements
>
CREATOR
=
new
Creator
<
Requirements
>()
{
@Override
public
Requirements
createFromParcel
(
Parcel
in
)
{
return
new
Requirements
(
in
.
readInt
());
}
@Override
public
Requirements
[]
newArray
(
int
size
)
{
return
new
Requirements
[
size
];
}
};
}
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