合并黑夜白天模式等需求

This commit is contained in:
wangcongtao
2020-09-10 16:27:01 +08:00
940 changed files with 19301 additions and 2446 deletions

View File

@@ -27,13 +27,18 @@ import com.mogo.module.widgets.MogoWidgetsProvider;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.test.crashreport.ITestCrashReportProvider;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
import com.squareup.leakcanary.LeakCanary;
import com.zhidao.boot.persistent.lib.PersistentManager;
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
import com.zhidao.mogo.tanlu.api.TanluApiConst;
import static com.mogo.module.guide.GuideConstant.PATH_GUIDE_FRAGMENT;
import static com.mogo.module.guide.GuideConstant.PATH_GUIDE_MODULE_NAME;
/**
* @author congtaowang
* @since 2019-12-18
@@ -48,6 +53,9 @@ public class MogoApplication extends AbsMogoApplication {
public void onCreate() {
initDebugConfig();
super.onCreate();
if ( !shouldInit() ) {
return;
}
// Crash 日志收集
final long start = System.currentTimeMillis();
CrashSystem crashSystem = CrashSystem.getInstance( this );
@@ -56,7 +64,9 @@ public class MogoApplication extends AbsMogoApplication {
crashSystem.setDebug( BuildConfig.DEBUG );
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
// MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME));
if ( DebugConfig.isLoadGuideModule() ) {
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
}
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
if ( DebugConfig.isLauncher() ) {
@@ -68,16 +78,17 @@ public class MogoApplication extends AbsMogoApplication {
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
}
MogoModulePaths.addModule( new MogoModule( TanluApiConst.MODULE_PATH, TanluApiConst.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addBaseModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME ) );
MogoModulePaths.addBaseModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME ) );
MogoModulePaths.addBaseModule(new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE,"StrategyShare"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor"));
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare" ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
MogoModulePaths.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
@@ -86,10 +97,25 @@ public class MogoApplication extends AbsMogoApplication {
Intent intent = new Intent( this, MogoMainService.class );
startService( intent );
}
LeakCanary.install( this );
// debug 下初始化 bugly 上报
if ( DebugConfig.isDebug() ) {
ARouter.getInstance().navigation( ITestCrashReportProvider.class );
}
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
@Override
protected boolean shouldInit() {
return !LeakCanary.isInAnalyzerProcess( this );
}
private void initDebugConfig() {
if ( !shouldInit() ) {
return;
}
DebugConfig.setNetMode( BuildConfig.NET_ENV );
DebugConfig.setDebug( BuildConfig.DEBUG );
DebugConfig.setAIType( BuildConfig.AIType );
@@ -103,20 +129,28 @@ public class MogoApplication extends AbsMogoApplication {
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
DebugConfig.setLoadGuideModule( BuildConfig.LOAD_GUIDE_MODULE );
}
@Override
protected void asyncInitImpl() {
super.asyncInitImpl();
}
@Override
protected void init() {
super.init();
prepareBaseService( 2_000L );
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
prepareBaseService( apis, 2_000L );
// installSkinManager( this, apis );
}
/**
* 基础服务passport、location、socket
*/
private void prepareBaseService( long delay ) {
private void prepareBaseService( IMogoServiceApis apis, long delay ) {
UiThreadHandler.postDelayed( () -> {
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
// 第三方平台的sn是服务端生成的所以必须在返回后才能开启
if ( TextUtils.isEmpty( Utils.getSn() ) ) {
preparePassportEnvironment( apis, () -> {