[6.4.0][启自驾指引] 埋点添加desc参数

This commit is contained in:
renwj
2024-04-29 15:13:35 +08:00
parent 78119d6da8
commit d6e63863c7

View File

@@ -191,16 +191,29 @@ object StatusManager {
}?.takeIf {
it.isNotEmpty()
}?.also { l ->
l.filter { it.isException() }.takeIf { it.isNotEmpty() }?.also { ll ->
val result = runCatching {
MogoAnalyticUtils.track(
"vehicle_state_exp",
HashMap<String, Any>().also { itx ->
itx["data"] = ll.joinToString(",") { it.toString() }
})
}
if (result.isFailure) {
Logger.w(TAG, "error => ${result.exceptionOrNull()?.stackTraceToString() }")
l.filter { it.isException() }.also { ll ->
ThreadUtils.getIoPool().execute {
val result = runCatching {
MogoAnalyticUtils.track(
"vehicle_state_exp",
HashMap<String, Any>().also { itx ->
itx["desc"] = ll.joinToString(",") { item ->
when (item) {
is SteerStatus -> "方向盘"
is AcceleratorStatus -> "油门"
is BrakeStatus -> "刹车"
is DoubleFlashStatus -> "双闪"
is GearStatus -> "档位"
is RouteDownloadStatus -> if (item.state == RouteStart) "轨迹下载中" else "轨迹下载失败"
else -> "其它"
}
}
itx["data"] = GsonUtils.toJson(ll)
})
}
if (result.isFailure) {
Logger.w(TAG, "error => ${result.exceptionOrNull()?.stackTraceToString() }")
}
}
}
}?.forEachIndexed { index, status ->