修复任务未下载时,直接删除任务导致的注解回调方法中任务状态错误
https://github.com/AriaLyy/Aria/issues/123 ,重试失败任务添加网络状态判断,网络未连接,将会重试失败 https://github.com/AriaLyy/Aria/issues/119
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user