This commit is contained in:
wangcongtao
2020-10-22 14:17:12 +08:00
1425 changed files with 31249 additions and 12020 deletions

View File

@@ -76,12 +76,13 @@ android {
em4 {
manifest.srcFile 'src/em4/AndroidManifest.xml'
}
f8xxLauncherOnlineRelease {
manifest.srcFile 'src/f8xxLauncherOnlineRelease/AndroidManifest.xml'
}
// 演示分支,暂时不需要这一项
// f8xxLauncherOnlineRelease {
// manifest.srcFile 'src/f8xxLauncherOnlineRelease/AndroidManifest.xml'
// }
}
flavorDimensions "product", "basic", "env"
flavorDimensions "site","product", "basic", "env"
productFlavors {
//独立app
@@ -92,6 +93,9 @@ android {
// 是否作为 launcher 运行
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
// 是否支持目的地导航策略
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'true'
}
// launcher app
launcher {
@@ -101,13 +105,13 @@ android {
// 是否作为 launcher 运行
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
// 是否支持目的地导航策略
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'false'
}
// f系列-分体机全系列,未细分
f8xx {
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -115,13 +119,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
}
// f系列-分体机
f80x {
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -129,13 +137,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
}
// e系列采用Launcher方案
e8xx {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -143,13 +155,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
}
// 同上
em4 {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -157,13 +173,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
}
// e系列-2+32对标D系列2+32采用独立app的形式
em3 {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -171,13 +191,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
}
// e系列-1+16对标D系列1+16采用独立app形式
em1 {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -185,13 +209,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
}
// d系列
d8xx {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -199,13 +227,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
}
// d系列 2 + 32
d80x {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -213,13 +245,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
}
// d系列 1+16 版本
d82x {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -227,13 +263,17 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
}
// 比亚迪
bydauto {
applicationId rootProject.ext.android.bydautoIndependentApplicationId
dimension "product"
// 不使用语音
buildConfigField 'int', 'AIType', '0'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机其他车机比亚迪定为1
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
@@ -241,6 +281,24 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.bydautoIndependentApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'false'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
}
// 演示地点-顺义
shunyi{
dimension "site"
// 西迪obu
buildConfigField 'int', "OBU_TYPE", '1'
}
// 演示地点-苏州
suzhou{
dimension "site"
// 华砺智行obu
buildConfigField 'int', "OBU_TYPE", '2'
}
qa {
dimension "env"
@@ -259,6 +317,12 @@ android {
packagingOptions {
exclude 'META-INF/io.netty.versions.properties'
}
sourceSets {
main {
res.srcDirs = ['src/main/res', 'src/main/res-night']
}
}
}
repositories {
@@ -275,14 +339,19 @@ dependencies {
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.boostmultidex
debugImplementation rootProject.ext.dependencies.leakcanary
testImplementation rootProject.ext.dependencies.leakcanary
releaseImplementation rootProject.ext.dependencies.leakcanarynoop
debugImplementation rootProject.ext.dependencies.debugleakcanary
releaseImplementation rootProject.ext.dependencies.releaseleakcanary
implementation rootProject.ext.dependencies.carcallprovider
implementation rootProject.ext.dependencies.carcall
implementation rootProject.ext.dependencies.mogologlib
compileOnly rootProject.ext.dependencies.adasapi
compileOnly rootProject.ext.dependencies.adasconfigapi
// implementation rootProject.ext.dependencies.modulepushbase
// launcherImplementation rootProject.ext.dependencies.modulepush
// independentImplementation rootProject.ext.dependencies.modulepushnoop
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogocommons
@@ -292,6 +361,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogomoduleauth
implementation rootProject.ext.dependencies.modulemedia
implementation rootProject.ext.dependencies.moduleservice
// implementation rootProject.ext.dependencies.moduleobu
implementation rootProject.ext.dependencies.modulesplash
implementation rootProject.ext.dependencies.moduleV2x
implementation rootProject.ext.dependencies.moduletanlu, {
@@ -299,8 +369,8 @@ dependencies {
}
implementation rootProject.ext.dependencies.moduletanluapi
implementation rootProject.ext.dependencies.mogomonitor
implementation rootProject.ext.dependencies.mogomodulewidgets
implementation rootProject.ext.dependencies.mogomoduleback
implementation rootProject.ext.dependencies.guideshow
} else {
implementation project(':foudations:mogo-commons')
implementation project(':modules:mogo-module-common')
@@ -308,6 +378,7 @@ dependencies {
implementation project(':modules:mogo-module-authorize')
implementation project(':modules:mogo-module-media')
implementation project(':modules:mogo-module-service')
// implementation project(':modules:mogo-module-obu')
implementation project(':modules:mogo-module-splash')
implementation project(':modules:mogo-module-v2x')
implementation project(':modules:mogo-module-tanlu'), {
@@ -315,8 +386,8 @@ dependencies {
}
implementation project(':libraries:mogo-tanlu-api')
implementation project(':modules:mogo-module-monitor')
implementation project(':modules:mogo-module-widgets')
implementation project(':modules:mogo-module-back')
implementation project(':modules:mogo-module-guide')
}
apply from: "./functions/perform.gradle"
@@ -324,6 +395,10 @@ dependencies {
apply from: "./functions/socketpush.gradle"
apply from: "./functions/gpssimulator.gradle"
apply from: "./functions/leftpanel.gradle"
apply from: "./functions/skin.gradle"
apply from: "./functions/crashreport.gradle"
apply from: "./functions/widgets.gradle"
apply from: "./functions/tts.gradle"
}
android.applicationVariants.all { variant ->

View File

@@ -0,0 +1,13 @@
// bugly 上报目前仅在debug编译下加载bugly
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.crashreport
debugImplementation rootProject.ext.dependencies.crashreportbugly
releaseImplementation rootProject.ext.dependencies.crashreportnoop
} else {
implementation project(':test:crashreport')
debugImplementation project(':test:crashreport-bugly')
releaseImplementation project(':test:crashreport-noop')
}
}

49
app/functions/skin.gradle Normal file
View File

@@ -0,0 +1,49 @@
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
bydautoImplementation rootProject.ext.dependencies.skinsupportnoop
d82xImplementation rootProject.ext.dependencies.skinsupportimpl
em1Implementation rootProject.ext.dependencies.skinsupportimpl
em3Implementation rootProject.ext.dependencies.skinsupportimpl
d8xxImplementation rootProject.ext.dependencies.skinsupportimpl
d80xImplementation rootProject.ext.dependencies.skinsupportimpl
f8xxImplementation rootProject.ext.dependencies.skinsupportimpl
f80xImplementation rootProject.ext.dependencies.skinsupportimpl
em4Implementation rootProject.ext.dependencies.skinsupportimpl
e8xxImplementation rootProject.ext.dependencies.skinsupportimpl
f8xxImplementation rootProject.ext.dependencies.skinsupportlight
f80xImplementation rootProject.ext.dependencies.skinsupportlight
em4Implementation rootProject.ext.dependencies.skinsupportlight
e8xxImplementation rootProject.ext.dependencies.skinsupportlight
d8xxImplementation rootProject.ext.dependencies.skinsupportlight
d80xImplementation rootProject.ext.dependencies.skinsupportlight
em3Implementation rootProject.ext.dependencies.skinsupportlight
d82xImplementation rootProject.ext.dependencies.skinsupportlight
em1Implementation rootProject.ext.dependencies.skinsupportlight
} else {
bydautoImplementation project(':skin:mogo-skin-support-noop')
d82xImplementation project(':skin:mogo-skin-support-impl')
em1Implementation project(':skin:mogo-skin-support-impl')
em3Implementation project(':skin:mogo-skin-support-impl')
d8xxImplementation project(':skin:mogo-skin-support-impl')
d80xImplementation project(':skin:mogo-skin-support-impl')
f8xxImplementation project(':skin:mogo-skin-support-impl')
f80xImplementation project(':skin:mogo-skin-support-impl')
em4Implementation project(':skin:mogo-skin-support-impl')
e8xxImplementation project(':skin:mogo-skin-support-impl')
f8xxImplementation project(':skin:mogo-skin-light')
f80xImplementation project(':skin:mogo-skin-light')
em4Implementation project(':skin:mogo-skin-light')
e8xxImplementation project(':skin:mogo-skin-light')
d8xxImplementation project(':skin:mogo-skin-light')
d80xImplementation project(':skin:mogo-skin-light')
d82xImplementation project(':skin:mogo-skin-light')
em1Implementation project(':skin:mogo-skin-light')
em3Implementation project(':skin:mogo-skin-light')
}
}

25
app/functions/tts.gradle Normal file
View File

@@ -0,0 +1,25 @@
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
bydautoImplementation rootProject.ext.dependencies.ttsdi
d82xImplementation rootProject.ext.dependencies.ttszhi
em1Implementation rootProject.ext.dependencies.ttszhi
em3Implementation rootProject.ext.dependencies.ttszhi
d8xxImplementation rootProject.ext.dependencies.ttszhi
d80xImplementation rootProject.ext.dependencies.ttszhi
f8xxImplementation rootProject.ext.dependencies.ttszhi
f80xImplementation rootProject.ext.dependencies.ttszhi
em4Implementation rootProject.ext.dependencies.ttszhi
e8xxImplementation rootProject.ext.dependencies.ttszhi
} else {
bydautoImplementation project(':tts:tts-di')
d82xImplementation project(':tts:tts-zhi')
em1Implementation project(':tts:tts-zhi')
em3Implementation project(':tts:tts-zhi')
d8xxImplementation project(':tts:tts-zhi')
d80xImplementation project(':tts:tts-zhi')
f8xxImplementation project(':tts:tts-zhi')
f80xImplementation project(':tts:tts-zhi')
em4Implementation project(':tts:tts-zhi')
e8xxImplementation project(':tts:tts-zhi')
}
}

View File

@@ -0,0 +1,11 @@
// 悬浮控件:独立 app 和 launcher
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
independentImplementation rootProject.ext.dependencies.mogomodulewidgets
implementation rootProject.ext.dependencies.mogomodulewidgets
} else {
independentImplementation project(':modules:mogo-module-widgets')
implementation project(':modules:mogo-module-widgets')
}
}

