Merge branch 'dev_hengyang_base' into qa_yingyan_och

# Conflicts:
#	libraries/map-custom/build.gradle
This commit is contained in:
董宏宇
2021-06-10 17:42:58 +08:00
205 changed files with 3020 additions and 8678 deletions

1
.idea/gradle.xml generated
View File

@@ -39,6 +39,7 @@
<option value="$PROJECT_DIR$/main-extensions/mogo-module-main-independent" />
<option value="$PROJECT_DIR$/main-extensions/mogo-module-main-launcher" />
<option value="$PROJECT_DIR$/modules" />
<option value="$PROJECT_DIR$/modules/mogo-module-adas" />
<option value="$PROJECT_DIR$/modules/mogo-module-apps" />
<option value="$PROJECT_DIR$/modules/mogo-module-authorize" />
<option value="$PROJECT_DIR$/modules/mogo-module-back" />

View File

@@ -1,5 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
import com.mogo.utils.network.utils.Util;
@@ -17,7 +18,7 @@ class OchBusOperationStatusRequest {
public String status;
public OchBusOperationStatusRequest() {
this.sn = Utils.getSn();
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
}
public OchBusOperationStatusRequest shutdown() {

View File

@@ -1,5 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
/**
@@ -13,7 +14,7 @@ public class QueryLeaveAwayPassengersRequest {
private int orderDispatchType = 4;
public QueryLeaveAwayPassengersRequest(int siteId) {
this.sn = Utils.getSn();
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
this.endSiteId = siteId;
}

View File

@@ -1,5 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
public
@@ -14,6 +15,6 @@ class QueryOchBusOperationStatusRequest {
public String sn;
public QueryOchBusOperationStatusRequest() {
this.sn = Utils.getSn();
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
}
}

View File

@@ -1,5 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
public
@@ -16,7 +17,7 @@ class UpdateSiteStatusRequest {
public int siteId;
public UpdateSiteStatusRequest( int siteId ) {
this.sn = Utils.getSn();
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
this.siteId = siteId;
}

View File

@@ -7,6 +7,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.network.SubscribeImpl;
@@ -108,7 +109,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
OchBusRoutesRequest request = new OchBusRoutesRequest( Utils.getSn(), lat, lon );
OchBusRoutesRequest request = new OchBusRoutesRequest( MoGoAiCloudClientConfig.getInstance().getSn(), lat, lon );
RequestBody requestBody = RequestBody.create( MediaType.get( "application/json;charset=UTF-8" ), GsonUtil.jsonFromObject( request ) );
mService.querySiteByCoordinate( requestBody )
.subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
@@ -245,7 +246,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
public void debugResetStationStatus() {
Logger.d( TAG, "测试、重置站点状态");
OchBusResetRequest request = new OchBusResetRequest( Utils.getSn(), 1 );
OchBusResetRequest request = new OchBusResetRequest( MoGoAiCloudClientConfig.getInstance().getSn(), 1 );
RequestBody requestBody = RequestBody.create( MediaType.get( "application/json;charset=UTF-8" ), GsonUtil.jsonFromObject( request ) );
mService.debugResetStationStatus( requestBody )
.subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
@@ -318,7 +319,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
}
isGoingToNextStation = true;
AIAssist.getInstance( getContext() ).speakTTSVoice( "欢迎乘坐蘑菇智行无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始" );
RequestBody request = RequestBody.create( MediaType.get( "application/json" ), GsonUtil.jsonFromObject( new OchBusLeaveStationRequest( Utils.getSn(), stationList.get( currentStationIndex ).getSiteId() ) ) );
RequestBody request = RequestBody.create( MediaType.get( "application/json" ), GsonUtil.jsonFromObject( new OchBusLeaveStationRequest( MoGoAiCloudClientConfig.getInstance().getSn(), stationList.get( currentStationIndex ).getSiteId() ) ) );
mService.leaveStation( request ).subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe( new SubscribeImpl< OchBusRoutesResponse >( RequestOptions.create( getContext() ) ) {
@@ -469,7 +470,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
Logger.d( TAG, "单程结束====" );
MogoApisHandler.getInstance().getApis().getAdasControllerApi().cancelAutopilot();
AIAssist.getInstance( getContext() ).speakTTSVoice( "感谢您体验蘑菇出行无人驾驶小巴车,请您携带好随身物品,我们下次再见" );
RequestBody request = RequestBody.create( MediaType.get( "application/json" ), GsonUtil.jsonFromObject( new OchBusLeaveStationRequest( Utils.getSn(), stationList.get( currentStationIndex ).getSiteId() ) ) );
RequestBody request = RequestBody.create( MediaType.get( "application/json" ), GsonUtil.jsonFromObject( new OchBusLeaveStationRequest( MoGoAiCloudClientConfig.getInstance().getSn(), stationList.get( currentStationIndex ).getSiteId() ) ) );
mService.leaveStation( request ).subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe( new SubscribeImpl< OchBusRoutesResponse >( RequestOptions.create( getContext() ) ) {

View File

@@ -7,6 +7,7 @@ import android.net.ConnectivityManager;
import android.text.TextUtils;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
@@ -557,7 +558,7 @@ class MogoOCHTaxiModel {
if ( mOCHTaxiServiceApi == null ) {
mOCHTaxiServiceApi = MogoApisHandler.getInstance().getApis().getNetworkApi().create( OCHTaxiServiceApi.class, HostConst.OCH_DOMAIN );
}
mOCHTaxiServiceApi.updateOrderStatus( new OCHTaxiOrderStatus( Utils.getSn(), mCurrentOCHOrder.orderNo, orderStatus.getCode() ) )
mOCHTaxiServiceApi.updateOrderStatus( new OCHTaxiOrderStatus( MoGoAiCloudClientConfig.getInstance().getSn(), mCurrentOCHOrder.orderNo, orderStatus.getCode() ) )
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( mContext ) ) {
@@ -596,7 +597,7 @@ class MogoOCHTaxiModel {
if ( mOCHTaxiServiceApi == null ) {
mOCHTaxiServiceApi = MogoApisHandler.getInstance().getApis().getNetworkApi().create( OCHTaxiServiceApi.class, HostConst.OCH_DOMAIN );
}
mOCHTaxiServiceApi.queryOrder( new OCHTaxiOrderStatus( Utils.getSn(), orderNo, OCHOrderStatus.None.getCode() ) )
mOCHTaxiServiceApi.queryOrder( new OCHTaxiOrderStatus( MoGoAiCloudClientConfig.getInstance().getSn(), orderNo, OCHOrderStatus.None.getCode() ) )
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe( new SubscribeImpl< OCHTaxiOrderResponse2 >( RequestOptions.create( mContext ) ) {

View File

@@ -25,6 +25,7 @@
6. d8xx: D系列(2+32) - independent
7. d82x: D系列(1+16) - independent
8. byd: 比亚迪应用市场 - independent
9. PadLenovo: 联想pad适配 - launcher
### env 维度

View File

@@ -4,6 +4,9 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'android-aspectjx'
Properties properties = new Properties();
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
defaultConfig {
@@ -43,6 +46,9 @@ android {
zipAlignEnabled false
shrinkResources false
signingConfig signingConfigs.release
manifestPlaceholders =[
MAP_SDK_VERSION : properties.getProperty("MAP_SDK_VERSION")
]
}
release {
minifyEnabled false
@@ -105,9 +111,12 @@ android {
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
// 是否支持目的地导航策略
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'false'
}
// f系列-网约车-出租车
fochtaxi {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -137,6 +146,8 @@ android {
}
// f系列-网约车-小巴车
fochbus {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -166,6 +177,8 @@ android {
}
// f系列-分体机全系列,未细分
f8xx {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -195,6 +208,8 @@ android {
}
// f系列-分体机
f80x {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -224,12 +239,8 @@ android {
}
// 衡阳-联想Pad
fPadLenovo {
android{
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
}
}
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -259,12 +270,8 @@ android {
}
// f系列-网约车-出租车
fPadLenovoOchTaxi {
android{
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
}
}
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -294,12 +301,8 @@ android {
}
// f系列-网约车-小巴车
fPadLenovoOchBus {
android{
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
}
}
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -358,6 +361,8 @@ android {
}
// f系列-分体机-高德
f8Amap {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
@@ -387,6 +392,8 @@ android {
}
// e系列采用Launcher方案
e8xx {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
@@ -416,6 +423,8 @@ android {
}
// 同上
em4 {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
@@ -445,6 +454,8 @@ android {
}
// e系列-2+32对标D系列2+32采用独立app的形式
em3 {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
@@ -474,6 +485,8 @@ android {
}
// e系列-1+16对标D系列1+16采用独立app形式
em1 {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
@@ -503,6 +516,8 @@ android {
}
// e系列-1+16对标D系列1+16采用独立app形式
em2 {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
@@ -532,6 +547,8 @@ android {
}
// d系列
d8xx {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
@@ -561,6 +578,8 @@ android {
}
// d系列 2 + 32
d80x {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
@@ -590,6 +609,8 @@ android {
}
// d系列 1+16 版本
d82x {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
@@ -619,6 +640,8 @@ android {
}
// 比亚迪
bydauto {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
// 应用包名
applicationId rootProject.ext.android.bydautoIndependentApplicationId
dimension "product"
@@ -734,6 +757,7 @@ dependencies {
implementation project(':modules:mogo-module-extensions')
implementation project(':modules:mogo-module-map')
implementation project(':modules:mogo-module-smp')
implementation project(':modules:mogo-module-adas')
implementation project(':foudations:httpdns-mogo')
}

View File

@@ -32,13 +32,13 @@ project.dependencies {
em4Implementation project(':foudations:mogo-aicloud-services-apk')
e8xxImplementation project(':foudations:mogo-aicloud-services-apk')
f8xxImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoImplementation project(':foudations:mogo-aicloud-services-sdk')
f80xImplementation project(':foudations:mogo-aicloud-services-apk')
f8AmapImplementation project(':foudations:mogo-aicloud-services-apk')
em3Implementation project(':foudations:mogo-aicloud-services-apk')
fochtaxiImplementation project(':foudations:mogo-aicloud-services-apk')
fochbusImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoOchTaxiImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoOchBusImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoOchTaxiImplementation project(':foudations:mogo-aicloud-services-sdk')
fPadLenovoOchBusImplementation project(':foudations:mogo-aicloud-services-sdk')
}
}

View File

@@ -29,6 +29,10 @@
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="${AMAP_API_VALUE}" />
<meta-data
android:name="MAP_SDK_VERSION"
android:value="${MAP_SDK_VERSION}" />
<!--保活用-->
<service
android:name="com.zhidao.boot.persistent.lib.PersistentAliveService"

View File

@@ -12,6 +12,7 @@ import com.bytedance.boost_multidex.BoostMultiDex;
import com.mogo.cloud.httpdns.MogoHttpDnsConfig;
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation;
import com.mogo.cloud.httpdns.listener.IHttpDnsCurrentLocation;
import com.mogo.cloud.passport.IMoGoTokenCallback;
import com.mogo.cloud.passport.MoGoAiCloudClient;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
@@ -39,6 +40,7 @@ import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.storage.SharedPrefsMgr;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import com.zhidao.boot.persistent.lib.PersistentManager;
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
@@ -52,6 +54,8 @@ public class MogoApplication extends AbsMogoApplication {
private static final String TAG = "MogoApplication";
private long start;
private volatile static RefWatcher refWatcher;
@Override
public void onCreate() {
initDebugConfig();
@@ -60,79 +64,14 @@ public class MogoApplication extends AbsMogoApplication {
return;
}
// Crash 日志收集
final long start = System.currentTimeMillis();
start = System.currentTimeMillis();
CrashSystem crashSystem = CrashSystem.getInstance(this);
crashSystem.init();
//设置debug模式日志不上传
crashSystem.setDebug(BuildConfig.DEBUG);
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
if (DebugConfig.isNeedLoadGuideModule()) {
MogoModulePaths.addModule(new MogoModule(MogoModulePaths.PATH_GUIDE, MogoModulePaths.PATH_GUIDE));
}
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME));
if (DebugConfig.isLauncher()) {
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_BACK, MogoServicePaths.PATH_BACK));
MogoModulePaths.addModule(new MogoModule(MogoModulePaths.PATH_MEDIA, MogoModulePaths.PATH_MEDIA));
}
MogoModulePaths.addModule(new MogoModule(ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS));
if (DebugConfig.isMapBased()) {
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
}
MogoModulePaths.addBaseModule(new MogoModule(ShareConstants.TAG, ShareConstants.MODEL_NAME));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TANLU_API, "TanluApi"));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TRAFFIC_UPLOAD, "TrafficUpload"));
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_GAODE_AIMLESS_SHARE, "GaoDeAimlessShare"));
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"));
// MogoModulePaths.addModule( new MogoModule( IMogoMachineVisionProvider.path, "IMogoMachineVisionProvider" ) );
// 小地图模块
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SMALL_MAP, "IMogoSmallMapProvider"));
//前方碰撞预警
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake"));
if (!DebugConfig.isLauncher()) {
PersistentManager.getInstance().initManager(this);
Intent intent = new Intent(this, MogoMainService.class);
startService(intent);
}
LeakCanary.install(this);
// 初始化 bugly 升级
ARouter.getInstance().navigation(UpgradeReportProvider.class);
// debug 下初始化 bugly 上报
if (DebugConfig.isDebug()) {
ARouter.getInstance().navigation(ITestCrashReportProvider.class);
}
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
try {
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.zhidao.speech", "com.zhidao.speech.MainActivity"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
}
initMogoHttpDns();
initModules();
}
@Override
@@ -177,8 +116,7 @@ public class MogoApplication extends AbsMogoApplication {
@Override
protected void init() {
super.init();
final IMogoServiceApis apis = MogoApisHandler.getInstance().getApis();
prepareBaseService(apis, 0L);
prepareBaseService();
}
@Override
@@ -194,15 +132,9 @@ public class MogoApplication extends AbsMogoApplication {
/**
* 基础服务passport、location、socket
*/
private void prepareBaseService(IMogoServiceApis apis, long delay) {
private void prepareBaseService() {
// 第三方平台的sn是由AI云SDK中服务调用通过服务端生成的
preparePassportEnvironment();
prepareSocketAndLocationServices(apis);
//无延迟
// UiThreadHandler.postDelayed(() -> {
//
// }, delay);
}
private void preparePassportEnvironment() {
@@ -247,11 +179,9 @@ public class MogoApplication extends AbsMogoApplication {
clientConfig.setServiceAppId("com.mogo.launcher");
// 设置AI云平台分配给三方应用的签名密钥需要从AI云平台申请
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
clientConfig.setThirdPartyDeviceId(Utils.getSn());
clientConfig.setThirdPartyDeviceId(Utils.getDevicesId());
// 设置循环检测间隔时间
clientConfig.setLoopCheckDelay(15 * 1000);
// 设置是否使用MoGoAiCloud SDK内部定位进行实时数据上报
clientConfig.setIsUseExternalLocation(true);
// 设置DNS经纬度位置
clientConfig.setIHttpDnsCurrentLocation(new IHttpDnsCurrentLocation() {
@@ -262,7 +192,7 @@ public class MogoApplication extends AbsMogoApplication {
.getApis().getMapServiceApi()
.getSingletonLocationClient(getApp())
.getLastKnowLocation();
Logger.i(TAG, "刷新DNS" + mogoLocation);
//Logger.i(TAG, "刷新DNS" + mogoLocation);
if (mogoLocation != null) {
return new HttpDnsSimpleLocation(
mogoLocation.getCityCode(),
@@ -274,11 +204,25 @@ public class MogoApplication extends AbsMogoApplication {
});
// 初始化SDK可以设置状态回调来监听
MoGoAiCloudClient.getInstance().init(this, clientConfig);
MoGoAiCloudClient.getInstance().init(this, clientConfig).addTokenCallbacks(
new IMoGoTokenCallback() {
@Override
public void onTokenGot(String token, String sn) {
// 鉴权成功后开启socket长链服务
prepareSocketAndLocationServices();
}
@Override
public void onError(int code, String msg) {
Log.d(TAG,"初始化MogoAiCloudSdk failed ,reason : " + msg + " , 未能开启长链服务和初始化Modules服务");
}
}
);
}
private void prepareSocketAndLocationServices(IMogoServiceApis apis) {
private void prepareSocketAndLocationServices() {
//开启Socket长链服务
IMogoServiceApis apis = MogoApisHandler.getInstance().getApis();
apis.getSocketManagerApi(getApplicationContext()).init(getApplicationContext(), DebugConfig.getSocketAppId());
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
apis.getLocationInfoApi().start();
@@ -288,6 +232,81 @@ public class MogoApplication extends AbsMogoApplication {
}
}
private void initModules(){
Logger.d(TAG,"initModules");
if (DebugConfig.isNeedLoadGuideModule()) {
MogoModulePaths.addModule(new MogoModule(MogoModulePaths.PATH_GUIDE, MogoModulePaths.PATH_GUIDE));
}
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME));
if (DebugConfig.isLauncher()) {
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_BACK, MogoServicePaths.PATH_BACK));
MogoModulePaths.addModule(new MogoModule(MogoModulePaths.PATH_MEDIA, MogoModulePaths.PATH_MEDIA));
}
MogoModulePaths.addModule(new MogoModule(ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS));
if (DebugConfig.isMapBased()) {
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
}
MogoModulePaths.addBaseModule(new MogoModule(ShareConstants.TAG, ShareConstants.MODEL_NAME));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TANLU_API, "TanluApi"));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TRAFFIC_UPLOAD, "TrafficUpload"));
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_GAODE_AIMLESS_SHARE, "GaoDeAimlessShare"));
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"));
// MogoModulePaths.addModule( new MogoModule( IMogoMachineVisionProvider.path, "IMogoMachineVisionProvider" ) );
// 小地图模块
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SMALL_MAP, "IMogoSmallMapProvider"));
// ADAS模块
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider"));
//前方碰撞预警
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake"));
if (!DebugConfig.isLauncher()) {
PersistentManager.getInstance().initManager(this);
Intent intent = new Intent(this, MogoMainService.class);
startService(intent);
}
if (refWatcher != null){
refWatcher = LeakCanary.install(this);
}
// 初始化 bugly 升级
ARouter.getInstance().navigation(UpgradeReportProvider.class);
// debug 下初始化 bugly 上报
if (DebugConfig.isDebug()) {
ARouter.getInstance().navigation(ITestCrashReportProvider.class);
}
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
try {
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.zhidao.speech.voice.pad",
"com.zhidao.speech.MainActivity"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);

