Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ public Result doWork() {
updateNotification(context, filename == null ? url : filename, DownloadStatus.RUNNING, task.progress, null, false);
taskDao.updateTask(getId().toString(), DownloadStatus.RUNNING, task.progress);

//automatic resume for partial files. (if the workmanager unexpectedly quited in background)
String saveFilePath = savedDir + File.separator + filename;
File partialFile = new File(saveFilePath);
if (partialFile.exists()) {
isResume = true;
log("exists file for "+ filename + "automatic resuming...");
}

try {
downloadFile(context, url, savedDir, filename, headers, isResume);
cleanUp();
Expand Down