DownloadManager
A Manager for Download assets. Takes care of managing download tasks and retrieving cached downloads.
Types
Functions
Adds a Listener to the list of download events listeners.
Returns a valid Download object upon successful Queueing of request. Also, DownloadManager.Listener.onDownloadStateChanged will be triggered Note that Download.mediaURL will correspond to DownloadRequest.mediaURL.
Returns all downloads. Includes downloads that are ongoing as well as terminal.
Returns current downloads. Downloads that are in terminal states (i.e. completed or failed) are not included.
Determines whether the manager has completed initialization.
Pauses a given Download.
Pauses all non-terminal download tasks. Useful, when we want to pause all downloads when a certain criteria is met.
Purges a given Download.
Removes the Listener from the list of download events listeners.
Obtains the LicenseInfo for a particular Download This API returns appropriate Error on License Retrieval Failure.
Resumes a given Download.
Resumes all non-terminal download tasks Useful, when we want to resume all downloads when a certain criteria is met.
Shuts down the DownloadManager by stopping all the on-going tasks. The DownloadManager is unusable after this. A new instance needs to be created for any new request processing.
On demand enables or disables (toggles) the task to automatically purge all the downloads which expired. Note that the initial value to enable/disable this task is passed as DownloadProperties.downloadsAutoPurgeOnExpiry during DownloadManager instance creation.