mirror of
https://github.com/androidx/media.git
synced 2025-05-12 18:19:50 +08:00
Add a convenience constructor for DownloadManagers
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=193940183
This commit is contained in:
parent
adc77fd0b1
commit
f6d5cb9934
@ -29,6 +29,8 @@ import android.support.annotation.IntDef;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.offline.DownloadAction.Deserializer;
|
import com.google.android.exoplayer2.offline.DownloadAction.Deserializer;
|
||||||
|
import com.google.android.exoplayer2.upstream.DataSource;
|
||||||
|
import com.google.android.exoplayer2.upstream.cache.Cache;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -93,6 +95,26 @@ public final class DownloadManager {
|
|||||||
private boolean released;
|
private boolean released;
|
||||||
private boolean downloadsStopped;
|
private boolean downloadsStopped;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a {@link DownloadManager}.
|
||||||
|
*
|
||||||
|
* @param cache Cache instance to be used to store downloaded data.
|
||||||
|
* @param upstreamDataSourceFactory A {@link DataSource.Factory} for creating data sources for
|
||||||
|
* downloading upstream data.
|
||||||
|
* @param actionSaveFile File to save active actions.
|
||||||
|
* @param deserializers Used to deserialize {@link DownloadAction}s.
|
||||||
|
*/
|
||||||
|
public DownloadManager(
|
||||||
|
Cache cache,
|
||||||
|
DataSource.Factory upstreamDataSourceFactory,
|
||||||
|
String actionSaveFile,
|
||||||
|
Deserializer... deserializers) {
|
||||||
|
this(
|
||||||
|
new DownloaderConstructorHelper(cache, upstreamDataSourceFactory),
|
||||||
|
actionSaveFile,
|
||||||
|
deserializers);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a {@link DownloadManager}.
|
* Constructs a {@link DownloadManager}.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user