[6.9.0]OTA升级修改
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user