From f60830ff015a9e1cb3f22daf7967f95cf953e51b Mon Sep 17 00:00:00 2001 From: zhongchao Date: Wed, 28 Sep 2022 18:35:35 +0800 Subject: [PATCH] fix bug of add listener data updatw --- .../autopilot/CallerAutopilotCarConfigListenerManager.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarConfigListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarConfigListenerManager.kt index 3cd9fa116d..c36746ed14 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarConfigListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarConfigListenerManager.kt @@ -11,6 +11,8 @@ import java.util.concurrent.ConcurrentHashMap */ object CallerAutopilotCarConfigListenerManager : CallerBase() { + private var mCarConfigResp: MessagePad.CarConfigResp?= null + // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 private val M_AUTOPILOT_CAR_CONFIG_LISTENERS: ConcurrentHashMap = ConcurrentHashMap() @@ -28,6 +30,10 @@ object CallerAutopilotCarConfigListenerManager : CallerBase() { return } M_AUTOPILOT_CAR_CONFIG_LISTENERS[tag] = listener + + mCarConfigResp?.let { + listener.onAutopilotCarConfig(it) + } } /** @@ -59,6 +65,7 @@ object CallerAutopilotCarConfigListenerManager : CallerBase() { */ @Synchronized fun invokeAutopilotCarConfigData(carConfigResp: MessagePad.CarConfigResp) { + mCarConfigResp = carConfigResp M_AUTOPILOT_CAR_CONFIG_LISTENERS.forEach { val listener = it.value listener.onAutopilotCarConfig(carConfigResp)