fix bug of add listener data updatw
This commit is contained in:
@@ -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<String, IMoGoAutopilotCarConfigListener> =
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user