Merge branch 'qa_d82x'
1+16已封版发布 # Conflicts: # app/build.gradle # app/src/main/java/com/mogo/launcher/MogoApplication.java # gradle.properties # modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java # modules/mogo-module-search/src/main/res/values/dimens.xml
This commit is contained in:
@@ -7,6 +7,8 @@ import com.mogo.utils.logger.Logger;
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 各个模块递调试信息控制接口
|
||||
* <p>
|
||||
* 注:该类已经不再是简单的调试配置,已经涉及到功能逻辑了 囧
|
||||
*/
|
||||
public class DebugConfig {
|
||||
|
||||
@@ -115,17 +117,18 @@ public class DebugConfig {
|
||||
|
||||
/**
|
||||
* 设置使用哪个语音助手
|
||||
*
|
||||
* @param aiType {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
*/
|
||||
public static void setAIType(int aiType){
|
||||
Logger.d("DebugConfig", "setAiType: " + aiType);
|
||||
public static void setAIType( int aiType ) {
|
||||
Logger.d( "DebugConfig", "setAiType: " + aiType );
|
||||
sAIType = aiType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用哪个语音助手 {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
*/
|
||||
public static int getAIType(){
|
||||
public static int getAIType() {
|
||||
return sAIType;
|
||||
}
|
||||
|
||||
@@ -164,4 +167,14 @@ public class DebugConfig {
|
||||
public static void setActiveAIAssistFlag( boolean sActiveAIAssistFlag ) {
|
||||
DebugConfig.sActiveAIAssistFlag = sActiveAIAssistFlag;
|
||||
}
|
||||
|
||||
private static boolean useMockObuData;
|
||||
|
||||
public static void setUseMockObuData( boolean use ) {
|
||||
useMockObuData = use;
|
||||
}
|
||||
|
||||
public static boolean isUseMockObuData() {
|
||||
return useMockObuData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.concurrent.ThreadFactory;
|
||||
public class ThreadPoolService {
|
||||
|
||||
private static final ExecutorService SERVICE = Executors.newFixedThreadPool( 3, new ThreadFactoryImpl() );
|
||||
|
||||
private static final ExecutorService SINGLE_THREAD_SERVICE = Executors.newSingleThreadExecutor(new SingleThreadFactoryImpl());
|
||||
private static class ThreadFactoryImpl implements ThreadFactory {
|
||||
|
||||
private static int mCounter = 1;
|
||||
@@ -18,10 +18,26 @@ public class ThreadPoolService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单线程队列执行的ThreadFactory实现,应该只会new一个Thread
|
||||
*/
|
||||
private static class SingleThreadFactoryImpl implements ThreadFactory{
|
||||
private static int counter = 1;
|
||||
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
return new Thread(r, "SingleThread - " + counter++);
|
||||
}
|
||||
}
|
||||
|
||||
private ThreadPoolService() {
|
||||
}
|
||||
|
||||
public static void execute( Runnable task ) {
|
||||
SERVICE.execute( task );
|
||||
}
|
||||
|
||||
public static void singleExecute(Runnable task) {
|
||||
SINGLE_THREAD_SERVICE.execute(task);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user