|
|
|
@ -22,7 +22,6 @@ import android.os.Message; |
|
|
|
|
import android.text.TextUtils; |
|
|
|
|
import com.arialyy.aria.core.TaskRecord; |
|
|
|
|
import com.arialyy.aria.core.common.AbsEntity; |
|
|
|
|
import com.arialyy.aria.core.common.AbsNormalEntity; |
|
|
|
|
import com.arialyy.aria.core.common.CompleteInfo; |
|
|
|
|
import com.arialyy.aria.core.inf.IThreadStateManager; |
|
|
|
|
import com.arialyy.aria.core.manager.ThreadTaskManager; |
|
|
|
@ -116,7 +115,8 @@ public final class SubLoader implements ILoader, ILoaderVisitor { |
|
|
|
|
sendNormalState(IThreadStateManager.STATE_COMPLETE); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
List<IThreadTask> task = ttBuild.buildThreadTask(record, new Handler(looper, mStateManager.getHandlerCallback())); |
|
|
|
|
List<IThreadTask> task = |
|
|
|
|
ttBuild.buildThreadTask(record, new Handler(looper, mStateManager.getHandlerCallback())); |
|
|
|
|
mStateManager.setLooper(record, looper); |
|
|
|
|
if (task == null || task.isEmpty()) { |
|
|
|
|
ALog.e(TAG, "创建子任务的线程任务失败,key:" + wrapper.getKey()); |
|
|
|
@ -129,7 +129,6 @@ public final class SubLoader implements ILoader, ILoaderVisitor { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sendNormalState(IThreadStateManager.STATE_PRE); |
|
|
|
|
mTask.addAll(task); |
|
|
|
|
try { |
|
|
|
@ -181,12 +180,12 @@ public final class SubLoader implements ILoader, ILoaderVisitor { |
|
|
|
|
for (IThreadTask iThreadTask : mTask) { |
|
|
|
|
iThreadTask.stop(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override public boolean isRunning() { |
|
|
|
|
if(mTask.isEmpty()) |
|
|
|
|
if (mTask.isEmpty()) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
for (IThreadTask iThreadTask : mTask) { |
|
|
|
|
if (!iThreadTask.isBreak()) return true; |
|
|
|
|
} |
|
|
|
@ -223,7 +222,8 @@ public final class SubLoader implements ILoader, ILoaderVisitor { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override public long getCurrentProgress() { |
|
|
|
|
return isRunning() ? mStateManager.getCurrentProgress() : getWrapper().getEntity().getCurrentProgress(); |
|
|
|
|
return isRunning() ? mStateManager.getCurrentProgress() |
|
|
|
|
: getWrapper().getEntity().getCurrentProgress(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override public void addComponent(IRecordHandler recordHandler) { |
|
|
|
|