修复任务未下载时,直接删除任务导致的注解回调方法中任务状态错误

https://github.com/AriaLyy/Aria/issues/123
,重试失败任务添加网络状态判断,网络未连接,将会重试失败
https://github.com/AriaLyy/Aria/issues/119
This commit is contained in:
AriaLyy
2017-09-23 15:26:55 +08:00
parent 29aba07205
commit 21594d736c
20 changed files with 193 additions and 88 deletions

View File

@@ -60,19 +60,13 @@ public class UploadTask extends AbsNormalTask<UploadEntity> {
if (mUtil.isRunning()) {
mUtil.stop();
} else {
mEntity.setState(IEntity.STATE_STOP);
mEntity.update();
if (mOutHandler != null) {
mOutHandler.obtainMessage(ISchedulers.STOP, this).sendToTarget();
}
mListener.onStop(mEntity.getCurrentProgress());
}
}
@Override public void cancel() {
if (!mUtil.isRunning()) {
if (mOutHandler != null) {
mOutHandler.obtainMessage(ISchedulers.CANCEL, this).sendToTarget();
}
mListener.onCancel();
}
mUtil.cancel();
}