[8.1.0_new_ota]OTA2.0增加超时查询
This commit is contained in:
@@ -46,6 +46,8 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
private var responseTimeoutNum: Int = 0 //响应超时次数
|
||||
private var shouldShowColdStartWindow: Boolean = false //是否需要展示冷启动页面
|
||||
|
||||
private var versionTwoTimeoutNum: Int = 0 //OTA2.0版本响应超时次数
|
||||
|
||||
private val handler =object : Handler(Looper.getMainLooper()){
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
@@ -68,6 +70,24 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
//司机屏弹窗提示用车人执行车辆下电操作
|
||||
CallerHmiManager.showOTAPowerOffFinishDialog()
|
||||
shouldShowColdStartWindow = true
|
||||
}else if(msg.what == 3){
|
||||
//OTA2.0超时查询
|
||||
if(versionTwoTimeoutNum<40){
|
||||
versionTwoTimeoutNum++
|
||||
//30秒没有收到OTA升级推送主动进行查询
|
||||
Log.i(TAG,"30秒没有收到OTA升级推送主动进行查询")
|
||||
//查询OTA升级
|
||||
val query = JSONObject()
|
||||
query.put("cmd","PAD_QUERY_UPGRADE_STATUS")
|
||||
query.put("token",OTAUpgradeConfig.token)
|
||||
Log.i("xuxinchao",query.toString())
|
||||
CallerAutoPilotControlManager.sendOtaPadMsgQuery(query.toString())
|
||||
this.sendEmptyMessageDelayed(3,30000)
|
||||
}else{
|
||||
Log.i(TAG,"20分钟没有收到OTA升级推送置为失败")
|
||||
CallerHmiManager.showOTADownloadStatusDialog(false, emptyList())
|
||||
CallerHmiManager.showOTAResultDialog(isShow = true, result = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -458,15 +478,22 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
//升级中
|
||||
if(cmd == "PAD_UPGRADE_REPORT"){
|
||||
CallerHmiManager.showOTADownloadStatusDialog(true,otaUpgradeList)
|
||||
versionTwoTimeoutNum = 0
|
||||
handler.removeMessages(3)
|
||||
handler.sendEmptyMessageDelayed(3,30000)
|
||||
}
|
||||
//升级完成
|
||||
if(otaStatus == "fail"){
|
||||
CallerHmiManager.showOTADownloadStatusDialog(false,emptyList())
|
||||
CallerHmiManager.showOTAResultDialog(isShow = true, result = false)
|
||||
versionTwoTimeoutNum = 0
|
||||
handler.removeMessages(3)
|
||||
}
|
||||
if(otaStatus == "success"){
|
||||
CallerHmiManager.showOTADownloadStatusDialog(false,emptyList())
|
||||
CallerHmiManager.showOTAResultDialog(isShow = true, result = true)
|
||||
versionTwoTimeoutNum = 0
|
||||
handler.removeMessages(3)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
|
||||
|
||||
//查询OTA升级
|
||||
val query: JSONObject = JSONObject()
|
||||
val query = JSONObject()
|
||||
query.put("cmd","PAD_QUERY_UPGRADE_STATUS")
|
||||
query.put("token",OTAUpgradeConfig.token)
|
||||
Log.i("xuxinchao",query.toString())
|
||||
|
||||
Reference in New Issue
Block a user