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
d4f5c9c7
authored
Mar 26, 2019
by
eguven
Committed by
Toni
Mar 29, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove DownloadHelper.getRemoveAction
PiperOrigin-RevId: 240444051
parent
9d99f921
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
25 deletions
demos/main/src/main/java/com/google/android/exoplayer2/demo/DownloadTracker.java
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
library/core/src/test/java/com/google/android/exoplayer2/offline/DownloadHelperTest.java
demos/main/src/main/java/com/google/android/exoplayer2/demo/DownloadTracker.java
View file @
d4f5c9c7
...
...
@@ -106,10 +106,10 @@ public class DownloadTracker implements DownloadManager.Listener {
Uri
uri
,
String
extension
,
RenderersFactory
renderersFactory
)
{
if
(
isDownloaded
(
uri
))
{
DownloadAction
removeAction
=
getDownloadHelper
(
uri
,
extension
,
renderersFactory
).
getRemoveAction
();
startServiceWithAction
(
removeAction
);
DownloadState
downloadState
=
downloadStates
.
get
(
uri
);
if
(
downloadState
!=
null
)
{
DownloadService
.
startWithRemoveDownload
(
context
,
DemoDownloadService
.
class
,
downloadState
.
id
,
/* foreground= */
false
);
}
else
{
if
(
startDownloadDialogHelper
!=
null
)
{
startDownloadDialogHelper
.
release
();
...
...
@@ -153,7 +153,8 @@ public class DownloadTracker implements DownloadManager.Listener {
}
private
void
startServiceWithAction
(
DownloadAction
action
)
{
DownloadService
.
startWithAction
(
context
,
DemoDownloadService
.
class
,
action
,
false
);
DownloadService
.
startWithAction
(
context
,
DemoDownloadService
.
class
,
action
,
/* foreground= */
false
);
}
private
DownloadHelper
getDownloadHelper
(
...
...
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
View file @
d4f5c9c7
...
...
@@ -606,15 +606,6 @@ public final class DownloadHelper {
return
DownloadAction
.
createDownloadAction
(
downloadType
,
uri
,
streamKeys
,
cacheKey
,
data
);
}
/**
* Builds a {@link DownloadAction} for removing the media. May be called in any state.
*
* @return The built {@link DownloadAction}.
*/
public
DownloadAction
getRemoveAction
()
{
return
DownloadAction
.
createRemoveAction
(
downloadType
,
uri
,
cacheKey
);
}
// Initialization of array of Lists.
@SuppressWarnings
(
"unchecked"
)
private
void
onMediaPrepared
()
{
...
...
library/core/src/test/java/com/google/android/exoplayer2/offline/DownloadHelperTest.java
View file @
d4f5c9c7
...
...
@@ -26,7 +26,6 @@ import com.google.android.exoplayer2.RenderersFactory;
import
com.google.android.exoplayer2.Timeline
;
import
com.google.android.exoplayer2.offline.DownloadHelper.Callback
;
import
com.google.android.exoplayer2.source.MediaPeriod
;
import
com.google.android.exoplayer2.source.MediaSource.MediaPeriodId
;
import
com.google.android.exoplayer2.source.MediaSourceEventListener.EventDispatcher
;
import
com.google.android.exoplayer2.source.TrackGroup
;
import
com.google.android.exoplayer2.source.TrackGroupArray
;
...
...
@@ -411,16 +410,6 @@ public class DownloadHelperTest {
new
StreamKey
(
/* periodIndex= */
1
,
/* groupIndex= */
1
,
/* trackIndex= */
0
));
}
@Test
public
void
getRemoveAction_returnsRemoveAction
()
{
DownloadAction
removeAction
=
downloadHelper
.
getRemoveAction
();
assertThat
(
removeAction
.
type
).
isEqualTo
(
TEST_DOWNLOAD_TYPE
);
assertThat
(
removeAction
.
uri
).
isEqualTo
(
testUri
);
assertThat
(
removeAction
.
customCacheKey
).
isEqualTo
(
TEST_CACHE_KEY
);
assertThat
(
removeAction
.
isRemoveAction
).
isTrue
();
}
private
static
void
prepareDownloadHelper
(
DownloadHelper
downloadHelper
)
throws
Exception
{
AtomicReference
<
Exception
>
prepareException
=
new
AtomicReference
<>(
null
);
ConditionVariable
preparedCondition
=
new
ConditionVariable
();
...
...
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