This commit is contained in:
wangcongtao
2020-06-29 10:29:44 +08:00
10 changed files with 80 additions and 44 deletions

10
.idea/misc.xml generated
View File

@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<componentd name="FindBugsConfigurable">
<option name="make" value="true" />
<option name="effort" value="default" />
<option name="priority" value="Medium" />
<option name="excludeFilter" value="" />
</componentd>
<component name="ASMPluginConfiguration">
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>

View File

@@ -1,8 +1,8 @@
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
import java.text.SimpleDateFormat
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
@@ -25,7 +25,7 @@ android {
externalNativeBuild {
ndk {
// 设置支持的SO库架构
abiFilters 'armeabi-v7a'
abiFilters 'armeabi-v7a','x86'
}
}
}
@@ -98,18 +98,21 @@ android {
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
}
// e系列
e8xx {
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
}
// d系列
d8xx {
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType','1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
}
qa {
dimension "env"
@@ -175,7 +178,7 @@ dependencies {
implementation rootProject.ext.dependencies.crashSdk
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.androidxmultidex
implementation rootProject.ext.dependencies.boostmultidex
debugImplementation rootProject.ext.dependencies.leakcanary
testImplementation rootProject.ext.dependencies.leakcanary
releaseImplementation rootProject.ext.dependencies.leakcanarynoop
@@ -281,3 +284,5 @@ def getGitCommit() {
assert !gitCommit.isEmpty()
gitCommit
}
//apply plugin: 'arouterhook'

View File

@@ -4,10 +4,9 @@ import android.content.Context;
import android.content.Intent;
import android.util.Log;
import androidx.multidex.MultiDex;
import com.alibaba.android.arouter.launcher.ARouter;
import com.auto.zhidao.logsdk.CrashSystem;
import com.bytedance.boost_multidex.BoostMultiDex;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.adcard.AdCardConstants;
@@ -38,61 +37,66 @@ public class MogoApplication extends AbsMogoApplication {
@Override
public void onCreate() {
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 );
initDebugConfig();
super.onCreate();
// Crash 日志收集
final long start = System.currentTimeMillis();
CrashSystem crashSystem = CrashSystem.getInstance( this );
CrashSystem crashSystem = CrashSystem.getInstance(this);
crashSystem.init();
//设置debug模式日志不上传
crashSystem.setDebug( BuildConfig.DEBUG );
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
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( AuthorizeConstant.PATH_AGREEMENT_FRAGMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
MogoModulePaths.addModule(new MogoModule(AuthorizeConstant.PATH_AGREEMENT_FRAGMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME));
//运营位卡片,需要默认显示,放在第一个加载
MogoModulePaths.addModule( new MogoModule( AdCardConstants.TAG, AdCardConstants.MODULE_NAME ) );
if ( DebugConfig.isLauncher() ) {
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
MogoModulePaths.addModule(new MogoModule(AdCardConstants.TAG, AdCardConstants.MODULE_NAME));
if (DebugConfig.isLauncher()) {
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
}
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
MogoModulePaths.addBaseModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI ) );
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI));
// 暂时去掉推送
// MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
if (!DebugConfig.isLauncher()) {
PersistentManager.getInstance().initManager(this);
Intent intent = new Intent( this, MogoMainService.class );
startService( intent );
Intent intent = new Intent(this, MogoMainService.class);
startService(intent);
}
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
}
private void initDebugConfig(){
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 );
}
@Override
protected void init() {
super.init();
IMogoSocketManager mMogoSocketManager = ARouter.getInstance().navigation( IMogoSocketManager.class );
if ( mMogoSocketManager != null ) {
mMogoSocketManager.init( getApplicationContext(), "com.mogo.launcher" );
IMogoSocketManager mMogoSocketManager = ARouter.getInstance().navigation(IMogoSocketManager.class);
if (mMogoSocketManager != null) {
mMogoSocketManager.init(getApplicationContext(), "com.mogo.launcher");
} else {
Logger.e( TAG, "init socket server error." );
Logger.e(TAG, "init socket server error.");
}
}
@Override
protected void attachBaseContext( Context base ) {
super.attachBaseContext( base );
MultiDex.install( base );
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
BoostMultiDex.install(base);
}
}

