[6.9.0]OTA升级修改

This commit is contained in:
xuxinchao
2025-01-08 11:35:03 +08:00
parent dc59e75b90
commit a05f71526b
5 changed files with 30 additions and 17 deletions

View File

@@ -160,7 +160,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
taskId,taskItemId,otaType,productName,needRestart,isDelay,curSize,totalSize)
otaUpgradeList.add(otaUpgradeInfo)
}
CallerHmiManager.showOTADownloadStatusDialog(otaUpgradeList)
CallerHmiManager.showOTADownloadStatusDialog(true,otaUpgradeList)
if(upgradeComplete){
OTAUpgradeConfig.otaToken = ""
CallerOTAManager.invokeOtaDownloadStatus(false)
@@ -269,6 +269,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
OTAUpgradeConfig.isQuery = false
}else{
if(!OTAUpgradeConfig.upgradeFinish.contains(status.otaInfo.otaToken)){
CallerHmiManager.showOTADownloadStatusDialog(true,otaUpgradeList)
CallerHmiManager.showOTAResultDialog(upgradeResult)
OTAUpgradeConfig.upgradeFinish.add(status.otaInfo.otaToken)
}
@@ -278,7 +279,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
//通知关闭提示升级窗口存在域控也在进行5min倒计时与app存在时间差域控会更早完成倒计时触发升级
// 此时通知app开始升级app收到后即使未完成倒计时也关闭提示弹窗开始展示下载进展
CallerHmiManager.showOTAUpgradeDialog(false)
CallerHmiManager.showOTADownloadStatusDialog(otaUpgradeList)
CallerHmiManager.showOTADownloadStatusDialog(true,otaUpgradeList)
CallerOTAManager.invokeOtaDownloadStatus(true)
}
}

View File

@@ -691,19 +691,26 @@ class MoGoHmiProvider : IMoGoHmiProvider {
/**
* 展示OTA升级下载状态弹窗
*/
override fun showOTADownloadStatusDialog(list: List<OtaUpgradeInfo>) {
override fun showOTADownloadStatusDialog(isShow: Boolean,list: List<OtaUpgradeInfo>) {
ThreadUtils.runOnUiThread{
if(otaDownloadStatusDialog?.isShowing == true){
otaDownloadStatusDialog?.notifyDownloadStatus(list)
return@runOnUiThread
}
context?.let {
if(otaDownloadStatusDialog == null){
otaDownloadStatusDialog = OTADownloadStatusDialog(it)
if(isShow){
if(otaDownloadStatusDialog?.isShowing == true){
otaDownloadStatusDialog?.notifyDownloadStatus(list)
return@runOnUiThread
}
context?.let {
if(otaDownloadStatusDialog == null){
otaDownloadStatusDialog = OTADownloadStatusDialog(it)
}
otaDownloadStatusDialog?.show()
otaDownloadStatusDialog?.notifyDownloadStatus(list)
}
}else{
if(otaDownloadStatusDialog?.isShowing == true){
otaDownloadStatusDialog?.dismiss()
}
otaDownloadStatusDialog?.show()
otaDownloadStatusDialog?.notifyDownloadStatus(list)
}
}
}

View File

@@ -2,11 +2,14 @@ package com.mogo.eagle.core.function.hmi.ui.tools
import android.content.Context
import android.os.CountDownTimer
import android.util.Log
import androidx.annotation.UiThread
import androidx.lifecycle.LifecycleObserver
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.zhjt.mogo_core_function_devatools.ota.OTAUpgradeConfig
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tv_upgrade_later
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tv_upgrade_now
@@ -50,9 +53,11 @@ class OTAUpgradeDialog(context: Context) :
override fun onFinish() {
//立即升级
CallerAutoPilotControlManager.sendSsmFuncOtaDownloadResponse(OTAUpgradeConfig.otaToken,SsmInfo.IfUpgrade.IMMEDIATELY)
ThreadUtils.runOnUiThread {
UiThreadHandler.postDelayed({
CallerAutoPilotControlManager.sendSsmFuncOtaStatusQuery(OTAUpgradeConfig.otaToken)
dismiss()
}
},2000
)
}
}

View File

@@ -333,7 +333,7 @@ interface IMoGoHmiProvider :IProvider{
/**
* 展示OTA升级下载状态弹窗
*/
fun showOTADownloadStatusDialog(list: List<OtaUpgradeInfo>)
fun showOTADownloadStatusDialog(isShow: Boolean,list: List<OtaUpgradeInfo>)
/**
* 展示OTA升级结果弹窗

View File

@@ -483,8 +483,8 @@ object CallerHmiManager {
/**
* 展示OTA升级下载状态弹窗
*/
fun showOTADownloadStatusDialog(list: List<OtaUpgradeInfo>){
hmiProviderApi?.showOTADownloadStatusDialog(list)
fun showOTADownloadStatusDialog(isShow: Boolean,list: List<OtaUpgradeInfo>){
hmiProviderApi?.showOTADownloadStatusDialog(isShow,list)
}