From cb30cde82bcda88a9c4e0b5d030677080263c665 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Tue, 28 Sep 2021 18:00:33 +0800 Subject: [PATCH] opt --- .../function/obu/mogo/MogoPrivateObuManager.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt index 9be4f16934..1ce2a6af41 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt @@ -261,10 +261,16 @@ class MogoPrivateObuManager private constructor() { // 前方拥堵提醒 EventTypeEnum.TYPE_USECASE_ID_TJW.poiType -> { alertContent = EventTypeEnum.getWarningContent(appId) - ttsContent = String.format( - EventTypeEnum.getWarningTts(appId), - info.threat_info.distance.toInt() - ) + if (info.threat_info != null) { + if (info.threat_info.distance.toInt() != 0) { + ttsContent = String.format( + EventTypeEnum.getWarningTts(appId), + info.threat_info.distance.toInt() + ) + } else { + ttsContent = "前方道路拥堵,请减速慢行" + } + } } }