changed the getSn and visual func

This commit is contained in:
zhongchao
2021-05-27 21:13:36 +08:00
parent aecdc24636
commit 504fc47132
54 changed files with 216 additions and 192 deletions

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

@@ -53,6 +53,8 @@ public class MogoApplication extends AbsMogoApplication {
private static final String TAG = "MogoApplication";
private long start;
@Override
public void onCreate() {
initDebugConfig();
@@ -61,82 +63,12 @@ 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"));
// 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);
}
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
@@ -244,7 +176,7 @@ public class MogoApplication extends AbsMogoApplication {
clientConfig.setServiceAppId("com.mogo.launcher");
// 设置AI云平台分配给三方应用的签名密钥需要从AI云平台申请
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
clientConfig.setThirdPartyDeviceId(Utils.getSn());
clientConfig.setThirdPartyDeviceId(Utils.getDevicesId());
// 设置循环检测间隔时间
clientConfig.setLoopCheckDelay(15 * 1000);
@@ -273,13 +205,16 @@ public class MogoApplication extends AbsMogoApplication {
new IMoGoTokenCallback() {
@Override
public void onTokenGot(String token, String sn) {
// 初始化鹰眼HttpDns服务 todo 验证是否有问题
initMogoHttpDns();
// 鉴权成功后开启socket长链服务
prepareSocketAndLocationServices();
initModules();
}
@Override
public void onError(int code, String msg) {
Log.d(TAG,"初始化MogoAiCloudSdk failed ,reason : " + msg + " , 未能开启长链服务和初始化Modules服务");
}
}
);
@@ -297,6 +232,78 @@ public class MogoApplication extends AbsMogoApplication {
}
}
private void 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);
}
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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -64,8 +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() {
// return "X2020210526D3DC7BA891CE2D76";
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

@@ -480,7 +480,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
}

View File

@@ -383,7 +383,7 @@ public class AMapViewWrapper implements IMogoMapView,
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
}

View File

@@ -92,7 +92,7 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public void changeMapVisualAngle(VisualAngleMode angelMode) {
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
}

View File

