[Opt3.0]新增StartUp模块并调整启动顺序
This commit is contained in:
@@ -41,10 +41,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView;
|
||||
import com.mogo.eagle.core.function.main.modules.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.stagetwo.AutopilotStartup;
|
||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -163,7 +163,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
ContextHolderUtil.holdContext(this);
|
||||
// 监听工控机连接信息
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
startUpInStage2();
|
||||
CallerStartUpManager.initStageTwo();
|
||||
// 加载模块
|
||||
mPresenter.postLoadModuleMsg();
|
||||
// 监听网络状态
|
||||
@@ -218,26 +218,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
mConnectInfoRV.setAdapter(mConnAdapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 第二阶段初始化,第一阶段初始化可查看:{@link com.mogo.launcher.stageone}
|
||||
*/
|
||||
public void startUpInStage2() {
|
||||
StartupConfig config = null;
|
||||
if (DebugConfig.isDebug()) {
|
||||
config = new StartupConfig.Builder()
|
||||
.setLoggerLevel(LoggerLevel.DEBUG)
|
||||
.setOpenStatistics(true)
|
||||
.build();
|
||||
}
|
||||
new StartupManager.Builder()
|
||||
.addStartup(new AutopilotStartup())
|
||||
// .addStartup(new APMStartup())
|
||||
.setConfig(config)
|
||||
.build(this)
|
||||
.start()
|
||||
.await();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadModules() {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.stagetwo;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.rousetime.android_startup.AndroidStartup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AutopilotStartup extends AndroidStartup<Boolean> {
|
||||
@Nullable
|
||||
@Override
|
||||
public Boolean create(@NonNull Context context) {
|
||||
ARouter.getInstance().build(MogoServicePaths.PATH_AUTO_PILOT).navigation();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean callCreateOnMainThread() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean waitOnMainThread() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public List<String> dependenciesByName() {
|
||||
// List<String> deps = new ArrayList<>();
|
||||
// deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
// return deps;
|
||||
// }
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.stagetwo;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.rousetime.android_startup.AndroidStartup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MapStartup extends AndroidStartup<Boolean> {
|
||||
@Nullable
|
||||
@Override
|
||||
public Boolean create(@NonNull Context context) {
|
||||
// TODO:暂不支持分步加载
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean callCreateOnMainThread() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean waitOnMainThread() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public List<String> dependenciesByName() {
|
||||
// List<String> deps = new ArrayList<>();
|
||||
// deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
// return deps;
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user