[6.9.0]OTA升级修改
This commit is contained in:
@@ -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