url添加Timestamp逻辑修改
This commit is contained in:
@ -190,7 +190,10 @@ public class DownloadManager {
|
||||
if (downloadEntity != null) {
|
||||
String url = downloadEntity.getUrl();
|
||||
checkDownloadEntryRecordValidate(url);
|
||||
if (!isFileCompleted(url) && !isTaskDownloading(url)) {
|
||||
if (isFileCompleted(url)) {
|
||||
downloadEntity.setStatus(DownloadStatus.done);
|
||||
DataChanger.getInstance().notifyDataChanged(downloadEntity);
|
||||
} else if (!isTaskDownloading(url)) {
|
||||
context.startService(getIntent(downloadEntity, DownloadStatus.add));
|
||||
}
|
||||
}
|
||||
@ -263,7 +266,10 @@ public class DownloadManager {
|
||||
add(entry);
|
||||
} else {
|
||||
if (entry != null) {
|
||||
if (!isFileCompleted(url) && !isTaskDownloading(url)) {
|
||||
if (isFileCompleted(url)) {
|
||||
entry.setStatus(DownloadStatus.done);
|
||||
DataChanger.getInstance().notifyDataChanged(entry);
|
||||
} else if (!isTaskDownloading(url)) {
|
||||
context.startService(getIntent(entry, DownloadStatus.resume));
|
||||
}
|
||||
}
|
||||
@ -290,6 +296,7 @@ public class DownloadManager {
|
||||
Utils.log(DownloadManager.class.getSimpleName(), "cancle==>file and record were deleted!");
|
||||
}
|
||||
if (entry != null) {
|
||||
entry.setStatus(DownloadStatus.cancel);
|
||||
context.startService(getIntent(entry, DownloadStatus.cancel));
|
||||
Utils.log(DownloadManager.class.getSimpleName(), "cancel");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user