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
d656782b
authored
Apr 17, 2019
by
olly
Committed by
Andrew Lewis
Apr 18, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Don't start download if user explicitly deselects all tracks
PiperOrigin-RevId: 244003817
parent
a0fe7ace
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
demos/main/src/main/java/com/google/android/exoplayer2/demo/DownloadTracker.java
demos/main/src/main/java/com/google/android/exoplayer2/demo/DownloadTracker.java
View file @
d656782b
...
@@ -240,7 +240,12 @@ public class DownloadTracker {
...
@@ -240,7 +240,12 @@ public class DownloadTracker {
}
}
}
}
}
}
startDownload
();
DownloadRequest
downloadRequest
=
buildDownloadRequest
();
if
(
downloadRequest
.
streamKeys
.
isEmpty
())
{
// All tracks were deselected in the dialog. Don't start the download.
return
;
}
startDownload
(
downloadRequest
);
}
}
// DialogInterface.OnDismissListener implementation.
// DialogInterface.OnDismissListener implementation.
...
@@ -254,9 +259,16 @@ public class DownloadTracker {
...
@@ -254,9 +259,16 @@ public class DownloadTracker {
// Internal methods.
// Internal methods.
private
void
startDownload
()
{
private
void
startDownload
()
{
DownloadRequest
downloadRequest
=
downloadHelper
.
getDownloadRequest
(
Util
.
getUtf8Bytes
(
name
));
startDownload
(
buildDownloadRequest
());
}
private
void
startDownload
(
DownloadRequest
downloadRequest
)
{
DownloadService
.
startWithNewDownload
(
DownloadService
.
startWithNewDownload
(
context
,
DemoDownloadService
.
class
,
downloadRequest
,
/* foreground= */
false
);
context
,
DemoDownloadService
.
class
,
downloadRequest
,
/* foreground= */
false
);
}
}
private
DownloadRequest
buildDownloadRequest
()
{
return
downloadHelper
.
getDownloadRequest
(
Util
.
getUtf8Bytes
(
name
));
}
}
}
}
}
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