@@ -53,5 +53,10 @@ mapAutoView.setOnMapViewVisualAngleChangeListener
修改近景切换
添加自动开启定位开关
修改桥模型
mapAutoView.getMapAutoViewHelper()?.setNearViewAnglePositionLonLatPoint(112.57392375608,26.830652231402))切换近视角
8.5.32
解决崩溃问题
8.5.33
更新顺义衡阳数

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;
@@ -375,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());
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());
}
}
}
@@ -912,7 +920,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onMapViewVisualAngleChange(int i) {
Logger.d(TAG," 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
Logger.d(TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
mVisualAngleMode = getVisualAngleMode(i);
MogoMapListenerHandler.getInstance().onMapVisualAngleChanged(mVisualAngleMode);
}

View File

@@ -87,9 +87,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

@@ -53,7 +53,7 @@ public interface IMogoMapUIController {
*
* @param angelMode {@link VisualAngleMode}
*/
void changeMapVisualAngle(VisualAngleMode angelMode);
void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng);
/**
* 获得当前地图视距模式

View File

@@ -92,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

@@ -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

@@ -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

@@ -1371,11 +1371,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
if (MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getCurrentMapVisualAngle().isLongSight()) {
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoApisHandler.getInstance().getApis().getMapServiceApi()
.getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT);
.getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT,null);
} else if (MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getCurrentMapVisualAngle().isMediumSight()) {
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).inVisibleAllMarkers();
MogoApisHandler.getInstance().getApis().getMapServiceApi()
.getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT);
.getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT,null);
}
}

View File

@@ -7,6 +7,7 @@ import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.network.Utils;
@@ -134,7 +135,7 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
public void getCommonConfig() {
Map<String, Object> params = new ArrayMap<>();
params.put("sn", Utils.getSn());
params.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
mNetWork.create(GetConfigApiServices.class, HostConst.DATA_SERVICE_HOST)
.getConfig(params)
.subscribeOn(Schedulers.io())
@@ -184,7 +185,7 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
public void requestUserInfo() {
Map<String, String> params = new ArrayMap<>();
params.put("sn", Utils.getSn());
params.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
params.put("source", "2");
String sign = createSign(params, "JGqZw9");
params.put("sig", sign);

View File

@@ -5,6 +5,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
@@ -118,7 +119,7 @@ public class DelayCheckUtil implements Handler.Callback {
}
Logger.d(TAG, "lastLocation: " + lastLocation);
DelayCheckUploadRequest request = new DelayCheckUploadRequest();
request.setSn(Utils.getSn());
request.setSn(MoGoAiCloudClientConfig.getInstance().getSn());
request.setStartTime(requestStartSystemTime);
request.setEndTime(requestEndSystem);
request.setNetState(NetworkUtils.netStrengthLevel);

View File

@@ -7,6 +7,7 @@ import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.network.SubscribeImpl;
@@ -404,7 +405,7 @@ class LauncherCardRefresher {
.addType( LauncherCardRefreshType.News.getVal() )
.addType( LauncherCardRefreshType.ExplorerWay.getVal() )
.addType( LauncherCardRefreshType.Weather.getVal() )
.sn( Utils.getSn() )
.sn( MoGoAiCloudClientConfig.getInstance().getSn() )
.cityCode( location.getCityCode() )
.cityName( location.getCityName() )
.location( new MogoLatLng( location.getLatitude(), location.getLongitude() ) );

View File

@@ -3,6 +3,7 @@ package com.mogo.module.service.network;
import android.content.Context;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.ParamsProvider;
@@ -158,7 +159,7 @@ public class RefreshModel {
if ( mRefreshApiService != null ) {
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
final RefreshBody refreshBody = new RefreshBody();
refreshBody.sn = Utils.getSn();
refreshBody.sn = MoGoAiCloudClientConfig.getInstance().getSn();
if ( limit > 0 ) {
refreshBody.limit = limit;
}

View File

@@ -7,6 +7,7 @@ import android.os.Message;
import androidx.annotation.RequiresApi;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.cloud.socket.entity.SocketDownData;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
@@ -150,7 +151,7 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
}
MockSocketSendData mockSocketSendData = new MockSocketSendData(System.currentTimeMillis(), result.getUuid(), result.getSatelliteTime());
Map<String, Object> map = new HashMap<>();
map.put("sn", Utils.getSn());
map.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
map.put("data", GsonUtil.jsonFromObject(mockSocketSendData));
Logger.d(TAG, "mockSocketSendData : " + GsonUtil.jsonFromObject(mockSocketSendData));
Logger.d(TAG, "data uuid : " + result.getUuid() + " duration : " + (System.currentTimeMillis() - result.getSatelliteTime()));

View File

@@ -9,6 +9,7 @@ import android.util.ArrayMap;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.map.location.MogoLocation;
@@ -456,7 +457,7 @@ public class ShareControl implements IMogoShareManager, Handler.Callback {
if (NetworkUtils.isConnected(mContext) && location != null && !location.getAdCode().isEmpty()) {
// 有网且有adcode直接请求
Map<String, String> params = new ArrayMap<>();
ShareConfigRequest request = new ShareConfigRequest(Utils.getSn(),
ShareConfigRequest request = new ShareConfigRequest(MoGoAiCloudClientConfig.getInstance().getSn(),
location.getAdCode());
params.put("data", request.toJson());
ServiceApisManager.serviceApis.getNetworkApi().create(ShareDevaApiService.class,

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.os.SystemClock
import android.util.ArrayMap
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.analytics.AnalyticsUtils
import com.mogo.commons.data.BaseData
import com.mogo.commons.network.SubscribeImpl
@@ -157,7 +158,7 @@ object SeekHelpManager {
private fun realSeekHelp(from:String) {
Logger.d(TAG, "realSeekHelp")
// 请求故障求助接口
val seekRequest = SeekRequest(Utils.getSn())
val seekRequest = SeekRequest(MoGoAiCloudClientConfig.getInstance().getSn())
val param = mutableMapOf("data" to seekRequest.getJson())
val properties: MutableMap<String, Any> = ArrayMap()
@@ -221,7 +222,7 @@ object SeekHelpManager {
}
fun debugCancelSeek() {
val seekRequest = SeekRequest(Utils.getSn(), 0)
val seekRequest = SeekRequest(MoGoAiCloudClientConfig.getInstance().getSn(), 0)
val param = mutableMapOf("data" to seekRequest.getJson())
ServiceApisManager.serviceApis.networkApi.create(ShareRtlApiService::class.java, HostConst.REALTIME_LOCATION_HOST).sendHelpSignal(param).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(object : SubscribeImpl<BaseData>(RequestOptions.create(context)) {
override fun onSuccess(o: BaseData?) {

View File

@@ -132,7 +132,7 @@ public class TanluModelData {
// }
//
// Map<String, Object> params = new ParamsProvider.Builder(mContext)
// .append("sn", Utils.getSn())
// .append("sn", MoGoAiCloudClientConfig.getInstance().getSn())
// .append("data", GsonUtil.jsonFromObject(request))
// .build();
//
@@ -194,7 +194,7 @@ public class TanluModelData {
// }
//
// Map<String, Object> params = new ParamsProvider.Builder(mContext)
// .append("sn", Utils.getSn())
// .append("sn", MoGoAiCloudClientConfig.getInstance().getSn()))
// .append("data", GsonUtil.jsonFromObject(request))
// .build();
// return mShareApiService.queryRoadInfos(params);

View File

@@ -1,6 +1,7 @@
package com.mogo.module.share.net;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.ParamsProvider;
@@ -43,7 +44,7 @@ public class TrafficModelData {
final ParamsProvider.Builder builder = new ParamsProvider.Builder( getApp().getApplicationContext());
Map<String, Object> parameters = builder.build();
parameters.put("sn", Utils.getSn());
parameters.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
parameters.put("data",GsonUtil.jsonFromObject(uploadTrafficEntity));
mTrafficApiService.UploadCongestionInfo(parameters)
.subscribeOn(Schedulers.io())

View File

@@ -248,7 +248,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
// val params = ArrayMap<String, Any>()
// params["speed"] = average.toInt()
// val body = RequestBody.create(MediaType.parse("Content-type:application/json;charset=UTF-8"), GsonUtil.jsonFromObject(params))
// apis.networkApi.create(ShareApiService::class.java, HttpConstant.getNetHost()).sendAverageSpeedForBlockStrategy(body, Utils.getSn()).subscribeOn(Schedulers.io()).subscribe(object : SubscribeImpl<AverateSpeedResponse>(RequestOptions.create(context)) {
// apis.networkApi.create(ShareApiService::class.java, HttpConstant.getNetHost()).sendAverageSpeedForBlockStrategy(body, MoGoAiCloudClientConfig.getInstance().getSn()).subscribeOn(Schedulers.io()).subscribe(object : SubscribeImpl<AverateSpeedResponse>(RequestOptions.create(context)) {
// override fun onSuccess(response: AverateSpeedResponse?) {
// super.onSuccess(response)
// response?.let {

View File

@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
import com.mogo.map.MogoLatLng;
import com.mogo.map.listener.IMogoMapListener;
@@ -149,7 +150,7 @@ public class V2XModuleProvider implements
// obu数据转发初始化
V2XObuManager.getInstance().init(context);
if (V2XServiceManager.getMoGoStatusManager().isTopContainerReady()) {
V2XServiceManager.getV2XRefreshModel().queryRoadData(Utils.getSn());
V2XServiceManager.getV2XRefreshModel().queryRoadData(MoGoAiCloudClientConfig.getInstance().getSn());
}
}
@@ -334,7 +335,7 @@ public class V2XModuleProvider implements
FatigueDrivingUtils.refreshAccOnTime();
initCarForHelpStatus();
if (V2XServiceManager.getMoGoStatusManager().isTopContainerReady()) {
V2XServiceManager.getV2XRefreshModel().queryRoadData(Utils.getSn());
V2XServiceManager.getV2XRefreshModel().queryRoadData(MoGoAiCloudClientConfig.getInstance().getSn());
}
} else {
// 记录关机时间
@@ -345,7 +346,7 @@ public class V2XModuleProvider implements
refreshMeSeekHelp(isTrue);
}else if (descriptor == StatusDescriptor.TOP_CONTAINER_READY) {
if (isTrue) {
V2XServiceManager.getV2XRefreshModel().queryRoadData(Utils.getSn());
V2XServiceManager.getV2XRefreshModel().queryRoadData(MoGoAiCloudClientConfig.getInstance().getSn());
}
}

View File

@@ -7,6 +7,7 @@ import android.text.TextUtils;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.ParamsProvider;
@@ -357,7 +358,7 @@ public class V2XRefreshModel {
final Map<String, Object> map = new ParamsProvider.Builder(mContext).build();
String json = new StringBuilder()
.append("{")
.append("\"sn\":").append(Utils.getSn())
.append("\"sn\":").append(MoGoAiCloudClientConfig.getInstance().getSn())
.append(",")
.append("\"vehicleType\":")
.append(0)
@@ -394,7 +395,7 @@ public class V2XRefreshModel {
*/
public void getHelpSignal(V2XRefreshCallback<V2XSeekHelpRes> callback) {
final Map<String, Object> map = new ParamsProvider.Builder(mContext).build();
map.put("sn", Utils.getSn());
map.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
V2XApiServiceFactory.getRealtimeLocationApiService(mContext).queryHelpSignal(map).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<V2XSeekHelpRes>(RequestOptions.create(mContext)) {
@@ -525,7 +526,7 @@ public class V2XRefreshModel {
.append(",")
.append("\"likeOrdislike\":").append(likeOrDislike)
.append(",")
.append("\"sn\":").append(Utils.getSn())
.append("\"sn\":").append(MoGoAiCloudClientConfig.getInstance().getSn())
.append("}").toString();
map.put("data", json);
V2XApiServiceFactory.getDevaApiService(mContext).addPoiInfoFabulous(map).subscribeOn(Schedulers.io())
@@ -563,7 +564,7 @@ public class V2XRefreshModel {
.append("{")
.append("\"seekHelpSn\":").append(seekHelpSn)
.append(",")
.append("\"enthusiasticSn\":").append(Utils.getSn())
.append("\"enthusiasticSn\":").append(MoGoAiCloudClientConfig.getInstance().getSn())
.append("}").toString();
map.put("data", json);
V2XApiServiceFactory.getDevaApiService(mContext).respondingToHelp(map).subscribeOn(Schedulers.io())
@@ -591,7 +592,7 @@ public class V2XRefreshModel {
int status,
String helpId) {
final Map<String, Object> map = new ParamsProvider.Builder(mContext).build();
String json = "{" + "\"id\":\"" + id + "\"," + "\"sn\":\"" + Utils.getSn() + "\"," + "\"status\":" + status + "," + "\"helpId\":\"" + helpId + "\"}";
String json = "{" + "\"id\":\"" + id + "\"," + "\"sn\":\"" + MoGoAiCloudClientConfig.getInstance().getSn() + "\"," + "\"status\":" + status + "," + "\"helpId\":\"" + helpId + "\"}";
map.put("data", json);
V2XApiServiceFactory.getDevaApiService(mContext).manualMarkingTrafficJam(map).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
@@ -617,7 +618,7 @@ public class V2XRefreshModel {
String tmpLon = String.valueOf(lon);
float bearing = lastKnowLocation.getBearing();
String json = "{\"lat\":" + tmpLat + ",\"lon\":" + tmpLon + ",\"direction\":" + bearing + "}";
map.put("sn", Utils.getSn());
map.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
map.put("data", json);
V2XApiServiceFactory.getGeoFenceCarServiceApiService(mContext).queryCrossRoadsLive(map)
.subscribeOn(Schedulers.io())

View File

@@ -2,6 +2,7 @@ package com.mogo.module.v2x.network;
import android.content.Context;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.network.SubscribeImpl;
@@ -99,7 +100,7 @@ public class V2XShareNetworkModel {
public void getShareIndex(V2XRefreshCallback callback) {
final ParamsProvider.Builder builder = new ParamsProvider.Builder(mContext);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("sn", Utils.getSn());
hashMap.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
builder.append("data", GsonUtil.jsonFromObject(hashMap));
Map<String, Object> parameters = builder.build();
//热心指数
@@ -141,7 +142,7 @@ public class V2XShareNetworkModel {
final ParamsProvider.Builder builder = new ParamsProvider.Builder(mContext);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("sn", Utils.getSn());
hashMap.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
hashMap.put("pageNum", page);
hashMap.put("pageSize", size);
builder.append("data", GsonUtil.jsonFromObject(hashMap));

View File

@@ -8,6 +8,7 @@ import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
@@ -63,7 +64,7 @@ public class SurroundingEventPresenter extends Presenter<SurroundingEventView> {
String[] poiTypes = {"10002", "10003", "10006", "10007", "10008", "10010", "10011", "10013", "10015"};
SurroundingRequest request = new SurroundingRequest(center, poiTypes, 5, 300);
V2XApiServiceFactory.getDevaApiService(mContext).getSurroundingEventList(Utils.getSn(), convert(GsonUtil.jsonFromObject(request)))
V2XApiServiceFactory.getDevaApiService(mContext).getSurroundingEventList(MoGoAiCloudClientConfig.getInstance().getSn(), convert(GsonUtil.jsonFromObject(request)))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<SurroundingResponse>(RequestOptions.create(getContext())) {

View File

@@ -6,6 +6,7 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.map.MogoLatLng;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XMessageEntity;
@@ -160,14 +161,7 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
} else if (sceneType == 18) { //test visualAngle UI
V2XServiceManager.getMapService().getMarkerManager(mContext).inVisibleAllMarkers();
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT);
} else if (sceneType == 19) { //test visualAngle UI
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT);
} else if (sceneType == 20) { //test visualAngle UI
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_CLOSE_SIGHT);
} else if (sceneType == 21) {// 自车求助
} else if (sceneType == 18) {// 自车求助
V2XMessageEntity<Boolean> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioCarForHelpEventData();
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);

View File

@@ -148,7 +148,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
private void sceneChange() {
if (MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().
getCurrentMapVisualAngle() != VisualAngleMode.MODE_MEDIUM_SIGHT) {
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT);
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT,null);
}
}

View File

@@ -38,7 +38,7 @@ import static com.mogo.service.statusmanager.StatusDescriptor.MAIN_PAGE_RESUME;
* author : unknown
* desc : 语音呼叫查看直播车辆 或者 路口实况 业务模块
*/
public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener{
public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener {
private static final String REGISTER_LIFECYCLE_TAG = "V2XVoiceCallLiveBiz";
@@ -88,22 +88,23 @@ public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener{
/**
* 地图上静态marker点击现在仅点击摄像头
*
* @param marker
* @return
*/
@Override
public boolean onStaticMarkerClicked(IMogoMarker marker) {
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker");
if(V2XServiceManager.getMapService().getMapUIController().getCurrentMapVisualAngle().isLongSight()){
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker is on LongSight, so don't response");
Log.d(REGISTER_LIFECYCLE_TAG, "onStaticMarkerClicked marker");
if (V2XServiceManager.getMapService().getMapUIController().getCurrentMapVisualAngle().isLongSight()) {
Log.d(REGISTER_LIFECYCLE_TAG, "onStaticMarkerClicked marker is on LongSight, so don't response");
return false;
}
//拉近地图视角为近景
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_CLOSE_SIGHT);
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_CLOSE_SIGHT, marker.getPosition());
//移动地图中心点至marker位置
V2XServiceManager.getMapService().getMapUIController().moveToCenter(marker.getPosition(),true);
V2XServiceManager.getMapService().getMapUIController().moveToCenter(marker.getPosition(), true);
String assInfo = marker.getMarkerAssInfo();
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker assInfo : " + assInfo);
Log.d(REGISTER_LIFECYCLE_TAG, "onStaticMarkerClicked marker assInfo : " + assInfo);
if (TextUtils.isEmpty(assInfo) || !assInfo.contains(MAP_STATIC_TRAFFIC)) {
return false;
} else {
@@ -177,6 +178,7 @@ public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener{
/**
* 获取特定路口摄像头直播
*
* @param assInfo 路口摄像头Id
*/
private void getSpecifiedOpenCameraLive(String assInfo) {
@@ -221,7 +223,7 @@ public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener{
return v2XMessageEntity;
}
public void onDestroy(){
public void onDestroy() {
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoStaticMarkerClickListener(MAP_STATIC, this);
}
}

View File

@@ -1,5 +1,6 @@
package com.mogo.module.v2x.utils;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerUserInfo;
@@ -65,7 +66,7 @@ public class ChartingUtil {
*/
public static void isOnLine(String sn, ChartStatusListener chartStatusListener) {
try {
String isMe = Utils.getSn();
String isMe = MoGoAiCloudClientConfig.getInstance().getSn();
if (isMe.equals(sn)) {
Logger.d("", "是我的分享");
if (chartStatusListener != null) {

View File

@@ -11,6 +11,7 @@ import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.SubscribeImpl;
@@ -319,7 +320,7 @@ public class MogoADASController implements IMogoADASController {
super.onServiceConnected();
Logger.d( TAG, "adas statuslistener connected & send sn");
BasicInfo info=new BasicInfo();
info.setSn(Utils.getSn()+"xavier");
info.setSn(MoGoAiCloudClientConfig.getInstance().getSn()+"xavier");
AdasManager.getInstance().setBasicInfo(info);
invokeShowADASOperation();
}
@@ -672,8 +673,8 @@ public class MogoADASController implements IMogoADASController {
private void requestCarModelList() {
Map<String, String> params = new HashMap<>(8);
params.put("sn", Utils.getSn());
// currentSn = useTestSn ? TEST_SN : Utils.getSn();
params.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
// currentSn = useTestSn ? TEST_SN : MoGoAiCloudClientConfig.getInstance().getSn();
// params.put("sn", currentSn);
SingletonsHolder.get(IMogoNetwork.class).create(CarModelInfoNetApiServices.class, CarModelInfoNetApiServices.getBaseUrl()).

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.text.TextUtils;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.ITestCrashReportProvider;
@@ -34,7 +35,7 @@ class BuglyCrashReportProvider implements ITestCrashReportProvider {
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy( context );
strategy.setUploadProcess( processName == null || processName.equals( packageName ) );
CrashReport.initCrashReport( context, "f3f8b0b2f1", true, strategy );
CrashReport.putUserData( context, "serial", Utils.getSn() );
CrashReport.putUserData( context, "serial", MoGoAiCloudClientConfig.getInstance().getSn() );
}
/**

View File

@@ -5,6 +5,7 @@ import android.text.TextUtils;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
import com.mogo.utils.logger.Logger;
import com.tencent.bugly.Bugly;
@@ -37,7 +38,7 @@ public class UpgradeReportProvider implements IProvider {
strategy.setUploadProcess(processName == null || processName.equals(packageName));
CrashReport.putUserData(context, "serial", Utils.getSn());
CrashReport.putUserData(context, "serial", MoGoAiCloudClientConfig.getInstance().getSn());
Bugly.init(context, "f3f8b0b2f1", true, strategy);
}