Interface DownloadManager.Listener
-
- All Known Implementing Classes:
TestDownloadManagerListener
- Enclosing class:
- DownloadManager
public static interface DownloadManager.ListenerListener forDownloadManagerevents.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidonDownloadChanged(DownloadManager downloadManager, Download download, Exception finalException)Called when the state of a download changes.default voidonDownloadRemoved(DownloadManager downloadManager, Download download)Called when a download is removed.default voidonDownloadsPausedChanged(DownloadManager downloadManager, boolean downloadsPaused)default voidonIdle(DownloadManager downloadManager)Called when there is no active download left.default voidonInitialized(DownloadManager downloadManager)Called when all downloads have been restored.default voidonRequirementsStateChanged(DownloadManager downloadManager, Requirements requirements, int notMetRequirements)Called when the download requirements state changed.default voidonWaitingForRequirementsChanged(DownloadManager downloadManager, boolean waitingForRequirements)Called when there is a change in whether this manager has one or more downloads that are not progressing for the sole reason that theRequirementsare not met.
-
-
-
Method Detail
-
onInitialized
default void onInitialized(DownloadManager downloadManager)
Called when all downloads have been restored.- Parameters:
downloadManager- The reporting instance.
-
onDownloadsPausedChanged
default void onDownloadsPausedChanged(DownloadManager downloadManager, boolean downloadsPaused)
- Parameters:
downloadManager- The reporting instance.downloadsPaused- Whether downloads are currently paused.
-
onDownloadChanged
default void onDownloadChanged(DownloadManager downloadManager, Download download, @Nullable Exception finalException)
Called when the state of a download changes.- Parameters:
downloadManager- The reporting instance.download- The state of the download.finalException- If the download is transitioning toDownload.STATE_FAILED, this is the final exception that resulted in the failure.
-
onDownloadRemoved
default void onDownloadRemoved(DownloadManager downloadManager, Download download)
Called when a download is removed.- Parameters:
downloadManager- The reporting instance.download- The last state of the download before it was removed.
-
onIdle
default void onIdle(DownloadManager downloadManager)
Called when there is no active download left.- Parameters:
downloadManager- The reporting instance.
-
onRequirementsStateChanged
default void onRequirementsStateChanged(DownloadManager downloadManager, Requirements requirements, @RequirementFlags int notMetRequirements)
Called when the download requirements state changed.- Parameters:
downloadManager- The reporting instance.requirements- Requirements needed to be met to start downloads.notMetRequirements-RequirementFlagsthat are not met, or 0.
-
onWaitingForRequirementsChanged
default void onWaitingForRequirementsChanged(DownloadManager downloadManager, boolean waitingForRequirements)
Called when there is a change in whether this manager has one or more downloads that are not progressing for the sole reason that theRequirementsare not met. SeeDownloadManager.isWaitingForRequirements()for more information.- Parameters:
downloadManager- The reporting instance.waitingForRequirements- Whether this manager has one or more downloads that are not progressing for the sole reason that theRequirementsare not met.
-
-