|
|
@ -18,6 +18,7 @@ package com.arialyy.aria.core; |
|
|
|
import android.text.TextUtils; |
|
|
|
import android.text.TextUtils; |
|
|
|
import com.arialyy.aria.core.common.QueueMod; |
|
|
|
import com.arialyy.aria.core.common.QueueMod; |
|
|
|
import com.arialyy.aria.core.queue.DownloadTaskQueue; |
|
|
|
import com.arialyy.aria.core.queue.DownloadTaskQueue; |
|
|
|
|
|
|
|
import com.arialyy.aria.core.queue.UploadTaskQueue; |
|
|
|
import com.arialyy.aria.util.CommonUtil; |
|
|
|
import com.arialyy.aria.util.CommonUtil; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.lang.reflect.Field; |
|
|
@ -86,14 +87,6 @@ class Configuration { |
|
|
|
return maxTaskNum; |
|
|
|
return maxTaskNum; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public BaseConfig setMaxTaskNum(int maxTaskNum) { |
|
|
|
|
|
|
|
oldMaxTaskNum = this.maxTaskNum; |
|
|
|
|
|
|
|
this.maxTaskNum = maxTaskNum; |
|
|
|
|
|
|
|
saveKey("maxTaskNum", maxTaskNum + ""); |
|
|
|
|
|
|
|
DownloadTaskQueue.getInstance().setMaxTaskNum(maxTaskNum); |
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getReTryNum() { |
|
|
|
public int getReTryNum() { |
|
|
|
return reTryNum; |
|
|
|
return reTryNum; |
|
|
|
} |
|
|
|
} |
|
|
@ -250,6 +243,14 @@ class Configuration { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
double msxSpeed = 0.0; |
|
|
|
double msxSpeed = 0.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DownloadConfig setMaxTaskNum(int maxTaskNum) { |
|
|
|
|
|
|
|
oldMaxTaskNum = this.maxTaskNum; |
|
|
|
|
|
|
|
this.maxTaskNum = maxTaskNum; |
|
|
|
|
|
|
|
saveKey("maxTaskNum", maxTaskNum + ""); |
|
|
|
|
|
|
|
DownloadTaskQueue.getInstance().setMaxTaskNum(maxTaskNum); |
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getIOTimeOut() { |
|
|
|
public int getIOTimeOut() { |
|
|
|
return iOTimeOut; |
|
|
|
return iOTimeOut; |
|
|
|
} |
|
|
|
} |
|
|
@ -332,6 +333,14 @@ class Configuration { |
|
|
|
|
|
|
|
|
|
|
|
private static UploadConfig INSTANCE = null; |
|
|
|
private static UploadConfig INSTANCE = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UploadConfig setMaxTaskNum(int maxTaskNum) { |
|
|
|
|
|
|
|
oldMaxTaskNum = this.maxTaskNum; |
|
|
|
|
|
|
|
this.maxTaskNum = maxTaskNum; |
|
|
|
|
|
|
|
saveKey("maxTaskNum", maxTaskNum + ""); |
|
|
|
|
|
|
|
UploadTaskQueue.getInstance().setMaxTaskNum(maxTaskNum); |
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static UploadConfig getInstance() { |
|
|
|
static UploadConfig getInstance() { |
|
|
|
if (INSTANCE == null) { |
|
|
|
if (INSTANCE == null) { |
|
|
|
synchronized (DownloadConfig.class) { |
|
|
|
synchronized (DownloadConfig.class) { |
|
|
|