修复暂停问题

pull/330/head
AriaLyy 7 years ago
parent 2d64c50ed0
commit 0a6e12fe6c
  1. 4
      Aria/build.gradle
  2. 4
      Aria/src/main/java/com/arialyy/aria/core/common/AbsFileer.java
  3. 1
      Aria/src/main/java/com/arialyy/aria/core/download/DownloadTarget.java
  4. 1
      Aria/src/main/java/com/arialyy/aria/core/scheduler/AbsSchedulers.java

@ -23,8 +23,8 @@ dependencies {
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1'
compile project(':AriaAnnotations') compile project(':AriaAnnotations')
compile 'com.arialyy.aria:aria-ftp-plug:1.0.1' // compile 'com.arialyy.aria:aria-ftp-plug:1.0.1'
// compile project(':AriaFtpPlug') compile project(':AriaFtpPlug')
} }
apply from: 'bintray-release.gradle' apply from: 'bintray-release.gradle'

@ -325,9 +325,11 @@ public abstract class AbsFileer<ENTITY extends AbsNormalEntity, TASK_ENTITY exte
//如果有记录,则恢复下载 //如果有记录,则恢复下载
if (!isNewTask && record != null && Long.parseLong(record + "") >= 0) { if (!isNewTask && record != null && Long.parseLong(record + "") >= 0) {
Long r = Long.parseLong(record + ""); Long r = Long.parseLong(record + "");
if (r > startL) {
mConstance.CURRENT_LOCATION += r - startL; mConstance.CURRENT_LOCATION += r - startL;
Log.d(TAG, "任务【" + mEntity.getFileName() + "】线程__" + i + "__恢复下载");
startL = r; startL = r;
}
Log.d(TAG, "任务【" + mEntity.getFileName() + "】线程__" + i + "__恢复下载");
recordL[rl] = i; recordL[rl] = i;
rl++; rl++;
} else { } else {

@ -74,7 +74,6 @@ public class DownloadTarget
entity.save(); entity.save();
mTaskEntity.save(); mTaskEntity.save();
} }
mEntity = mTaskEntity.entity; mEntity = mTaskEntity.entity;
} }

@ -154,6 +154,7 @@ abstract class AbsSchedulers<TASK_ENTITY extends AbsTaskEntity, ENTITY extends A
if (task.getEntity().getState() == IEntity.STATE_WAIT) { if (task.getEntity().getState() == IEntity.STATE_WAIT) {
break; break;
} }
startNextTask();
case CANCEL: case CANCEL:
mQueue.removeTask(entity); mQueue.removeTask(entity);
if (mQueue.getCurrentExePoolNum() < AriaManager.getInstance(AriaManager.APP) if (mQueue.getCurrentExePoolNum() < AriaManager.getInstance(AriaManager.APP)

Loading…
Cancel
Save