From 095c926fb6fe7d3b263c3cd388b0d6874b0db08c Mon Sep 17 00:00:00 2001 From: zhongchao Date: Fri, 2 Dec 2022 19:13:24 +0800 Subject: [PATCH] [2.13.0]fix bug of netty status of view and close the spi real time --- .../mogo/launcher/stageone/HttpDnsStartUp.kt | 22 +++++++++---------- .../hmi/ui/setting/DebugSettingView.kt | 15 +++++++++++++ .../com/mogo/commons/module/MogoServices.java | 12 +++++----- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt index 818fe0ddfb..794e9ef28b 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt @@ -79,7 +79,6 @@ class HttpDnsStartUp : AndroidStartup() { if (ProcessUtils.isMainProcess(context)) { initGDLoc() initHttpDns() - initCloudClientConfig() } return true } @@ -110,8 +109,10 @@ class HttpDnsStartUp : AndroidStartup() { DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE // 设置是否输出日志 clientConfig.isShowDebugLog = true + // 使用中台长链接 + clientConfig.isUseOriginSocket = true // 设置是否输出网络日志 - clientConfig.isShowNetDebugLog = true //todo test em arrow + clientConfig.isShowNetDebugLog = false // 设置是否是直播推流的主播 clientConfig.isAnchor = true when (DebugConfig.getCarMachineType()) { @@ -203,7 +204,10 @@ class HttpDnsStartUp : AndroidStartup() { clientConfig.token = token // 由于存在token过期问题,在更新后会回调至此处,增加二次判定 if (!gotToken) { - CallerLogger.d(SceneConstant.M_MAIN + TAG, "onTokenGot token : $token , sn :$sn") + CallerLogger.d( + SceneConstant.M_MAIN + TAG, + "onTokenGot token : $token , sn :$sn" + ) CallerCloudListenerManager.invokeCloudTokenGot(token, sn) // 异步初始化NetConfig asyncInit() @@ -313,7 +317,7 @@ class HttpDnsStartUp : AndroidStartup() { ) override fun onConnectFailure() { CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectFailure") - MogoStatusManager.getInstance().setCloudSocketMode(TAG,false) + MogoStatusManager.getInstance().setCloudSocketMode(TAG, false) } @ChainLog( @@ -326,7 +330,7 @@ class HttpDnsStartUp : AndroidStartup() { ) override fun onConnectSuccess() { CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectSuccess") - MogoStatusManager.getInstance().setCloudSocketMode(TAG,true) + MogoStatusManager.getInstance().setCloudSocketMode(TAG, true) } @ChainLog( @@ -339,7 +343,7 @@ class HttpDnsStartUp : AndroidStartup() { ) override fun onConnectLost() { CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectLost") - MogoStatusManager.getInstance().setCloudSocketMode(TAG,false) + MogoStatusManager.getInstance().setCloudSocketMode(TAG, false) } @ChainLog( @@ -364,10 +368,4 @@ class HttpDnsStartUp : AndroidStartup() { .init(context, DebugConfig.getSocketAppId(), lat, lon) } - private fun initCloudClientConfig() { - // 使用旧Socket链路 true = 旧链路,false = 新链路 - if (DebugConfig.getProductFlavor() == "fPadLenovoOchTaxi" || DebugConfig.getProductFlavor() == "fPadLenovoOchBus" || DebugConfig.getProductFlavor() == "fPadLenovoOchTaxiPassenger" || DebugConfig.getProductFlavor() == "fPadLenovoOchBusPassenger") { - clientConfig.isUseOriginSocket = true - } - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 97e1d9d86e..32207c1d81 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -78,6 +78,7 @@ import com.mogo.map.MogoMapUIController import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.map.uicontroller.VisualAngleMode.* import com.mogo.eagle.core.function.business.routeoverlay.* +import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager import com.mogo.eagle.core.function.v2x.vip.VipCarManager import com.zhidao.easysocket.utils.L import com.zhidao.support.adas.high.other.permission.BackgrounderPermission @@ -1651,6 +1652,20 @@ class DebugSettingView @JvmOverloads constructor( */ @SuppressLint("SetTextI18n") private fun drawAppInfo() { + when { + AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端 + AppConfigInfo.isDriver = true + AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted() + } + AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> { + AppConfigInfo.isDriver = false + AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus() + AppConfigInfo.serverSn = CallerTelematicManager.getServerToken() + } + else -> { + } + } + /** * 设备绑定关系 */ diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java index 017b3c747e..5926f0af9d 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java @@ -58,9 +58,9 @@ public class MogoServices implements IMogoIntentListener { intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); mContext.sendBroadcast(intent); - if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { - MoGoAiCloudRealTime.startRealTime(mContext, DebugConfig.getSocketAppId()); - } +// if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { +// MoGoAiCloudRealTime.startRealTime(mContext, DebugConfig.getSocketAppId()); +// } } private void registerMogoReceiver(Context context) { @@ -105,9 +105,9 @@ public class MogoServices implements IMogoIntentListener { public void destroy() { CallerLogger.INSTANCE.d(M_OLD_OTHER + TAG, "MogoServices do nothings."); - if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { - MoGoAiCloudRealTime.stopRealTime(); - } +// if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { +// MoGoAiCloudRealTime.stopRealTime(); +// } } }