修复monkey测试出现的两个bug
This commit is contained in:
@ -106,6 +106,10 @@ public class DownloadTaskQueue implements ITaskQueue {
|
||||
}
|
||||
|
||||
@Override public void reTryStart(Task task) {
|
||||
if (task == null){
|
||||
Log.w(TAG, "重试下载失败,task 为null");
|
||||
return;
|
||||
}
|
||||
if (!task.isDownloading()) {
|
||||
task.start();
|
||||
} else {
|
||||
|
@ -75,7 +75,7 @@ final class DownloadUtil implements IDownloadUtil {
|
||||
mDownloadEntity = entity;
|
||||
mListener = downloadListener;
|
||||
THREAD_NUM = threadNum;
|
||||
mFixedThreadPool = Executors.newFixedThreadPool(THREAD_NUM);
|
||||
mFixedThreadPool = Executors.newFixedThreadPool(Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
public IDownloadListener getListener() {
|
||||
@ -292,7 +292,7 @@ final class DownloadUtil implements IDownloadUtil {
|
||||
for (int l : recordL) {
|
||||
if (l == -1) continue;
|
||||
Runnable task = mTask.get(l);
|
||||
if (task != null) {
|
||||
if (task != null && !mFixedThreadPool.isShutdown()) {
|
||||
mFixedThreadPool.execute(task);
|
||||
}
|
||||
}
|
||||
|
@ -113,4 +113,4 @@ License
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
limitations under the License.
|
Reference in New Issue
Block a user