View File

@@ -22,6 +22,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.alibaba:arouter-register:1.0.2"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
// classpath "com.mogo.module.pluginhook:module-pluginhook:${HOOKPLUGIN_VERSION}"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

View File

@@ -17,7 +17,7 @@ ext {
androidxappcompat : "androidx.appcompat:appcompat:1.0.2",
androidxccorektx : "androidx.core:core-ktx:1.2.0",
androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3",
androidxmultidex : "androidx.multidex:multidex:2.0.1",
boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1",
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
androidxcardview : "androidx.cardview:cardview:1.0.0",

View File

@@ -161,4 +161,16 @@ public class DebugConfig {
public static void setUseCustomMap( boolean sUseCustomMap ) {
DebugConfig.sUseCustomMap = sUseCustomMap;
}
/**
* 是否支持临时激活小智
*/
private static boolean sActiveAIAssistFlag = true;
public static boolean isActiveAIAssistFlag() {
return sActiveAIAssistFlag;
}
public static void setActiveAIAssistFlag( boolean sActiveAIAssistFlag ) {
DebugConfig.sActiveAIAssistFlag = sActiveAIAssistFlag;
}
}

View File

@@ -72,7 +72,7 @@ MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
# 在线车辆F
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
# v2x
MOGO_MODULE_V2X_VERSION=1.1.34
MOGO_MODULE_V2X_VERSION=1.1.36
# 推送
MOGO_MODULE_PUSH_VERSION=1.0.1
# 广告资源位
@@ -81,6 +81,11 @@ MOGO_MODULE_AD_CARD_VERSION=1.0.1
TANLULIB_VERSION=1.2.1.7
# Boost分包
BOOST_MULTIDEX_VERSION=1.0.0
# hook ARouter分包实现
HOOKPLUGIN_VERSION=1.0.0
## 产品库必备配置
applicationId=com.mogo.launcer
applicationName=IntelligentPilot

View File

@@ -30,7 +30,7 @@ class OnAiAssistClickListener implements View.OnClickListener {
@Override
public void onClick( View v ) {
if ( Devices.isBind() ) {
if ( Devices.isBind() || !DebugConfig.isActiveAIAssistFlag() ) {
AIAssist.startAssistant( v.getContext() );
trackNavigatorClickEvent( 5 );
} else {

View File

@@ -1,5 +1,7 @@
package com.mogo.module.common.utils;
import android.text.TextUtils;
import java.lang.reflect.Method;
/**
@@ -21,6 +23,7 @@ public class CarSeries {
public static final int CAR_SERIES_E84XCD = 51;
public static final int CAR_SERIES_E85X = 50;
public static final int CAR_SERIES_E85XCD = 51;
public static final int CAR_SERIES_E85XJD = 51;
public static int CAR_SERIES = 0;
@@ -33,6 +36,10 @@ public class CarSeries {
return CAR_SERIES;
}
String device = get( "ro.fota.device" );
if ( TextUtils.isEmpty( device ) ) {
return CAR_SERIES_F80X;
}
if ( "FG166".equals( device ) ) {
CAR_SERIES = CAR_SERIES_C80X;
} else if ( "D801-802".equals( device ) ) {
@@ -58,6 +65,10 @@ public class CarSeries {
CAR_SERIES = CAR_SERIES_E85X;
} else if ( "E85XCD".equals( device ) ) {
CAR_SERIES = CAR_SERIES_E85XCD;
} else if ( "E85XJD".equals( device ) ) {
CAR_SERIES = CAR_SERIES_E85XJD;
} else if ( device.startsWith( "E85" ) ) {
CAR_SERIES = CAR_SERIES_E85XJD;
} else {
CAR_SERIES = CAR_SERIES_F80X;
}

View File

@@ -67,7 +67,7 @@ public abstract class BaseNaviInfoView {
protected String getFormatSurplusTime( int seconds ) {
if ( seconds > 60 * 60 ) {
mFormatSurplusDistanceUnit = "h";
mFormatSurplusTimeUnit = "h";
return String.format( "%.1f", ( ( float ) seconds ) / ( 60 * 60 ) );
}