[6.1.0]M1平行驾驶状态下弱网提示改为提示音提示并且不展示提示接管动画

This commit is contained in:
xuxinchao
2023-09-26 19:39:56 +08:00
parent 7667272d59
commit 3f228e70a1
3 changed files with 174 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.hmi.ui.vehicle
import android.content.Context
import android.os.CountDownTimer
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
@@ -18,6 +19,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.SoundPoolUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.zhjt.mogo.adas.data.bean.MogoReport
import mogo.yycp.paralleldriving.protocol.ParallelTaskProcessNoticeOuterClass
@@ -111,36 +114,65 @@ class TakeOverView @JvmOverloads constructor(
MogoReport.Code.Error.EPARALLEL.AICLOUD_CONNECTION_ERROR -> {
//如果是平行驾驶状态下,提示弱网接管
if(isParallel){
CallerHmiManager.warningV2X(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOver = true
ThreadUtils.runOnUiThread{
visibility = View.VISIBLE
}
//加入消息盒子
saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X, V2XMsg(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
)
)
if(AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)){
//M1仅做提示音和消息盒子无语音播报和提示接管动画
//加入消息盒子
saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X, V2XMsg(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
)
)
)
//提示音播报
val countDownTimer = object : CountDownTimer(3000, 1000){
override fun onTick(p0: Long) {
try {
SoundPoolUtils.getSoundPool().playSoundWithRedId(context,R.raw.weak_net_tips)
}catch (e: Exception){
e.printStackTrace()
}
}
override fun onDismiss() {
takeOver = false
ThreadUtils.runOnUiThread{
visibility = View.GONE
override fun onFinish() {
}
}
countDownTimer.start()
}else{
CallerHmiManager.warningV2X(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOver = true
ThreadUtils.runOnUiThread{
visibility = View.VISIBLE
}
//加入消息盒子
saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X, V2XMsg(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
)
)
)
}
override fun onDismiss() {
takeOver = false
ThreadUtils.runOnUiThread{
visibility = View.GONE
}
}
}
}
,isFromObu = false)
,isFromObu = false)
}
}
}
}