|
|
@@ -34,23 +34,23 @@ public class DownloadService extends Service{
|
|
|
}
|
|
|
|
|
|
@Download.onPre void onPre(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "onPre", task.getKey());//, task.getTaskName());
|
|
|
+ LogUtil.println("DownloadService", "onPre", task.getKey(), task.getTaskName());
|
|
|
}
|
|
|
@Download.onTaskStart void taskStart(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "taskStart", task.getKey());//, task.getTaskName());
|
|
|
+ LogUtil.println("DownloadService", "taskStart", task.getKey(), task.getTaskName());
|
|
|
}
|
|
|
@Download.onTaskResume void taskResume(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "taskResume", task.getKey());//, task.getTaskName());
|
|
|
+ LogUtil.println("DownloadService", "taskResume", task.getKey(), task.getTaskName());
|
|
|
}
|
|
|
//在这里处理任务执行中的状态,如进度进度条的刷新
|
|
|
@Download.onTaskRunning protected void running(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "running", task.getKey(), /*task.getTaskName(),*/ task.getPercent());
|
|
|
+ LogUtil.println("DownloadService", "running", task.getKey(), task.getTaskName(), task.getPercent());
|
|
|
mDownloadTaskService.setDownloadTaskPercent(task.getPercent(), task.getCurrentProgress()/1024d/1024d,task.getFileSize()/1024d/1024d,0,task.getKey());
|
|
|
EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.GENERATION_ACCOUNT_REFRESH_ADAPTER).setData(task));
|
|
|
}
|
|
|
|
|
|
@Download.onTaskStop void taskStop(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "taskStop", task.getKey());//, task.getTaskName());
|
|
|
+ LogUtil.println("DownloadService", "taskStop", task.getKey(), task.getTaskName());
|
|
|
mDownloadTaskService.setDownloadTaskStatus(task.getKey(), DownloadUtil.STATUS_PAUSE);
|
|
|
EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_STOP).setData(task));
|
|
|
}
|
|
|
@@ -59,13 +59,13 @@ public class DownloadService extends Service{
|
|
|
}
|
|
|
|
|
|
@Download.onTaskCancel void taskCancel(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "taskCancel", task.getKey());//, task.getTaskName());
|
|
|
+ LogUtil.println("DownloadService", "taskCancel", task.getKey(), task.getTaskName());
|
|
|
mDownloadTaskService.deleteDownloadTaskByDownloadUrl(task.getKey());
|
|
|
EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_CANCEL).setData(task));
|
|
|
}
|
|
|
|
|
|
@Download.onTaskFail void taskFail(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "taskFail", task.getKey());//, task.getTaskName());
|
|
|
+ LogUtil.println("DownloadService", "taskFail", task.getKey(), task.getTaskName());
|
|
|
mDownloadTaskService.setDownloadTaskStatus(task.getKey(), DownloadUtil.STATUS_FAIL);
|
|
|
EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_FAIL).setData(task));
|
|
|
//空间不足,弹框提示
|
|
|
@@ -79,7 +79,7 @@ public class DownloadService extends Service{
|
|
|
}
|
|
|
|
|
|
@Download.onTaskComplete void taskComplete(DownloadTask task) {
|
|
|
- LogUtil.println("DownloadService", "taskComplete", task.getKey());//, task.getTaskName());
|
|
|
+ LogUtil.println("DownloadService", "taskComplete", task.getKey(), task.getTaskName());
|
|
|
mDownloadTaskService.setDownloadTaskFinish(task.getKey(), task.getDownloadPath());
|
|
|
ApkUtils.installApk(getApplicationContext(), task.getDownloadPath());
|
|
|
EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_COMPLETE).setData(task));
|