Code optimization

v4
laoyuyu 2 years ago
parent 5d0f59f7e9
commit 80212ad810
  1. 50
      PublicComponent/src/main/java/com/arialyy/aria/core/inf/IBlockManager.java

@ -15,7 +15,6 @@
*/ */
package com.arialyy.aria.core.inf; package com.arialyy.aria.core.inf;
import android.os.Handler;
import com.arialyy.aria.core.task.IThreadTask; import com.arialyy.aria.core.task.IThreadTask;
import com.arialyy.aria.orm.entity.BlockRecord; import com.arialyy.aria.orm.entity.BlockRecord;
import java.util.List; import java.util.List;
@ -23,62 +22,15 @@ import java.util.List;
/** /**
* 线程任务状态 * 线程任务状态
*/ */
public interface IBlockManager { public interface IBlockManager extends ITaskManager {
int STATE_STOP = 0x01;
int STATE_FAIL = 0x02;
int STATE_CANCEL = 0x03;
int STATE_COMPLETE = 0x04;
int STATE_RUNNING = 0x05;
int STATE_UPDATE_PROGRESS = 0x06;
int STATE_PRE = 0x07;
int STATE_START = 0x08;
String DATA_RETRY = "DATA_RETRY";
String DATA_ERROR_INFO = "DATA_ERROR_INFO";
String DATA_THREAD_NAME = "DATA_THREAD_NAME";
String DATA_THREAD_LOCATION = "DATA_THREAD_LOCATION";
String DATA_ADD_LEN = "DATA_ADD_LEN"; // 增加的长度
void setLooper();
void start(List<IThreadTask> threadTaskList); void start(List<IThreadTask> threadTaskList);
void stop();
void setBlockNum(int blockNum); void setBlockNum(int blockNum);
void putUnfinishedBlock(BlockRecord record); void putUnfinishedBlock(BlockRecord record);
List<BlockRecord> getUnfinishedBlockList(); List<BlockRecord> getUnfinishedBlockList();
/**
* 是否有失败的快
*
* @return true 有失败的快
*/
boolean hasFailedBlock();
/**
* 任务是否已经完成
*
* @return true 任务已完成
*/
boolean isCompleted();
/**
* 获取当前任务进度
*
* @return 任务当前进度
*/
long getCurrentProgress();
boolean isStopped();
boolean isCanceled();
boolean isRunning();
/**
* 创建handler 回调
*/
Handler getHandler();
} }

Loading…
Cancel
Save