|
|
@ -133,10 +133,7 @@ public class DownloadTask extends AbsTask<DownloadTaskEntity, DownloadEntity> { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override public void cancel() { |
|
|
|
@Override public void cancel() { |
|
|
|
if (!mEntity.isDownloadComplete()) { |
|
|
|
if (!mEntity.isDownloadComplete()) { |
|
|
|
mUtil.cancelDownload(); |
|
|
|
if (!mUtil.isDownloading()) { |
|
|
|
mUtil.delConfigFile(); |
|
|
|
|
|
|
|
mUtil.delTempFile(); |
|
|
|
|
|
|
|
mEntity.deleteData(); |
|
|
|
|
|
|
|
if (mOutHandler != null) { |
|
|
|
if (mOutHandler != null) { |
|
|
|
mOutHandler.obtainMessage(DownloadSchedulers.CANCEL, this).sendToTarget(); |
|
|
|
mOutHandler.obtainMessage(DownloadSchedulers.CANCEL, this).sendToTarget(); |
|
|
|
} |
|
|
|
} |
|
|
@ -145,6 +142,11 @@ public class DownloadTask extends AbsTask<DownloadTaskEntity, DownloadEntity> { |
|
|
|
intent.putExtra(Aria.DOWNLOAD_ENTITY, mEntity); |
|
|
|
intent.putExtra(Aria.DOWNLOAD_ENTITY, mEntity); |
|
|
|
mContext.sendBroadcast(intent); |
|
|
|
mContext.sendBroadcast(intent); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
mUtil.cancelDownload(); |
|
|
|
|
|
|
|
mUtil.delConfigFile(); |
|
|
|
|
|
|
|
mUtil.delTempFile(); |
|
|
|
|
|
|
|
mEntity.deleteData(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class Builder { |
|
|
|
public static class Builder { |
|
|
|