[2.13.0]fix bug of netty status of view and close the spi real time

This commit is contained in:
zhongchao
2022-12-02 19:13:24 +08:00
parent 58fb2363f5
commit 095c926fb6
3 changed files with 31 additions and 18 deletions

View File

@@ -79,7 +79,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
if (ProcessUtils.isMainProcess(context)) {
initGDLoc()
initHttpDns()
initCloudClientConfig()
}
return true
}
@@ -110,8 +109,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
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<Boolean>() {
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<Boolean>() {
)
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<Boolean>() {
)
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<Boolean>() {
)
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<Boolean>() {
.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
}
}
}

View File

@@ -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 -> {
}
}
/**
* 设备绑定关系
*/

View File

@@ -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();
// }
}
}