View File

@@ -2,8 +2,8 @@
afterEvaluate {
def independent = ["em3", "em1", "d80x", "d82x", "bydauto"]
def launcher = ["f80x", "em4"]
def independent = []
def launcher = ["f80x"]
it.getTasks().iterator().forEachRemaining {
def task = it

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:sharedUserId="android.uid.system"
package="com.mogo.launcher">
</manifest>

View File

@@ -14,6 +14,7 @@ import com.mogo.commons.network.Utils;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
import com.mogo.module.back.BackToLauncherConst;
import com.mogo.module.carchatting.card.CallChatConstant;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.main.service.MogoMainService;
@@ -22,17 +23,22 @@ import com.mogo.module.push.base.PushUIConstants;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.widgets.MogoWidgetsProvider;
import com.mogo.module.v2x.utils.ObuConfig;
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
@@ -47,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 );
@@ -55,65 +64,96 @@ 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));
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() ) {
MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
} else {
MogoModulePaths.addBaseModule( new MogoModule( MogoWidgetsProvider.PATH, MogoWidgetsProvider.NAME ) );
}
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
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.addBaseModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
MogoModulePaths.addBaseModule( 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.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare" ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
// 碰撞报警模块
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING,
"CrashWarning"));
if ( !DebugConfig.isLauncher() ) {
PersistentManager.getInstance().initManager( this );
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 );
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
DebugConfig.setUseMockObuData(false);
ObuConfig.useObuLocation = false;
DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
DebugConfig.setSkinSupported( BuildConfig.IS_SKIN_SUPPORTED );
DebugConfig.setSupportedSearchDestinationOnlineCarList( BuildConfig.IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST );
DebugConfig.setScheduleCalculateNotHomeCompanyDistanceForPush( BuildConfig.IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH );
DebugConfig.setSupportLauncherCardRefreshStrategy( BuildConfig.IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY );
DebugConfig.setObuType(BuildConfig.OBU_TYPE);
}
@Override
protected void asyncInitImpl() {
super.asyncInitImpl();
}
@Override
protected void init() {
super.init();
prepareBaseService( 2_000L );
final IMogoServiceApis apis = MogoApisHandler.getInstance().getApis();
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, () -> {