android-components / mozilla.components.feature.downloads.manager / FetchDownloadManager


class FetchDownloadManager<T : AbstractFetchDownloadService> : DownloadManager (source)

Handles the interactions with AbstractFetchDownloadService.


Name Summary
<init> FetchDownloadManager(applicationContext: <ERROR CLASS>, service: KClass<T>, broadcastManager: LocalBroadcastManager = LocalBroadcastManager.getInstance(applicationContext), onDownloadStopped: onDownloadStopped = noop)
Handles the interactions with AbstractFetchDownloadService.


Name Summary
onDownloadStopped var onDownloadStopped: onDownloadStopped
permissions val permissions: <ERROR CLASS>


Name Summary
download fun download(download: DownloadState, cookie: String): Long?
Schedules a download through the AbstractFetchDownloadService.
onReceive fun onReceive(context: <ERROR CLASS>, intent: <ERROR CLASS>): Unit
Invoked when a download is complete. Calls onDownloadStopped and unregisters the broadcast receiver if there are no more queued downloads.
tryAgain fun tryAgain(downloadId: Long): Unit
Schedules another attempt at downloading the given download.
unregisterListeners fun unregisterListeners(): Unit
Remove all the listeners.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.
validatePermissionGranted fun DownloadManager.validatePermissionGranted(context: <ERROR CLASS>): Unit