3.7.7
This commit is contained in:
@@ -34,10 +34,6 @@ public abstract class AbsThreadTaskAdapter implements IThreadTaskAdapter {
|
||||
* 速度限制工具
|
||||
*/
|
||||
protected BandwidthLimiter mSpeedBandUtil;
|
||||
/**
|
||||
* 当前线程的下去区间的进度
|
||||
*/
|
||||
private long mRangeProgress;
|
||||
private ThreadRecord mThreadRecord;
|
||||
private IThreadTaskObserver mObserver;
|
||||
private AbsTaskWrapper mWrapper;
|
||||
@@ -48,7 +44,6 @@ public abstract class AbsThreadTaskAdapter implements IThreadTaskAdapter {
|
||||
mThreadRecord = config.record;
|
||||
mWrapper = config.taskWrapper;
|
||||
mThreadConfig = config;
|
||||
mRangeProgress = mThreadRecord.startLocation;
|
||||
if (getTaskConfig().getMaxSpeed() > 0) {
|
||||
mSpeedBandUtil = new BandwidthLimiter(getTaskConfig().getMaxSpeed(), config.startThreadNum);
|
||||
}
|
||||
@@ -68,7 +63,7 @@ public abstract class AbsThreadTaskAdapter implements IThreadTaskAdapter {
|
||||
* 当前线程的下去区间的进度
|
||||
*/
|
||||
protected long getRangeProgress() {
|
||||
return mRangeProgress;
|
||||
return mObserver.getThreadProgress();
|
||||
}
|
||||
|
||||
protected ThreadRecord getThreadRecord() {
|
||||
|
||||
@@ -53,4 +53,9 @@ public interface IThreadTaskObserver {
|
||||
* @param len 新增的长度
|
||||
*/
|
||||
void updateProgress(long len);
|
||||
|
||||
/**
|
||||
* 获取线程当前进度
|
||||
*/
|
||||
long getThreadProgress();
|
||||
}
|
||||
|
||||
@@ -318,6 +318,11 @@ public class ThreadTask implements IThreadTask, IThreadTaskObserver {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getThreadProgress() {
|
||||
return mRangeProgress;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消任务
|
||||
*/
|
||||
|
||||
@@ -101,9 +101,6 @@ public class ComponentUtil {
|
||||
public <T extends IUtil> T buildUtil(AbsTaskWrapper wrapper, IEventListener listener) {
|
||||
int requestType = wrapper.getRequestType();
|
||||
String className = null;
|
||||
if (requestType == 1){
|
||||
throw new IllegalArgumentException("xxxx");
|
||||
}
|
||||
switch (requestType) {
|
||||
case ITaskWrapper.M3U8_LIVE:
|
||||
className = "com.arialyy.aria.m3u8.live.M3U8LiveUtil";
|
||||
|
||||
Reference in New Issue
Block a user