Class Download
- java.lang.Object
-
- com.google.android.exoplayer2.offline.Download
-
@Deprecated public final class Download extends Object
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Represents state of a download.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDownload.FailureReasonDeprecated.Failure reasons.static interfaceDownload.StateDeprecated.Download states.
-
Field Summary
Fields Modifier and Type Field Description longcontentLengthDeprecated.The total size of the content in bytes, orC.LENGTH_UNSETif unknown.static intFAILURE_REASON_NONEDeprecated.The download isn't failed.static intFAILURE_REASON_UNKNOWNDeprecated.The download is failed because of unknown reason.@com.google.android.exoplayer2.offline.Download.FailureReason intfailureReasonDeprecated.DownloadRequestrequestDeprecated.The download request.longstartTimeMsDeprecated.The first time when download entry is created.@com.google.android.exoplayer2.offline.Download.State intstateDeprecated.The state of the download.static intSTATE_COMPLETEDDeprecated.The download completed.static intSTATE_DOWNLOADINGDeprecated.The download is currently started.static intSTATE_FAILEDDeprecated.The download failed.static intSTATE_QUEUEDDeprecated.The download is waiting to be started.static intSTATE_REMOVINGDeprecated.The download is being removed.static intSTATE_RESTARTINGDeprecated.The download will restart after all downloaded data is removed.static intSTATE_STOPPEDDeprecated.The download is stopped for a specifiedstopReason.static intSTOP_REASON_NONEDeprecated.The download isn't stopped.intstopReasonDeprecated.The reason the download is stopped, orSTOP_REASON_NONE.longupdateTimeMsDeprecated.The last update time.
-
Constructor Summary
Constructors Constructor Description Download(DownloadRequest request, @com.google.android.exoplayer2.offline.Download.State int state, long startTimeMs, long updateTimeMs, long contentLength, int stopReason, @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason)Deprecated.Download(DownloadRequest request, @com.google.android.exoplayer2.offline.Download.State int state, long startTimeMs, long updateTimeMs, long contentLength, int stopReason, @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason, DownloadProgress progress)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longgetBytesDownloaded()Deprecated.Returns the total number of downloaded bytes.floatgetPercentDownloaded()Deprecated.Returns the estimated download percentage, orC.PERCENTAGE_UNSETif no estimate is available.booleanisTerminalState()Deprecated.Returns whether the download is completed or failed.
-
-
-
Field Detail
-
STATE_QUEUED
public static final int STATE_QUEUED
Deprecated.The download is waiting to be started. A download may be queued because theDownloadManager- Is
DownloadManager#getDownloadsPaused() paused - Has
DownloadManager#getRequirements() Requirementsthat are not met - Has already started
DownloadManager#getMaxParallelDownloads() maxParallelDownloads
- See Also:
- Constant Field Values
- Is
-
STATE_STOPPED
public static final int STATE_STOPPED
Deprecated.The download is stopped for a specifiedstopReason.- See Also:
- Constant Field Values
-
STATE_DOWNLOADING
public static final int STATE_DOWNLOADING
Deprecated.The download is currently started.- See Also:
- Constant Field Values
-
STATE_COMPLETED
public static final int STATE_COMPLETED
Deprecated.The download completed.- See Also:
- Constant Field Values
-
STATE_FAILED
public static final int STATE_FAILED
Deprecated.The download failed.- See Also:
- Constant Field Values
-
STATE_REMOVING
public static final int STATE_REMOVING
Deprecated.The download is being removed.- See Also:
- Constant Field Values
-
STATE_RESTARTING
public static final int STATE_RESTARTING
Deprecated.The download will restart after all downloaded data is removed.- See Also:
- Constant Field Values
-
FAILURE_REASON_NONE
public static final int FAILURE_REASON_NONE
Deprecated.The download isn't failed.- See Also:
- Constant Field Values
-
FAILURE_REASON_UNKNOWN
public static final int FAILURE_REASON_UNKNOWN
Deprecated.The download is failed because of unknown reason.- See Also:
- Constant Field Values
-
STOP_REASON_NONE
public static final int STOP_REASON_NONE
Deprecated.The download isn't stopped.- See Also:
- Constant Field Values
-
request
public final DownloadRequest request
Deprecated.The download request.
-
state
@State public final @com.google.android.exoplayer2.offline.Download.State int state
Deprecated.The state of the download.
-
startTimeMs
public final long startTimeMs
Deprecated.The first time when download entry is created.
-
updateTimeMs
public final long updateTimeMs
Deprecated.The last update time.
-
contentLength
public final long contentLength
Deprecated.The total size of the content in bytes, orC.LENGTH_UNSETif unknown.
-
stopReason
public final int stopReason
Deprecated.The reason the download is stopped, orSTOP_REASON_NONE.
-
failureReason
@FailureReason public final @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason
Deprecated.
-
-
Constructor Detail
-
Download
public Download(DownloadRequest request, @State @com.google.android.exoplayer2.offline.Download.State int state, long startTimeMs, long updateTimeMs, long contentLength, int stopReason, @FailureReason @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason)
Deprecated.
-
Download
public Download(DownloadRequest request, @State @com.google.android.exoplayer2.offline.Download.State int state, long startTimeMs, long updateTimeMs, long contentLength, int stopReason, @FailureReason @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason, DownloadProgress progress)
Deprecated.
-
-
Method Detail
-
isTerminalState
public boolean isTerminalState()
Deprecated.Returns whether the download is completed or failed. These are terminal states.
-
getBytesDownloaded
public long getBytesDownloaded()
Deprecated.Returns the total number of downloaded bytes.
-
getPercentDownloaded
public float getPercentDownloaded()
Deprecated.Returns the estimated download percentage, orC.PERCENTAGE_UNSETif no estimate is available.
-
-