[6.7.0][启自驾指引] 修改因其它原因导致启不了自驾的提示文案

This commit is contained in:
renwj
2024-10-23 18:17:28 +08:00
parent 180c9a8085
commit 3b30886816
4 changed files with 36 additions and 17 deletions

View File

@@ -15,6 +15,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_SO
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_OCH_TAXI_START_AUTOPILOT_MOFANG
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
import com.mogo.eagle.core.function.call.R
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
@@ -100,9 +101,11 @@ object CallerAutoPilotControlManager {
* 刹车: 1<<3
* 双闪: 1<<4
* 档位: 1<<5
* 轨迹下载: (下载中) 1<<6 (下载失败)1<<7
* 其它: 1<<6
* 轨迹下载: (下载中) 1<<7 下载失败1<<8
*/
val exceptionValue = CallerDevaToolsManager.getExceptionStatusBeforeLaunchAutopilot(source)
var isPlayTTS = true
if (exceptionValue != 0) {
if (isShowTip) {
val sb = StringBuilder("请检查车辆")
@@ -126,8 +129,12 @@ object CallerAutoPilotControlManager {
}
if ((exceptionValue and (1 shl 6)) != 0) {
if (!sb.contains("$")) {
sb.setLength(0)
sb.append("检测到除已知节点外的其它异常")
val reason = CallerDevaToolsManager.getExtra().getString(R.id.autopilot_start_error.toString())
if (!reason.isNullOrEmpty()) {
isPlayTTS = false
sb.setLength(0)
sb.append(reason)
}
}
}
if ((exceptionValue and (1 shl 7)) != 0 || ((exceptionValue and (1 shl 8)) != 0)) {
@@ -149,8 +156,10 @@ object CallerAutoPilotControlManager {
AppStateManager.currentActivity()?.also {
it.lifeCycleScope.launch {
ToastUtils.showShort(voiceText)
runCatching {
AIAssist.getInstance(it).speakTTSVoice(voiceText)
if (isPlayTTS) {
runCatching {
AIAssist.getInstance(it).speakTTSVoice(voiceText)
}
}
}
}

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.devatools
import android.app.Activity
import android.content.Context
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import com.mogo.eagle.core.data.EnvConfig
@@ -29,6 +30,8 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
object CallerDevaToolsManager {
private val args by lazy { Bundle() }
private val devaToolsProviderApi: IDevaToolsProvider?
get() = CallerBase.getApiInstance(
IDevaToolsProvider::class.java,
@@ -43,6 +46,10 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.checkMonitorDb()
}
fun getExtra(): Bundle {
return args
}
/**
* 检查上传崩溃日志
*/