View File

@@ -97,6 +97,8 @@ ext {
mapcustom : "com.mogo.map:map-custom:${MAP_CUSTOM_VERSION}",
mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}",
mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}",
mogocustommap : "com.zhidaoauto.machine:map:${MAP_SDK_VERSION}",
modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}",
modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}",
modulemainlauncher : "com.mogo.module:module-main-launcher:${MOGO_MODULE_MAIN_LAUNCHER_VERSION}",
@@ -115,6 +117,7 @@ ext {
// V2X
moduleV2x : "com.mogo.module:module-v2x:${MOGO_MODULE_V2X_VERSION}",
moduleSmallMap : "com.mogo.module:module-small-map:${MOGO_MODULES_SMALL_MAP}",
moduleADAS : "com.mogo.module:mogo-module-adas:${MOGO_MODULES_ADAS}",
modulemedia : "com.mogo.module:module-media:${MOGO_MODULE_MEDIA_VERSION}",
modulesearch : "com.mogo.module:module-search:${MOGO_MODULE_SEARCH_VERSION}",
// push
@@ -168,6 +171,7 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mebulaobu : 'com.zhidao.support.nebulaobu:nebulaobu:1.0.0.3',
// 左侧面板
moduleleftpanel : "com.mogo.module:module-left-panel:${MOGO_MODULE_LEFT_PANEL_VERSION}",
// 左侧面板空实现

View File

@@ -8,6 +8,7 @@ import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.Utils;
import com.mogo.httpdns.HttpDnsConst;
@@ -106,7 +107,7 @@ public class MogoHttpDns implements IMogoHttpDns, HttpDns, OnAddressChangedListe
@Override
public void init(Context context, final IHttpDnsLocationChanged locationChanged) {
// .setDefaultUrl("dzt.zhidaozhixing.com")
httpDnsHelper = new HttpDnsHelper.Builder().setContext(context).setEnv(DebugConfig.getNetMode()).setSn(Utils.getSn()).setShowDebugLog(true).setLoopCheckDelay(15 * 60 * 1000).setCurrentLocation(new IHttpDnsCurrentLocation() {
httpDnsHelper = new HttpDnsHelper.Builder().setContext(context).setEnv(DebugConfig.getNetMode()).setSn(MoGoAiCloudClientConfig.getInstance().getSn()).setShowDebugLog(true).setLoopCheckDelay(15 * 60 * 1000).setCurrentLocation(new IHttpDnsCurrentLocation() {
@org.jetbrains.annotations.Nullable
@Override
public HttpDnsSimpleLocation getCurrentLocation() {

View File

@@ -28,7 +28,6 @@ android {
dependencies {
implementation rootProject.ext.dependencies.mogoaicloudsocket
implementation rootProject.ext.dependencies.mogoaicloudpassport
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils

View File

@@ -7,10 +7,10 @@ import androidx.annotation.Keep;
import com.mogo.cloud.socket.IMogoCloudSocketMsgAckListener;
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener;
import com.mogo.cloud.socket.SocketManager;
import com.mogo.cloud.socket.entity.MsgBody;
import com.mogo.service.connection.IMogoMsgAckListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.connection.IMogoSocketManager;
import com.mogo.service.connection.MsgBody;
import com.mogo.utils.logger.Logger;
import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon;
@@ -105,7 +105,7 @@ public class MogoAiCloudSocketManager implements IMogoSocketManager {
public void sendMsg(MsgBody body, IMogoMsgAckListener listener) {
Logger.d(TAG, "sendMsg.");
mAckListeners.put(body.getMsgId(), listener);
com.mogo.cloud.socket.MsgBody msgBody = new com.mogo.cloud.socket.MsgBody();
MsgBody msgBody = new MsgBody();
msgBody.msgType(body.getMsgType());
msgBody.ack(body.isAck());
msgBody.content(body.getContent());

View File

@@ -28,7 +28,6 @@ android {
dependencies {
implementation rootProject.ext.dependencies.mogoaicloudsocket
implementation rootProject.ext.dependencies.mogoaicloudpassport
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
@@ -39,6 +38,8 @@ dependencies {
implementation project(":foudations:mogo-commons")
implementation project(":services:mogo-service-api")
}
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -7,10 +7,10 @@ import androidx.annotation.Keep;
import com.mogo.cloud.socket.IMogoCloudSocketMsgAckListener;
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener;
import com.mogo.cloud.socket.SocketManager;
import com.mogo.cloud.socket.entity.MsgBody;
import com.mogo.service.connection.IMogoMsgAckListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.connection.IMogoSocketManager;
import com.mogo.service.connection.MsgBody;
import com.mogo.utils.logger.Logger;
import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon;
@@ -105,7 +105,7 @@ public class MogoAiCloudSocketManager implements IMogoSocketManager {
public void sendMsg(MsgBody body, IMogoMsgAckListener listener) {
Logger.d(TAG, "sendMsg.");
mAckListeners.put(body.getMsgId(), listener);
com.mogo.cloud.socket.MsgBody msgBody = new com.mogo.cloud.socket.MsgBody();
MsgBody msgBody = new MsgBody();
msgBody.msgType(body.getMsgType());
msgBody.ack(body.isAck());
msgBody.content(body.getContent());

View File

@@ -90,7 +90,7 @@ class SocketManager implements IMogoSocketManager, Callback {
.setClient( Platform.getClient( Platform.car ) )
.setChannelId( BaseServicesConstants.SOCKET_CHANNEL_ID )
.setOpenAnalytics( true )
.setSn( Utils.getSn() )
.setSn( MoGoAiCloudClientConfig.getInstance().getSn() )
.setDebug( DebugConfig.isDebug() );
SocketClient.getInstance().start( context );
}

View File

@@ -6,6 +6,7 @@ import android.util.Log;
import androidx.annotation.Keep;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
@@ -139,7 +140,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
WebSocketData webSocketData = new WebSocketData();
webSocketData.setSeq(computeSendMsgTime());
webSocketData.setMsgType(listener.getUpLinkType().getMsgType());
webSocketData.setSn(Utils.getSn());
webSocketData.setSn(MoGoAiCloudClientConfig.getInstance().getSn());
webSocketData.setData(GsonUtil.jsonFromObject(body));
MogoLocation lastKnown = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
if (lastKnown != null&&!lastKnown.getCityCode().isEmpty()) {
@@ -240,7 +241,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
public String getHandShakeMsg() {
WebSocketShakeHandsData webSocketShakeHandData = new WebSocketShakeHandsData(
System.currentTimeMillis(),
Utils.getSn(),
MoGoAiCloudClientConfig.getInstance().getSn(),
true
);
return GsonUtil.jsonFromObject(webSocketShakeHandData);

View File

@@ -95,11 +95,10 @@ public abstract class AbsMogoApplication extends Application {
}
protected void init() {
syncInit();
asyncInit();
}
private void syncInit() {
protected void initMogoHttpDns() {
MogoHttpDnsHandler.getHttpDnsApi().init(this, this::getCurrentLocation);
TipToast.init( this, ( ( context, message, tipDrawable ) -> {
if ( TextUtils.isEmpty( message ) ) {

View File

@@ -1,6 +1,8 @@
package com.mogo.commons.mvp;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.MotionEvent;
@@ -46,6 +48,24 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
protected void onResume() {
super.onResume();
hideBottomUIMenu();
startVoicePad();
}
/**
* 在Pad上拉起语音
*/
private void startVoicePad() {
try {
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.zhidao.speech.voice.pad",
"com.zhidao.speech.MainActivity"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
}
}
//隐藏导航栏

View File

@@ -6,6 +6,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.collection.ArrayMap;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.storage.SpStorage;
@@ -37,7 +38,7 @@ public class ParamsUtil {
params.put( ServerParam.CELL_ID, Utils.getCellId( AbsMogoApplication.getApp() ) );
// params.put( ServerParam.DISPLAY_ID, DeviceUtil.getSystemVersion() );
params.put( ServerParam.SN, Utils.getSn() );
params.put( ServerParam.SN, MoGoAiCloudClientConfig.getInstance().getSn());
params.put( ServerParam.TICKET, SpStorage.getTicket() );
return params;
@@ -73,7 +74,7 @@ public class ParamsUtil {
map.put( "debug", DebugConfig.isDebug() ? 1 : 0 );
String fota = Utils.getFotaVersion();
map.put( "systemversion", TextUtils.isEmpty( fota ) ? DebugConfig.getProductFlavor() : fota );
map.put( "sn", Utils.getSn() );
map.put( "sn", MoGoAiCloudClientConfig.getInstance().getSn() );
return map;
}

View File

@@ -8,6 +8,7 @@ import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.utils.DeviceIdUtils;
@@ -63,7 +64,7 @@ public class Utils {
public static final String FOTA_VERSION = "ro.fota.version";
public static final String PROPERTIES = "android.os.SystemProperties";
public static String getSn() {
public static String getDevicesId() {
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
return DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp());
}

View File

@@ -37,10 +37,10 @@ dependencies {
implementation rootProject.ext.dependencies.supportannos
annotationProcessor rootProject.ext.dependencies.supportannos
annotationProcessor rootProject.ext.dependencies.glidecompiler
implementation rootProject.ext.dependencies.androidxappcompat
api rootProject.ext.dependencies.mogoaicloudnetwork
implementation rootProject.ext.dependencies.androidxappcompat
api rootProject.ext.dependencies.mogoaicloudpassport
}

View File

@@ -53,7 +53,7 @@ RELEASE=false
# 模块版本
## 工程内模块
MOGO_COMMONS_VERSION=2.0.12
MOGO_UTILS_VERSION=2.0.12
MOGO_UTILS_VERSION=2.0.13
MAP_AMAP_VERSION=2.0.12
MAP_AUTONAVI_VERSION=2.0.12
MOGO_MAP_VERSION=2.0.12
@@ -133,6 +133,7 @@ TTS_NOOP_VERSION=2.0.12
MAP_CUSTOM_VERSION=2.0.12
#MOGO_MODULES_MVISION_VERSION=2.0.12
MOGO_MODULES_SMALL_MAP=1.0.0
MOGO_MODULES_ADAS=1.0.0
# httpdns
HTTPDNS_TENCENT_VERSION = 2.0.12
HTTPDNS_MOGO_VERSION=2.0.12
@@ -147,7 +148,7 @@ MOGO_OCH_TAXI_VERSION=1.0.0
######## 外部依赖引用
# 车聊聊
CARCHATTING_VERSION=2.2.325
CARCHATTING_VERSION=2.2.327
# 车聊聊接口
CARCHATTINGPROVIDER_VERSION=1.1.11
# websocket
@@ -157,19 +158,21 @@ LOGLIB_VERSION = 1.0.4
######## MogoAiCloudSDK Version
# 网络请求
MOGO_NETWORK_VERSION=1.0.84
MOGO_NETWORK_VERSION=1.1.15
# 鉴权
MOGO_PASSPORT_VERSION=1.0.84
MOGO_PASSPORT_VERSION=1.1.15
# 常链接
MOGO_SOCKET_VERSION=1.0.84
MOGO_SOCKET_VERSION=1.1.15
# 数据采集
MOGO_REALTIME_VERSION=1.0.84
MOGO_REALTIME_VERSION=1.1.15
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.0.84
MOGO_TANLU_VERSION=1.1.15
# 直播推流
MOGO_LIVE_VERSION=1.0.84
MOGO_LIVE_VERSION=1.1.15
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.0.84
MOGO_TRAFFICLIVE_VERSION=1.1.15
#ADAS HIGHT
MOGO_ADASHIGH_VERSION=1.1.3
######## Foundation MogoAiCloud Module
# mogoAiCloud apk services
@@ -183,4 +186,5 @@ MOGO_AICLOUD_SERVICES_SDK_VERSION=1.0.0-SNAPSHOT
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
versionCode=80007
versionName=8.0.7
versionName=8.0.7
MAP_SDK_VERSION=1.0.0-vr-8.5.47

View File

@@ -51,7 +51,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.logger.Logger;
@@ -481,7 +480,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
}
@@ -1052,7 +1051,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
@Override
public long getTileId(double lon, double lat) {
return getMap().getUIController().getTileId(lon,lat);
return getMap().getUIController().getTileId(lon, lat);
}
@Override

View File

@@ -46,7 +46,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.utils.NetworkUtils;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.logger.Logger;
@@ -384,7 +383,7 @@ public class AMapViewWrapper implements IMogoMapView,
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
}

View File

@@ -14,7 +14,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.utils.logger.Logger;
import java.util.List;
@@ -48,11 +47,11 @@ public class AMapUIController implements IMogoMapUIController {
}
public void initClient(IMogoMapUIController client) {
Logger.d( "whatthefuck-AMapUIController", "init %s", this );
Logger.d("whatthefuck-AMapUIController", "init %s", this);
this.mClient = client;
}
public synchronized void destroy(){
public synchronized void destroy() {
mClient = null;
}
@@ -69,7 +68,7 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public MapControlResult changeZoom( boolean zoom) {
public MapControlResult changeZoom(boolean zoom) {
if (mClient != null) {
return mClient.changeZoom(zoom);
}
@@ -86,14 +85,14 @@ public class AMapUIController implements IMogoMapUIController {
@Override
public void changeMapMode(EnumMapUI mode) {
Logger.d( "whatthefuck-AMapUIController", "%s", this );
Logger.d("whatthefuck-AMapUIController", "%s", this);
if (mClient != null) {
mClient.changeMapMode(mode);
}
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
}
@@ -118,15 +117,15 @@ public class AMapUIController implements IMogoMapUIController {
@Override
public void emphasizeMyLocation() {
if ( mClient != null ) {
if (mClient != null) {
mClient.emphasizeMyLocation();
}
}
@Override
public void showMyLocation( View view ) {
if ( mClient != null ) {
mClient.showMyLocation( view );
public void showMyLocation(View view) {
if (mClient != null) {
mClient.showMyLocation(view);
}
}
@@ -139,7 +138,7 @@ public class AMapUIController implements IMogoMapUIController {
@Override
public void loseLockMode() {
if ( mClient != null ) {
if (mClient != null) {
mClient.loseLockMode();
}
}
@@ -152,7 +151,7 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public void displayOverview( Rect bounds ) {
public void displayOverview(Rect bounds) {
if (mClient != null) {
mClient.displayOverview(bounds);
}
@@ -198,7 +197,8 @@ public class AMapUIController implements IMogoMapUIController {
return null;
}
@Override public MogoLatLng getWindowCenterLocation() {
@Override
public MogoLatLng getWindowCenterLocation() {
if (mClient != null) {
return mClient.getWindowCenterLocation();
}
@@ -230,7 +230,7 @@ public class AMapUIController implements IMogoMapUIController {
@Override
public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
long duration) {
long duration) {
if (mClient != null) {
mClient.startJumpAnimation(marker, high, interpolator, duration);
}
@@ -244,9 +244,9 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public void showBounds( String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) {
if ( mClient != null ) {
mClient.showBounds( tag, carPosition, lonLats, bound, lockCarPosition );
public void showBounds(String tag, MogoLatLng carPosition, List<MogoLatLng> lonLats, Rect bound, boolean lockCarPosition) {
if (mClient != null) {
mClient.showBounds(tag, carPosition, lonLats, bound, lockCarPosition);
}
}
@@ -258,55 +258,55 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public float calculateLineDistance( MogoLatLng p1, MogoLatLng p2 ) throws Exception {
if ( mClient != null ) {
return mClient.calculateLineDistance( p1, p2 );
public float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception {
if (mClient != null) {
return mClient.calculateLineDistance(p1, p2);
}
return 0;
}
@Override
public EnumMapUI getCurrentUiMode() {
if ( mClient != null ) {
if (mClient != null) {
return mClient.getCurrentUiMode();
}
return null;
}
@Override
public void changeMyLocation( Location location ) {
if ( mClient != null ) {
mClient.changeMyLocation( location );
public void changeMyLocation(Location location) {
if (mClient != null) {
mClient.changeMyLocation(location);
}
}
@Override
public boolean isCarLocked() {
if ( mClient != null ) {
if (mClient != null) {
return mClient.isCarLocked();
}
return false;
}
@Override
public void setCarCursorOption( CarCursorOption option ) {
if ( mClient != null ) {
mClient.setCarCursorOption( option );
public void setCarCursorOption(CarCursorOption option) {
if (mClient != null) {
mClient.setCarCursorOption(option);
}
}
@Override
public MapCameraPosition getMapCameraPosition() {
if ( mClient != null ) {
if (mClient != null) {
return mClient.getMapCameraPosition();
}
return null;
}
@Override
public void changeBearing( float bearing ) {
if ( mClient != null ) {
mClient.changeBearing( bearing );
public void changeBearing(float bearing) {
if (mClient != null) {
mClient.changeBearing(bearing);
}
}

View File

@@ -66,8 +66,8 @@ dependencies {
implementation project(':libraries:mogo-map-api')
implementation project(':foudations:mogo-commons')
}
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.35'
implementation rootProject.ext.dependencies.mogocustommap
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.47'
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
}

View File

@@ -11,4 +11,74 @@ mapAutoView.getMapAutoViewHelper()?.setMapViewVisualAngle(type
type 0=近景 1=中景 2=远景
视角切换监听事件
mapAutoView.setOnMapViewVisualAngleChangeListener
mapAutoView.setOnMapViewVisualAngleChangeListener
8.5.17
更新了顺义数据
8.5.19
修改自车模型
8.5.22
修改自车模型
2D锚点缩放功能
普通模式poi显示问题
8.5.24
优化渲染时间
更新衡阳数据
临时处理绘制3D模型策略
8.5.25
修改远景下拖动地图偶现黑屏问题
关闭部分多余日志
8.5.26
更新顺义高精数据
优化渲染效率
修改切换后台黑屏问题
8.5.28
修改远视角高度bug并修正切换动画
修改路牌显示
修改红绿灯摄像头显示bug
优化渲染效率
8.5.29
添加了3D锚点动画
近远景切换,会导致车道线渲染不全
修改地图移动方法
8.5.31
修改近景切换
添加自动开启定位开关
修改桥模型
mapAutoView.getMapAutoViewHelper()?.setNearViewAnglePositionLonLatPoint(112.57392375608,26.830652231402))切换近视角
8.5.32
解决崩溃问题
8.5.33
更新顺义衡阳数
8.5.34
高精数据放到redis
8.5.35
修改绿化带显示问题
暂时对sdk去掉混淆方便crash定位
解决bugly #304037 问题
8.5.38
修改崩溃bug
更换最新的摄像头和红绿灯
8.5.40
修改崩溃bug
更新路牌数据
修改近视角切换
8.5.47
修改绿化带相关
修改crash bug
更新衡阳数据

View File

@@ -17,7 +17,6 @@ import android.view.animation.Interpolator;
import android.widget.TextView;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoMapView;
import com.mogo.map.MogoLatLng;
@@ -35,7 +34,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.utils.TipToast;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
@@ -376,12 +374,21 @@ public class AMapViewWrapper implements IMogoMapView,
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
if (mapAutoViewHelper != null) {
Logger.d(TAG, " 用户更改视距 currentThread : " + Thread.currentThread().getName());
mVisualAngleMode = angelMode;
mapAutoViewHelper.setMapViewVisualAngle(angelMode.getCode());
if (angelMode == MODE_CLOSE_SIGHT) {
if (mogoLatLng == null) {
Logger.e(TAG, "切换地图近景需要传入要移动的经纬度数据");
return;
}
// 近景传入经纬度为点击地图上静态marker经纬度数据为GPS坐标点。
mapAutoViewHelper.setNearViewAnglePosition(new LonLatPoint(mogoLatLng.lon, mogoLatLng.lat), true);
} else {
mapAutoViewHelper.setMapViewVisualAngle(angelMode.getCode());
}
}
}

View File

@@ -95,7 +95,8 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder {
public IMogoMapView getMapView( Context context ) {
Log.d(TAG,"setDebugMode==true");
NavAutoApi.INSTANCE.init( context, MapParams.Companion.init()
.setDebugMode( false )
.setDebugMode( true )
.setDataFileSource(1) //todo 使用本地地图数据
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
.setZoom( 20 )

View File

@@ -14,7 +14,7 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.utils.logger.Logger;
import com.zhidaoauto.map.sdk.open.MapAutoApi;
import org.json.JSONObject;
@@ -88,9 +88,9 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
if (mClient != null) {
mClient.changeMapVisualAngle(angelMode);
mClient.changeMapVisualAngle(angelMode, mogoLatLng);
}
}

View File

@@ -35,7 +35,9 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
private void init( Context context ) {
addMapView( context );
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
if (mMapView != null){
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
}
}
protected abstract void addMapView( Context context );

View File

@@ -1,5 +1,6 @@
package com.mogo.map.listener;
import android.util.Log;
import android.view.MotionEvent;
import com.mogo.map.MogoLatLng;

View File

@@ -42,7 +42,7 @@ public interface IMogoMarkerManager {
void removeMarkers( String tag );
/**
* 移除地图上所有markers
* 移除地图上添加的所有markers
*/
void removeMarkers();
@@ -63,6 +63,7 @@ public interface IMogoMarkerManager {
* @return
*/
List< IMogoMarker > getMarkers( String tag );
/**
* 获取所有类型的marker。
*

View File

@@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.realtime.entity.ADASRecognizedResult;
import org.json.JSONObject;
@@ -54,7 +53,7 @@ public interface IMogoMapUIController {
*
* @param angelMode {@link VisualAngleMode}
*/
void changeMapVisualAngle(VisualAngleMode angelMode);
void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng);
/**
* 获得当前地图视距模式

View File

@@ -13,7 +13,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.utils.logger.Logger;
import org.json.JSONObject;
@@ -93,11 +92,11 @@ public class MogoMapUIController implements IMogoMapUIController {
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
initDelegate();
if (mDelegate != null) {
Logger.d(TAG, "set VisualAngle: %s", angelMode.name());
mDelegate.changeMapVisualAngle(angelMode);
mDelegate.changeMapVisualAngle(angelMode, mogoLatLng);
}
}

View File

@@ -74,6 +74,16 @@ public class MogoMarkerManager implements IMogoMarkerManager {
MogoMarkersHandler.getInstance().removeAll();
}
@Override
public void visibleAllMarkers() {
MogoMarkersHandler.getInstance().visibleAll();
}
@Override
public void inVisibleAllMarkers() {
MogoMarkersHandler.getInstance().inVisibleAll();
}
@Override
public List< IMogoMarker > getMarkers( String tag ) {
return MogoMarkersHandler.getInstance().getMarkers( tag );
@@ -99,13 +109,4 @@ public class MogoMarkerManager implements IMogoMarkerManager {
// RouteOverlayHelper.getInstance().removeAll();
}
@Override
public void visibleAllMarkers() {
}
@Override
public void inVisibleAllMarkers() {
}
}

View File

@@ -67,13 +67,15 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogoaicloudtanlu
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.mogomap
implementation rootProject.ext.dependencies.mogoserviceapi
} else {
implementation project(":foudations:mogo-utils")
implementation project(':modules:mogo-module-common')
implementation project(':libraries:mogo-map')
implementation project(':services:mogo-service-api')

View File

@@ -2,6 +2,7 @@ package com.zhidao.roadcondition.model
import android.util.Log
import com.google.gson.Gson
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.network.Utils
import com.mogo.module.common.constants.HostConst
import com.zhidao.roadcondition.base.BaseRepository
@@ -13,7 +14,7 @@ class StrategyServiceModel : BaseRepository() {
suspend fun getCityStrategy(): BaseResponse<Results> {
return apiCall {
val map = hashMapOf<String, String>()
map["sn"] = Utils.getSn()
map["sn"] = MoGoAiCloudClientConfig.getInstance().getSn()
val locInfo = LocationUtil.getInstance().getLocationInfo()
map["data"] = Gson().toJson(
StrategyRequest(
@@ -31,7 +32,7 @@ class StrategyServiceModel : BaseRepository() {
val informationBodyStr = Gson().toJson(informationBody)
Log.d("MainServiceController", "uploadInformation informationBody = $informationBodyStr")
HttpClient.getInstance(HostConst.DEVA_HOST).getHttpApi()
.uploadInformation(mapOf("sn" to Utils.getSn(), "data" to informationBodyStr))
.uploadInformation(mapOf("sn" to MoGoAiCloudClientConfig.getInstance().getSn(), "data" to informationBodyStr))
}
}
}

View File

@@ -4,6 +4,7 @@ import android.text.TextUtils
import android.util.Log
import com.hw.videoprocessor.VideoProcessor
import com.mogo.cloud.network.BaseData
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.cloud.tanlu.api.ITanluUploadCallback
import com.mogo.cloud.tanlu.api.MogoUploadManager
import com.mogo.cloud.tanlu.bean.UploadInfo
@@ -499,7 +500,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
info.direction = direction
info.areaCode = areaCode
info.cityCode = cityCode
info.sn = Utils.getSn()
info.sn = MoGoAiCloudClientConfig.getInstance().getSn()
info.type = type //0为图片 1为视频
info.fromType = fromType
info.mainInfoId = mainInfoId

View File

@@ -2,8 +2,9 @@ package com.zhidao.roadcondition.util
import android.content.Context
import com.elegant.analytics.Analytics
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.network.Utils
import com.mogo.commons.network.Utils.getFotaVersion
import java.util.HashMap
const val CarNet_Alive:String = "CarNet_Alive"//探路日活DAU埋点
@@ -45,8 +46,8 @@ fun trackNormalEvent(event: String, _data: MutableMap<String, Any>?, context: Co
val localParams = HashMap<String, Any>()
//公共参数 time sn
localParams["time"] = System.currentTimeMillis()
localParams["systemversion"] = getSystemVersion(context)
localParams["sn"] = Utils.getSn()
localParams["systemversion"] = getFotaVersion()
localParams["sn"] = MoGoAiCloudClientConfig.getInstance().getSn()
Analytics.getInstance().track(event, data)
}

View File

@@ -1,19 +0,0 @@
@file:JvmName("DeviceInfo")
package com.zhidao.roadcondition.util
import android.content.Context
fun getSystemVersion(context: Context): String {
try {
val cls = context.classLoader
val systemProperties = cls.loadClass("android.os.SystemProperties")
val paramTypes = String::class.java
val get = systemProperties.getMethod("get", paramTypes)
val version = get.invoke(systemProperties, "ro.fota.version") as String
return if (!version.trim().isNullOrEmpty()) version.trim() else ""
} catch (e: Exception) {
e.printStackTrace()
}
return ""
}

View File

@@ -3,6 +3,7 @@ package com.zhidao.roadcondition.util
import android.util.Log
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.network.Utils
import com.zhidao.roadcondition.model.InformationBody
@@ -53,7 +54,7 @@ fun getInformationBody(
if (latitude == 0.0) locationInfo.latitude else latitude,
if (longitude == 0.0) locationInfo.longitude else longitude,
locationInfo.provinceName,
Utils.getSn(),
MoGoAiCloudClientConfig.getInstance().getSn(),
locationInfo.street,
type,
0,

View File

@@ -5,7 +5,8 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<application>
<activity
android:name=".MainLauncherActivity"

View File

@@ -1,24 +1,15 @@
package com.zhidao.mogo.module.main.launcher;
import android.Manifest;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Process;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
@@ -31,21 +22,20 @@ import com.mogo.och.IMogoOCH;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.map.IMogoSmallMapProvider;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.service.v2x.IV2XListener;
import com.mogo.service.v2x.IV2XWarningListener;
import com.mogo.utils.logger.Logger;
import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_BOTTOM;
import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_LEFT;
import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_RIGHT;
import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP;
import static com.mogo.utils.ProcessUtils.getPackageName;
/**
* 针对作为Launcher的情况做个性化操作
*
* @author tongchenfei
*/
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IV2XListener {
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IV2XWarningListener {
private static final String TAG = "MainLauncherActivity";
protected boolean mIsHomeKeyDown = false;
private static Handler handlerV2XEvent = new Handler();

1
modules/mogo-module-adas/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,65 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
annotationProcessor rootProject.ext.dependencies.aroutercompiler
// 现有的ADAS的通讯SDK需要将里面的东西融合到我们项目中
compileOnly rootProject.ext.dependencies.adasapi
api "com.zhidao.support.adas:high:1.1.9.2"
annotationProcessor rootProject.ext.dependencies.aroutercompiler
if (Boolean.valueOf(RELEASE)) {
api rootProject.ext.dependencies.mogoutils
api rootProject.ext.dependencies.mogocommons
api rootProject.ext.dependencies.mogoserviceapapi
implementation rootProject.ext.dependencies.modulecommon
} else {
api project(":foudations:mogo-utils")
api project(":foudations:mogo-commons")
api project(':services:mogo-service-api')
implementation project(':modules:mogo-module-common')
}
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -1,18 +0,0 @@
package com.alibaba.android.arouter.routes;
import com.alibaba.android.arouter.facade.enums.RouteType;
import com.alibaba.android.arouter.facade.model.RouteMeta;
import com.alibaba.android.arouter.facade.template.IRouteGroup;
import com.mogo.module.adas.AdasProvider;
import java.lang.Override;
import java.lang.String;
import java.util.Map;
/**
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
public class ARouter$$Group$$adas implements IRouteGroup {
@Override
public void loadInto(Map<String, RouteMeta> atlas) {
atlas.put("/adas/api", RouteMeta.build(RouteType.PROVIDER, AdasProvider.class, "/adas/api", "adas", null, -1, -2147483648));
}
}

View File

@@ -1,18 +0,0 @@
package com.alibaba.android.arouter.routes;
import com.alibaba.android.arouter.facade.enums.RouteType;
import com.alibaba.android.arouter.facade.model.RouteMeta;
import com.alibaba.android.arouter.facade.template.IProviderGroup;
import com.mogo.module.adas.AdasProvider;
import java.lang.Override;
import java.lang.String;
import java.util.Map;
/**
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
public class ARouter$$Providers$$mogomoduleadas implements IProviderGroup {
@Override
public void loadInto(Map<String, RouteMeta> providers) {
providers.put("com.mogo.module.adas.AdasProvider", RouteMeta.build(RouteType.PROVIDER, AdasProvider.class, "/adas/api", "adas", null, -1, -2147483648));
}
}

View File

@@ -1,17 +0,0 @@
package com.alibaba.android.arouter.routes;
import com.alibaba.android.arouter.facade.template.IRouteGroup;
import com.alibaba.android.arouter.facade.template.IRouteRoot;
import java.lang.Class;
import java.lang.Override;
import java.lang.String;
import java.util.Map;
/**
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
public class ARouter$$Root$$mogomoduleadas implements IRouteRoot {
@Override
public void loadInto(Map<String, Class<? extends IRouteGroup>> routes) {
routes.put("adas", ARouter$$Group$$adas.class);
}
}

View File

@@ -1,18 +0,0 @@
/**
* Automatically generated file. DO NOT MODIFY
*/
package com.mogo.module.adas;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String LIBRARY_PACKAGE_NAME = "com.mogo.module.adas";
/**
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
*/
@Deprecated
public static final String APPLICATION_ID = "com.mogo.module.adas";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "";
}

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.adas"
android:versionCode="1" >
<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="23" />
</manifest>

View File

@@ -1 +0,0 @@
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"","enabled":true,"outputFile":"mogo-module-adas-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.mogo.module.adas","split":""}}]

View File

@@ -1 +0,0 @@
{"jetified-arouter-compiler-1.2.2.jar (com.alibaba:arouter-compiler:1.2.2)":false,"auto-service-1.0-rc2.jar (com.google.auto.service:auto-service:1.0-rc2)":false}

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/debug/jniLibs"/></dataSet></merger>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/debug/shaders"/></dataSet></merger>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/main/assets"/><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/debug/assets"/></dataSet></merger>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/foudations/httpdns-base/src/debug/res"/></dataSet><mergedItems/></merger>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.adas"
android:versionCode="1" >
<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="23" />
</manifest>

View File

@@ -1,2 +0,0 @@
R_DEF: Internal format may change without notice
local

View File

@@ -1,12 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.mogo.module.adas"
4 android:versionCode="1" >
5
6 <uses-sdk
7 android:minSdkVersion="23"
7-->/Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
8 android:targetSdkVersion="23" />
8-->/Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
9
10</manifest>

View File

@@ -1 +0,0 @@
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"","enabled":true,"outputFile":"mogo-module-adas-debug.aar","fullName":"debug","baseName":"debug"},"path":"../../library_manifest/debug/AndroidManifest.xml","properties":{"packageId":"com.mogo.module.adas","split":""}}]

View File

@@ -1,31 +0,0 @@
-- Merging decision tree log ---
manifest
ADDED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:2:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:2:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:2:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:2:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:2:1-5:12
package
ADDED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:3:5-35
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
android:versionCode
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
ADDED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:2:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
xmlns:android
ADDED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml:2:11-69
uses-sdk
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml reason: use-sdk injection requested
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
android:targetSdkVersion
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
ADDED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
android:minSdkVersion
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
ADDED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/modules/mogo-module-adas/src/main/AndroidManifest.xml

View File

@@ -0,0 +1,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=mogo-module-adas
VERSION_CODE=1

View File

@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@@ -0,0 +1,26 @@
package com.amap.navi.mogo_module_adas;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.amap.navi.mogo_module_adas.test", appContext.getPackageName());
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.adas">
</manifest>

View File

@@ -0,0 +1,58 @@
package com.mogo.module.adas;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarStateModel;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.bean.AutopilotStatus;
import com.zhidao.support.adas.high.bean.AutopilotWayArrive;
import com.zhidao.support.adas.high.bean.CarLaneInfo;
import com.zhidao.support.adas.high.bean.CarStateInfo;
import com.zhidao.support.adas.high.bean.LightStatueInfo;
import com.zhidao.support.adas.high.bean.ObstaclesInfo;
import com.zhidao.support.adas.high.bean.RectInfo;
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
import java.util.List;
/**
* Created by XuYong on 2021/4/25 16:52
*/
public abstract class AdasDataListener {
public void sendMsg( String msg ) {
}
public void cameraEyeDetectResult( String detectResult ) {
}
public void selectCarModelUrl( String carStyleUrl ) {
}
public void requestGetCarModelListInfo() {
}
public void clickSettingBack() {
}
public void showToast( String msg ) {
}
public void autopilotArrive( AdasAIDLAutopilotArriveModel autopilotArriveModel ) {
}
public void ownerCarStateInfo( String ownerCarStateInfo ) {
}
public void notifyOwnerCarState( AdasAIDLOwnerCarStateModel ownerCarStateModel ) {
}
public void notifyAutopilotState( AdasAIDLAutopilotStateModel autopilotStateModel ) {
}
public void notifyOwnerCarRect( List<AdasAIDLOwnerCarRectModel> ownerCarStateRectList ) {
}
}

View File

@@ -0,0 +1,209 @@
package com.mogo.module.adas;
import com.google.gson.Gson;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.OnAdasMsgConnectStatusListener;
import com.zhidao.support.adas.high.bean.AutopilotStatus;
import com.zhidao.support.adas.high.bean.AutopilotWayArrive;
import com.zhidao.support.adas.high.bean.CarLaneInfo;
import com.zhidao.support.adas.high.bean.CarStateInfo;
import com.zhidao.support.adas.high.bean.LightStatueInfo;
import com.zhidao.support.adas.high.bean.ObstaclesInfo;
import com.zhidao.support.adas.high.bean.RectInfo;
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
import com.zhidao.support.adas.high.common.MsgActionType;
import java.util.ArrayList;
/**
* Created by XuYong on 2021/4/25 14:43
*/
public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusListener {
private final String TAG = "AdasEventManager";
private final Gson gson;
private final ArrayList<AdasDataListener> iAdasEventListeners = new ArrayList<>();
private final ArrayList<AdasStatusListener> iAdasStatusListeners = new ArrayList<>();
public AdasEventManager() {
gson = GsonUtil.getGson();
}
public void addEventListener(AdasDataListener listener) {
Logger.d(TAG,"添加adas事件监听");
if(iAdasEventListeners.contains(listener)){
return;
}
iAdasEventListeners.add(listener);
}
public void removeEventListener(AdasDataListener listener) {
Logger.d(TAG,"注销adas事件监听");
if (iAdasEventListeners != null) {
iAdasEventListeners.remove(listener);
}
}
public void addStatusListener(AdasStatusListener listener) {
Logger.d(TAG,"添加adas状态事件监听");
if(iAdasStatusListeners.contains(listener)){
return;
}
iAdasStatusListeners.add(listener);
}
public void removeStatusListener(AdasStatusListener listener) {
Logger.d(TAG,"注销adas状态事件监听");
if (iAdasStatusListeners != null) {
iAdasStatusListeners.remove(listener);
}
}
@Override
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
Logger.d(TAG,"onWarnMessage " + warnMessageInfo);
//报警model
WarnMessageModel warnMessageModel = null;
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
if (warnMessageModel == null) {
warnMessageModel = new WarnMessageModel();
warnMessageModel.setAction(MsgActionType.ACTION_WS_MSG_WARNING_TYPE.getmActionType());
}
warnMessageModel.setValues(warnMessageInfo);
listener.cameraEyeDetectResult(gson.toJson(warnMessageModel));
}
}
}
@Override
public void onVideoSize(int width, int height) {
Logger.d(TAG,"onVideoSize");
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
}
}
}
@Override
public void onRectData(RectInfo rectInfo) {
Logger.d(TAG,"onRectData " + rectInfo);
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
listener.cameraEyeDetectResult(gson.toJson(rectInfo));
}
}
}
@Override
public void onCarStateData(CarStateInfo carStateInfo) {
Logger.d(TAG,"onCarStateData " + carStateInfo);
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
listener.ownerCarStateInfo(gson.toJson(carStateInfo));
}
}
}
@Override
public void onLightStateData(LightStatueInfo lightStatueInfo) {
Logger.d(TAG,"onLightStateData " + lightStatueInfo);
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
}
}
}
@Override
public void onObstaclesInfo(ObstaclesInfo obstaclesInfo) {
Logger.d(TAG,"onObstaclesInfo " + obstaclesInfo);
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
}
}
}
@Override
public void onCarLaneInfo(CarLaneInfo carLaneInfo) {
Logger.d(TAG,"onCarLaneInfo " + carLaneInfo);
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
}
}
}
@Override
public void autopilotStatus(AutopilotStatus autopilotStatus) {
Logger.d(TAG,"autopilotStatus " + autopilotStatus);
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
AutopilotStatus.ValuesBean mAutopilotStatus;
if (autopilotStatusValues != null) {
AdasAIDLAutopilotStateModel adasAIDLAutopilotStateModel=new AdasAIDLAutopilotStateModel();
adasAIDLAutopilotStateModel.setReason(autopilotStatusValues.getReason());
mAutopilotStatus = autopilotStatusValues;
int state = autopilotStatusValues.getState();
float speed = autopilotStatusValues.getSpeed();
adasAIDLAutopilotStateModel.setState(state);
adasAIDLAutopilotStateModel.setSpeed(speed);
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
listener.notifyAutopilotState(adasAIDLAutopilotStateModel);
}
}
}
}
@Override
public void autopilotArrive(AutopilotWayArrive autopilotWayArrive) {
Logger.d(TAG,"autopilotArrive " + autopilotWayArrive);
if (autopilotWayArrive != null) {
AutopilotWayArrive.ResultBean result = autopilotWayArrive.getResult();
if (result != null) {
AutopilotWayArrive.ResultBean.EndLatLonBean endLatLon = result.getEndLatLon();
if (endLatLon != null) {
AdasAIDLAutopilotArriveModel adasAIDLAutopilotArriveModel = new AdasAIDLAutopilotArriveModel();
adasAIDLAutopilotArriveModel.setCarType(result.getCarType());
adasAIDLAutopilotArriveModel.setLat(endLatLon.getLat());
adasAIDLAutopilotArriveModel.setLon(endLatLon.getLon());
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
listener.autopilotArrive(adasAIDLAutopilotArriveModel);
}
}
}
}
}
}
@Override
public void onAutopilotRoute(String route) {
}
@Override
public void onWebSocketConnectSuccess() {
Logger.d(TAG,"webSocket 连接成功");
for (AdasStatusListener listener :iAdasStatusListeners) {
listener.onServiceConnected();
}
}
@Override
public void onWebSocketConnectFailed() {
Logger.d(TAG,"webSocket 连接失败");
for (AdasStatusListener listener :iAdasStatusListeners) {
listener.onServiceDisconnected();
}
}
}

View File

@@ -0,0 +1,58 @@
package com.mogo.module.adas;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.service.MogoServicePaths;
import com.mogo.utils.logger.Logger;
import com.zhidao.support.adas.high.AdasManager;
/**
* ADAS 模块
*
* @author
* @date 4/21/21 3:39 PM
* wikihttp://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52840459
*/
@Route(path = MogoServicePaths.PATH_ADAS)
public class AdasProvider implements IProvider {
private static final String TAG = "AdasProvider";
private AdasEventManager adasEventManager;
@Override
public void init(Context context) {
Logger.d(TAG, "初始化 AdasProvider 模块");
adasEventManager = new AdasEventManager();
initAdas(context, adasEventManager);
}
private void initAdas(Context context, AdasEventManager adasEventManager) {
AdasManager.getInstance().create(context);
AdasManager.getInstance().setOnAdasListener(adasEventManager);
AdasManager.getInstance().setOnAdasConnectStatusListener(adasEventManager);
}
public void addAdasEventListener(AdasDataListener listener) {
adasEventManager.addEventListener(listener);
}
public void removeAdasEventListener(AdasDataListener listener) {
adasEventManager.removeEventListener(listener);
}
public void addAdasStatusListener(AdasStatusListener listener) {
adasEventManager.addStatusListener(listener);
}
public void removeAdasStatusListener(AdasStatusListener listener) {
adasEventManager.removeStatusListener(listener);
}
public void sendWsMessage(String msg) {
AdasManager.getInstance().aiCloudToAdasData(msg);
}
}

View File

@@ -0,0 +1,14 @@
package com.mogo.module.adas;
/**
* Created by XuYong on 4/28/21 16:19
*/
public abstract class AdasStatusListener {
public void onServiceConnected() {
};
public void onServiceDisconnected() {
};
}

View File

@@ -0,0 +1,31 @@
package com.mogo.module.adas;
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
/**
* @author nie yunlong
* @des
* @date 2020/10/22
*/
public class WarnMessageModel {
private String action;
private WarnMessageInfo values;
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public WarnMessageInfo getValues() {
return values;
}
public void setValues(WarnMessageInfo values) {
this.values = values;
}
}

View File

@@ -0,0 +1,30 @@
package com.mogo.module.adas;
/**
* @author donghongyu
* @date 4/21/21 2:52 PM
*/
public class 占位文件可删除 {
/** TODO 本模块提供能力范围
* 1、与工控机数据交互具体能力与 @宋克难 沟通
* a、建立车机与工控机的数据通路
* b、保证数据通路的稳定性
*
* 2、暴露API接口共上层业务使用
* a、上层业务可主动订阅、取消订阅数据
* b、自动驾驶控制下发
* b、自动驾驶状态获取
* c、自动驾驶规划路径下发
* e、ADAS识别报警
*
* 3、项目中已经使用到的ADAS数据的业务如下可参考下面业务层使用情况来封装本模块的API
* AdasControlCommandParameter
* AdasLogWriter
* AdasObjectUtils
* CarModelInfoNetApiServices
* LogWriter
* MogoADASController
* OnAdasListenerAdapter
*/
}

View File

@@ -0,0 +1,17 @@
package com.amap.navi.mogo_module_adas;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@@ -1,7 +1,7 @@
package com.mogo.module.authorize.authprovider.launcher
import com.google.gson.Gson
import com.mogo.commons.network.Utils.getSn
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.module.authorize.model.BaseResponse
import com.mogo.module.authorize.model.IMogoAuthorizeModel
import com.mogo.module.authorize.model.bean.UpdateAuthorize
@@ -10,7 +10,7 @@ class MogoAuthorizeMainModel : IMogoAuthorizeModel() {
suspend fun updateAuthorize(agrId: Long, agreementStatus: Int): BaseResponse<Any> {
val updateAuthorize = Gson().toJson(UpdateAuthorize(agrId, agreementStatus))
val map = mapOf("sn" to getSn(), "data" to updateAuthorize)
val map = mapOf("sn" to MoGoAiCloudClientConfig.getInstance().sn, "data" to updateAuthorize)
return apiCall { getNetWorkApi().updateAuthorize(map) }
}

View File

@@ -1,7 +1,7 @@
package com.mogo.module.authorize.model
import com.google.gson.Gson
import com.mogo.commons.network.Utils.getSn
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.module.authorize.model.bean.AgreementData
import com.mogo.module.authorize.model.bean.AgreementStatus
import com.mogo.module.authorize.model.bean.RequestUserAgreement
@@ -14,13 +14,13 @@ open class IMogoAuthorizeModel : BaseRepository() {
suspend fun invokeAuthorizeContent(agreementType: Int, needContent: Boolean = false): BaseResponse<AgreementData> {
val requestUserAgreement = Gson().toJson(RequestUserAgreement(agreementType, needContent))
val map = mapOf("sn" to getSn(), "data" to requestUserAgreement)
val map = mapOf("sn" to MoGoAiCloudClientConfig.getInstance().sn, "data" to requestUserAgreement)
return apiCall { getNetWorkApi().getAuthorizeContent(map) }
}
suspend fun invokeIfNeedAuthorize(agreementType: Int): BaseResponse<AgreementStatus> {
val requestUserAgreement = Gson().toJson(RequestUserAgreement(agreementType))
val map = mapOf("sn" to getSn(), "data" to requestUserAgreement)
val map = mapOf("sn" to MoGoAiCloudClientConfig.getInstance().sn, "data" to requestUserAgreement)
return apiCall { getNetWorkApi().checkIfNeedAuthorize(map) }
}
}

View File

@@ -8,13 +8,19 @@ public
* 描述
*/
class DataTypes {
/**
* adas识别数据
* 识别感知和云端感知数据全部标记为Marker融合数据
*/
public static final String TYPE_MARKER_MERGE = "TYPE_MARKER_MERGE";
/**
* adas识别数据Mock用
*/
public static final String TYPE_MARKER_ADAS = "TYPE_MARKER_ADAS";
/**
* 云端下发数据
* 云端下发数据Mock用
*/
public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA";

View File

@@ -2,6 +2,7 @@ package com.mogo.module.common.dialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.view.WindowManager;
import androidx.annotation.NonNull;
@@ -32,7 +33,11 @@ public class BaseFloatDialog extends Dialog {
}
private void addFlag() {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
} else {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
}
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);

View File

@@ -1,25 +1,27 @@
package com.mogo.module.common.drawer;
import android.os.Message;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.module.common.utils.SimpleHandlerThreadPool;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.utils.logger.Logger;
import com.mogo.module.common.utils.Trigonometric;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS;
public
/**
* @author congtaowang
@@ -33,16 +35,21 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
private static volatile AdasRecognizedResultDrawer sInstance;
/**
* 上一帧数据的缓存
*/
protected static Map<String, IMogoMarker> mMarkersCaches = new ConcurrentHashMap<>();
public AdasRecognizedResultDrawer() {
super();
}
private final Map< String, ADASRecognizedResult > mLastPositions = new ConcurrentHashMap<>();
private final Map<String, ADASRecognizedResult> mLastPositions = new ConcurrentHashMap<>();
public static AdasRecognizedResultDrawer getInstance() {
if ( sInstance == null ) {
synchronized ( AdasRecognizedResultDrawer.class ) {
if ( sInstance == null ) {
if (sInstance == null) {
synchronized (AdasRecognizedResultDrawer.class) {
if (sInstance == null) {
sInstance = new AdasRecognizedResultDrawer();
}
}
@@ -59,8 +66,8 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
return sInstance;
}
public boolean hasCached( String uniqueKey ) {
return mMarkersCaches.containsKey( uniqueKey );
public boolean hasCached(String uniqueKey) {
return mMarkersCaches.containsKey(uniqueKey);
}
/**
@@ -68,203 +75,275 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
*
* @param resultList
*/
public void renderAdasRecognizedResult( List< ADASRecognizedResult > resultList ) {
if ( resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize() ) {
public void renderAdasRecognizedResult(List<ADASRecognizedResult> resultList) {
if (resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize()) {
clearOldMarker();
return;
}
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
clearOldMarker();
return;
}
Map< String, IMogoMarker > newAdasRecognizedMarkersCaches = new HashMap<>();
List< ADASRecognizedResult > newDiffSet = new ArrayList<>();
for ( ADASRecognizedResult recognizedListResult : resultList ) {
List<ADASRecognizedResult> allDatumsList = new ArrayList<>();
// prepareData(resultList, allDatumsList);
if ( isUselessValue( recognizedListResult ) ) {
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
List<ADASRecognizedResult> newDiffSet = new ArrayList<>();
for (ADASRecognizedResult recognizedListResult : resultList) {
if (isUselessValue(recognizedListResult)) {
continue;
}
// 复用之前存在的 marker
String uniqueKey = recognizedListResult.uuid;
IMogoMarker marker = mMarkersCaches.remove( uniqueKey );
if ( marker != null && !marker.isDestroyed() ) {
renderAdasOneFrame( marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches );
IMogoMarker marker = mMarkersCaches.remove(uniqueKey);
if (marker != null && !marker.isDestroyed()) {
updateCacheMarkerRes(marker, recognizedListResult);
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
} else {
// 新增差集
newDiffSet.add( recognizedListResult );
// 新增添加进差集
newDiffSet.add(recognizedListResult);
}
}
removeUselessMarker();
removeUselessMarker(mMarkersCaches);
removeUselessLastRecord();
// 能复用的 marker 数量
int cachedMarkerSize = mMarkersCaches.size();
// 需要新增的 marker 数量
int newDiffSetSize = newDiffSet.size();
// 能复用的数量
int size = cachedMarkerSize >= newDiffSetSize ? newDiffSetSize : cachedMarkerSize;
int size = Math.min(cachedMarkerSize, newDiffSetSize);
// 复用过期 marker
if ( newDiffSetSize > 0 ) {
Iterator< Map.Entry< String, IMogoMarker > > entryIterator = mMarkersCaches.entrySet().iterator();
for ( int i = 0; i < size; i++ ) {
ADASRecognizedResult recognizedListResult = newDiffSet.get( i );
if (newDiffSetSize > 0) {
Iterator<Map.Entry<String, IMogoMarker>> entryIterator = mMarkersCaches.entrySet().iterator();
for (int i = 0; i < size; i++) {
ADASRecognizedResult recognizedListResult = newDiffSet.get(i);
String uniqueKey = recognizedListResult.uuid;
Map.Entry< String, IMogoMarker > entry = entryIterator.next();
Map.Entry<String, IMogoMarker> entry = entryIterator.next();
entryIterator.remove();
ADASRecognizedResult old = mLastPositions.remove( entry.getKey() );
ADASRecognizedResult old = mLastPositions.remove(entry.getKey());
IMogoMarker marker = entry.getValue();
if ( marker == null ) {
if (marker == null) {
Log.d("EmArrow", "存在复用marker为空数据");
continue;
}
// 更新资源内容
if ( old == null || old.type != recognizedListResult.type ) {
String resIdVal = null;
int resId = getModelRes( recognizedListResult.type );
resIdVal = resId + "";
String resName = mMarkerCachesResMd5Values.get( resIdVal );
if ( !TextUtils.isEmpty( resName ) ) {
if ( !TextUtils.equals( resName, marker.getMarkerResName() ) ) {
marker.use3DResource( resName );
}
} else {
resName = marker.use3DResource( resId );
mMarkerCachesResMd5Values.put( resIdVal, resName );
}
// 复用更新marker 3D资源
if (old == null || old.type != recognizedListResult.type) {
updateCacheMarkerRes(marker, recognizedListResult);
}
renderAdasOneFrame( marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches );
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
}
// 复用过后还需新增的 marker
for ( int i = size; i < newDiffSetSize; i++ ) {
ADASRecognizedResult recognizedListResult = newDiffSet.get( i );
for (int i = size; i < newDiffSetSize; i++) {
ADASRecognizedResult recognizedListResult = newDiffSet.get(i);
String uniqueKey = recognizedListResult.uuid;
IMogoMarker marker = drawAdasRecognizedDataMarker( recognizedListResult );
if ( marker == null ) {
IMogoMarker marker = drawAdasRecognizedDataMarker(recognizedListResult);
if (marker == null) {
continue;
}
renderAdasOneFrame( marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches );
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
}
}
if ( cachedMarkerSize - size > 0 ) {
sendMessage( MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches );
if (cachedMarkerSize - size > 0) {
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
}
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
mMarkersCaches = newAdasRecognizedMarkersCaches;
}
private boolean isUselessValue( ADASRecognizedResult recognizedListResult ) {
if ( recognizedListResult == null ) {
return true;
}
if ( !isRenderType( recognizedListResult.type ) ) {
return true;
}
/**
* 对数据补点
*
* @param in
* @param out
*/
private void prepareData(List<ADASRecognizedResult> in, List<ADASRecognizedResult> out) {
// foreCastPoint(in);
out.addAll(in);
}
String uniqueKey = recognizedListResult.uuid;
if ( TextUtils.isEmpty( uniqueKey ) ) {
private final static String FORECAST = "adasForecast";
/**
* 基于工控机识别的数据点速度预测当前位置和距离自车距离
*
* @param in 数据源
*/
private void foreCastPoint(List<ADASRecognizedResult> in) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
for (ADASRecognizedResult adasResult : in) {
Log.d(FORECAST, "ready to foreCast current uuid : " + adasResult.uuid);
long internal = getCurSatelliteTime() - adasResult.satelliteTime;
if (internal <= 0) {
Log.d(FORECAST, "time internal less than 0 , uuid : " + adasResult.uuid);
continue;
}
long startTime = System.currentTimeMillis();
// 预测点
Log.d(FORECAST, "time internal : " + internal + " speed : " + adasResult.speed);
double foreCastDistance = adasResult.speed * internal / 1000;
Log.d(FORECAST, "foreCastDistance : " + foreCastDistance);
MogoLatLng mogoLatLng = new MogoLatLng(adasResult.lat, adasResult.lon);
MogoLatLng foreCastMogoLatLon = Trigonometric.getNewLocation(mogoLatLng, foreCastDistance, adasResult.heading);
// 计算与自车距离
float distanceFromSelf = CoordinateUtils.calculateLineDistance(getCurCoordinates()[0], getCurCoordinates()[1]
, foreCastMogoLatLon.getLon(), foreCastMogoLatLon.getLat());
long foreCastInternal = System.currentTimeMillis() - startTime;
Log.d(FORECAST, "foreCastInternal :" + foreCastInternal); //todo 耗时1~2毫秒 需要测试是否由于补点算法造成
adasResult.lat = foreCastMogoLatLon.getLat();
adasResult.lon = foreCastMogoLatLon.getLon();
adasResult.satelliteTime = (getCurSatelliteTime() - foreCastInternal);
adasResult.distance = distanceFromSelf;
}
}
}
/**
* todo 后面涉及到此类变化的数据均改动
*
* @param marker
* @param recognizedListResult
*/
private void updateCacheMarkerRes(IMogoMarker marker, ADASRecognizedResult recognizedListResult) {
String resIdVal;
int resId = getModelRes(recognizedListResult.type);
resIdVal = resId + "";
String resName = mMarkerCachesResMd5Values.get(resIdVal);
if (!TextUtils.isEmpty(resName)) {
if (!TextUtils.equals(resName, marker.getMarkerResName())) {
marker.use3DResource(resName);
}
} else {
resName = marker.use3DResource(resId);
mMarkerCachesResMd5Values.put(resIdVal, resName);
}
}
private void removeUselessLastRecord() { // todo 最好重新设计一个数据结构用于多线程数据过期失效的场景参见redis数据过期
if (mLastPositions.isEmpty()) {
return;
}
Iterator<ADASRecognizedResult> iterator = mLastPositions.values().iterator();
Log.d("EmArrow", "removeUselessLastRecord size : " + mLastPositions.size());
while (iterator.hasNext()) {
ADASRecognizedResult result = iterator.next();
long internal = result.satelliteTime - getCurSatelliteTime();
if (internal > 300) {
iterator.remove();
}
}
}
/**
* 过滤无用数据
*
* @param recognizedListResult {@link ADASRecognizedResult}
* @return useless
*/
private boolean isUselessValue(ADASRecognizedResult recognizedListResult) {
if (recognizedListResult == null) {
return true;
}
return false;
if (!isRenderType(recognizedListResult.type)) {
return true;
}
String uniqueKey = recognizedListResult.uuid;
return TextUtils.isEmpty(uniqueKey);
}
/**
* 绘制某个物体的一个数据
*
* @param recognizedListResult
* @param newAdasRecognizedMarkersCaches
* @param recognizedListResult {@link ADASRecognizedResult}
* @param newAdasRecognizedMarkersCaches 缓存集合
*/
private void renderAdasOneFrame( IMogoMarker marker,
String uniqueKey,
ADASRecognizedResult recognizedListResult,
Map< String, IMogoMarker > newAdasRecognizedMarkersCaches ) {
private void renderAdasOneFrame(IMogoMarker marker,
String uniqueKey,
ADASRecognizedResult recognizedListResult,
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches) {
final long start = System.currentTimeMillis();
Log.d("EmArrow", "renderAdasOneFrame uuid : " + uniqueKey + " type : " + recognizedListResult.type);
Log.d("EmArrow", "renderAdasOneFrame Process.myPid : " + android.os.Process.myPid());
ADASRecognizedResult lastPosition = mLastPositions.remove(uniqueKey);
// double lastLon = -1;
// double lastLat = -1;
// if (lastPosition != null) {
// lastLon = lastPosition.lon;
// lastLat = lastPosition.lat;
// }
// double[] matchLonLat = getMatchLonLat(recognizedListResult.uuid, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading, lastLon, lastLat);
//
// recognizedListResult.lon = matchLonLat[0];
// recognizedListResult.lat = matchLonLat[1];
ADASRecognizedResult lastPosition = mLastPositions.remove( uniqueKey );
double lastLon = -1;
double lastLat = -1;
if ( lastPosition != null ) {
lastLon = lastPosition.lon;
lastLat = lastPosition.lat;
}
double[] matchLonLat = getMatchLonLat( recognizedListResult.uuid, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading, lastLon, lastLat );
mLastPositions.put(uniqueKey, recognizedListResult);
// Log.d( "matchRoad", "cost = %s", System.currentTimeMillis() - start );
newAdasRecognizedMarkersCaches.put(uniqueKey, marker);
if (lastPosition != null) {
long interval = computeAnimDuration(lastPosition.systemTime, recognizedListResult.systemTime, lastPosition.satelliteTime, recognizedListResult.satelliteTime);
recognizedListResult.lon = matchLonLat[0];
recognizedListResult.lat = matchLonLat[1];
mLastPositions.put( uniqueKey, recognizedListResult );
// Logger.d( "matchRoad", "cost = %s", System.currentTimeMillis() - start );
newAdasRecognizedMarkersCaches.put( uniqueKey, marker );
if ( lastPosition != null ) {
long interval = computeAnimDuration( lastPosition.systemTime, recognizedListResult.systemTime, lastPosition.satelliteTime, recognizedListResult.satelliteTime );
final MogoLatLng renderLoc = new MogoLatLng( recognizedListResult.lat, recognizedListResult.lon );
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon);
long cost = System.currentTimeMillis() - start;
final long intervalRef = interval - cost;
SimpleHandlerThreadPool.getInstance().postRender( () -> {
marker.addDynamicAnchorPosition( renderLoc, ( float ) recognizedListResult.heading, intervalRef );
} );
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.heading, intervalRef);
} else {
marker.setRotateAngle( ( ( float ) recognizedListResult.heading ) );
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
marker.setRotateAngle(((float) recognizedListResult.heading));
marker.setPosition(recognizedListResult.lat, recognizedListResult.lon);
}
String carColor = recognizedListResult.color;
if ( TextUtils.isEmpty( carColor ) ) {
carColor = getModelRenderColor( recognizedListResult.type, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading );
if (TextUtils.isEmpty(carColor)) {
carColor = getModelRenderColor(recognizedListResult.type, FROM_ADAS, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading);
}
marker.setAnchorColor( carColor );
marker.setAnchorColor(carColor);
if ( shouldShowSpeed( recognizedListResult.type ) ) {
Message msg = mRenderThreadHandler.obtainMessage();
SpeedData obj = new SpeedData();
obj.context = mContext;
obj.marker = marker;
obj.speed = recognizedListResult.speed;
msg.obj = obj;
msg.what = MSG_DISPLAY_SPEED;
msg.sendToTarget();
}
// if (shouldShowSpeed(recognizedListResult.type)) {
// showSelfSpeed(marker, recognizedListResult.speed, recognizedListResult.uuid, recognizedListResult.type, MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode());
// } //todo 6月4号演示关闭
}
/**
* 绘制 marker
*
* @param recognizedListResult
* @return
* @param recognizedListResult {@link ADASRecognizedResult}
* @return {@link IMogoMarker}
*/
private IMogoMarker drawAdasRecognizedDataMarker( ADASRecognizedResult recognizedListResult ) {
if ( recognizedListResult == null ) {
private IMogoMarker drawAdasRecognizedDataMarker(ADASRecognizedResult recognizedListResult) {
if (recognizedListResult == null) {
return null;
}
String resIdVal = null;
int resId = getModelRes( recognizedListResult.type );
resIdVal = resId + "";
int resId = getModelRes(recognizedListResult.type);
String resIdVal = resId + "";
String carColor = recognizedListResult.color;
if ( TextUtils.isEmpty( carColor ) ) {
carColor = getModelRenderColor( recognizedListResult.type, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading );
if (TextUtils.isEmpty(carColor)) {
carColor = getModelRenderColor(recognizedListResult.type, FROM_ADAS, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading);
}
MogoMarkerOptions options = new MogoMarkerOptions()
.owner( DataTypes.TYPE_MARKER_ADAS )
.anchor( 0.5f, 0.5f )
.set3DMode( true )
.gps( true )
.anchorColor( carColor )
.controlAngle( true )
.resName( mMarkerCachesResMd5Values.get( resIdVal ) )
.icon3DRes( resId )
.rotate( ( float ) recognizedListResult.heading )
.position( new MogoLatLng( recognizedListResult.lat, recognizedListResult.lon ) );
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).addMarker( DataTypes.TYPE_MARKER_ADAS, options );
cacheMarkerIconResMd5Val( resIdVal, marker );
.owner(DataTypes.TYPE_MARKER_ADAS)
.anchor(0.5f, 0.5f)
.set3DMode(true)
.gps(true)
.anchorColor(carColor)
.controlAngle(true)
.resName(mMarkerCachesResMd5Values.get(resIdVal))
.icon3DRes(resId)
.rotate((float) recognizedListResult.heading)
.position(new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon));
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(DataTypes.TYPE_MARKER_ADAS, options);
cacheMarkerIconResMd5Val(resIdVal, marker);
return marker;
}
@@ -279,12 +358,10 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
* 清除旧的 marker 数据
*/
public void clearOldMarker() {
if ( mMarkersCaches != null ) {
if (mMarkersCaches != null) {
mMarkersCaches.clear();
}
if ( mLastPositions != null ) {
mLastPositions.clear();
}
sendMessage( MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_ADAS );
mLastPositions.clear();
sendMessage(MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_ADAS);
}
}

Some files were not shown because too many files have changed in this diff Show More