[code_opt_3.3.0]merge 3.2.0

This commit is contained in:
zhongchao
2023-05-30 16:57:31 +08:00
112 changed files with 1862 additions and 570 deletions

View File

@@ -25,7 +25,11 @@ object CallerAutopilotCarConfigListenerManager : CallerBase<IMoGoAutopilotCarCon
mCarConfigResp = carConfigResp
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotCarConfig(carConfigResp)
try {
listener.onAutopilotCarConfig(carConfigResp)
} catch (t: Throwable) {
t.printStackTrace()
}
}
}

View File

@@ -6,10 +6,25 @@ import com.mogo.eagle.core.function.call.base.CallerBase
object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
@Volatile
private var token: String? = null
@Volatile
private var sn: String? = null
override fun doSomeAfterAddListener(tag: String, listener: IMoGoCloudListener) {
super.doSomeAfterAddListener(tag, listener)
if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) {
listener.tokenGot(token!!, sn!!)
}
}
/**
* 分发获取到的设备sn
*/
fun invokeCloudTokenGot(token: String, sn: String) {
this.token = token
this.sn = sn
M_LISTENERS.forEach {
val listener = it.value
listener.tokenGot(token, sn)

View File

@@ -1,21 +1,32 @@
package com.mogo.eagle.core.function.call.telematic
import android.util.Log
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerTelematicListenerManager: CallerBase<IReceivedMsgListener>() {
private const val TAG = "CallerTelematicListenerManager"
fun invokeReceivedMsg(type: Int, byteArray: ByteArray) {
M_LISTENERS.forEach {
val listener = it.value
listener.onReceivedMsg(type, byteArray)
try {
listener.onReceivedMsg(type, byteArray)
} catch (e: Exception) {
Log.e(TAG, "转发消息出现异常:${e.message}")
}
}
}
fun dispatchServerSn(sn: String?) {
M_LISTENERS.forEach {
val listener = it.value
listener.onReceivedServerSn(sn)
try {
listener.onReceivedServerSn(sn)
} catch (e: Exception) {
Log.e(TAG, "转发司机屏SN出现异常${e.message}")
}
}
}
}