[6.9.0]OTA升级

This commit is contained in:
xuxinchao
2024-12-12 19:14:55 +08:00
parent 9d00f79ad9
commit 96a31f2981
16 changed files with 314 additions and 103 deletions

View File

@@ -7,5 +7,13 @@ object OTAUpgradeConfig {
@JvmField
var otaToken: String = ""
//冷启动是否完成(包括成功/失败),默认未完成
@JvmField
var coldStartCompleted: Boolean = false
//是否处于自驾状态(包含自驾和平行驾驶),默认不处于自驾状态
@JvmField
var autopilotStatus: Boolean = false
//是否有订单 true有订单 false没有订单
@JvmField
var inOrder: Boolean = false
}

View File

@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.ota
import android.content.Context
import android.util.Log
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.ota.OtaUpgradeInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.datacenter.IDataCenterBizListener
@@ -11,6 +12,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener
import com.mogo.eagle.core.function.call.devatools.CallerOTAManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import org.json.JSONArray
import org.json.JSONObject
import system_master.SsmInfo
@@ -23,11 +26,13 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
const val TAG = "OTAUpgradeManager"
fun init(context: Context){
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerDataCenterBizListener.addListener(TAG,this)
CallerOTAManager.addListener(TAG,this)
//查询OTA状态
CallerAutoPilotControlManager.sendSsmFuncOtaStatusQuery(OTAUpgradeConfig.otaToken)
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerDataCenterBizListener.addListener(TAG,this)
CallerOTAManager.addListener(TAG,this)
//查询OTA状态
CallerAutoPilotControlManager.sendSsmFuncOtaStatusQuery(OTAUpgradeConfig.otaToken)
}
}
/**
@@ -40,7 +45,15 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
*/
override fun onAutopilotStatusResponse(state: Int) {
super.onAutopilotStatusResponse(state)
if(state == 2 || state == 7){
if(!OTAUpgradeConfig.autopilotStatus){
OTAUpgradeConfig.autopilotStatus = true
}
}else{
if(OTAUpgradeConfig.autopilotStatus){
OTAUpgradeConfig.autopilotStatus = false
}
}
}
/**
@@ -49,7 +62,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
*/
override fun invokeOrderStatus(inOrder: Boolean) {
super.invokeOrderStatus(inOrder)
OTAUpgradeConfig.inOrder = inOrder
}
/**
@@ -63,8 +76,20 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
if(request.otaToken.isNotEmpty()){
if(OTAUpgradeConfig.otaToken != request.otaToken){
OTAUpgradeConfig.otaToken = request.otaToken
//触发升级提示
CallerHmiManager.showOTAUpgradeDialog()
//冷启动已完成(包括成功/失败),且驾驶状态为非自驾状态,且当前无订单进行强提示,否则为弱提示
if(OTAUpgradeConfig.coldStartCompleted && !OTAUpgradeConfig.autopilotStatus
&& !OTAUpgradeConfig.inOrder){
//触发强提示升级
CallerHmiManager.showOTAUpgradeDialog(true)
}else{
//触发弱提示升级
//冷启动未完成(进行中),或驾驶状态为自驾状态,或当前有订单,直接默认选择稍后升级,
// 并toast提示“收到车辆部署任务请在车辆空闲时发起升级”
CallerAutoPilotControlManager.sendSsmFuncOtaDownloadResponse(OTAUpgradeConfig.otaToken,SsmInfo.IfUpgrade.DELAY)
ToastUtils.showLong("收到车辆部署任务,请在车辆空闲时发起升级")
//展示OTA升级提示
CallerHmiManager.showOTAUpgradeTipView(true)
}
}else{
//展示OTA升级提示
CallerHmiManager.showOTAUpgradeTipView(true)
@@ -141,7 +166,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
if(OTAUpgradeConfig.otaToken != status.otaInfo.otaToken){
OTAUpgradeConfig.otaToken = status.otaInfo.otaToken
//触发升级提示
CallerHmiManager.showOTAUpgradeDialog()
CallerHmiManager.showOTAUpgradeDialog(true)
}else{
//展示OTA升级提示
CallerHmiManager.showOTAUpgradeTipView(true)
@@ -155,6 +180,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
val otaUpgradeList = ArrayList<OtaUpgradeInfo>()
val productArray = JSONArray(status.otaInfo.productName)
var upgradeComplete = true
var upgradeResult = true //升级结果 true代表成功 false代表失败 默认为升级成功
if(productArray.length() > 0){
for(index in 0 until productArray.length()){
val productInfo = productArray[index] as JSONObject
@@ -188,14 +214,21 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
if(productStatus == 0 || productStatus == 1 || productStatus == 2){
upgradeComplete = false
}
if(productStatus == 4){
upgradeResult = false
}
val otaUpgradeInfo = OtaUpgradeInfo(token, productStatus,failReason,upgradeReason,
taskId,taskItemId,otaType,productName,needRestart,isDelay,curSize,totalSize)
otaUpgradeList.add(otaUpgradeInfo)
}
CallerHmiManager.showOTADownloadStatusDialog(otaUpgradeList)
if(upgradeComplete){
OTAUpgradeConfig.otaToken = ""
CallerHmiManager.showOTAResultDialog(upgradeResult)
}else{
//通知关闭提示升级窗口存在域控也在进行5min倒计时与app存在时间差域控会更早完成倒计时触发升级
// 此时通知app开始升级app收到后即使未完成倒计时也关闭提示弹窗开始展示下载进展
CallerHmiManager.showOTAUpgradeDialog(false)
CallerHmiManager.showOTADownloadStatusDialog(otaUpgradeList)
}
}

View File

@@ -2,7 +2,28 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="@dimen/dp_10">
<TextView
android:id="@+id/tvProductName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
/>
<TextView
android:id="@+id/tvDownloadProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
/>
<ProgressBar
android:id="@+id/pbDownloadProgress"
@@ -10,18 +31,8 @@
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvProductName"
style="?android:attr/progressBarStyleHorizontal"
/>
<TextView
android:id="@+id/tvDownloadStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/pbDownloadProgress"
android:textSize="@dimen/sp_30"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -61,6 +61,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.tools.ModifyBindingCarDialog
import com.mogo.eagle.core.function.hmi.ui.tools.OTADownloadStatusDialog
import com.mogo.eagle.core.function.hmi.ui.tools.OTAUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.tools.OTAUpgradeResultDialog
import com.mogo.eagle.core.function.hmi.ui.tools.OTAUpgradeTipView
import com.mogo.eagle.core.function.hmi.ui.tools.ToBindingCarDialog
import com.mogo.eagle.core.function.hmi.ui.tools.UpgradeAppDialog
@@ -663,21 +664,29 @@ class MoGoHmiProvider : IMoGoHmiProvider {
CallerHmiViewControlListenerManager.invokeColdStartProcessView()
}
var otaUpgradeDialog: OTAUpgradeDialog ?= null
var otaDownloadStatusDialog: OTADownloadStatusDialog ?= null
var otaUpgradeTipView: OTAUpgradeTipView ?= null
private var otaUpgradeDialog: OTAUpgradeDialog ?= null
private var otaDownloadStatusDialog: OTADownloadStatusDialog ?= null
private var otaUpgradeResultDialog: OTAUpgradeResultDialog ?= null
private var otaUpgradeTipView: OTAUpgradeTipView ?= null
/**
* 展示OTA升级弹窗
* @param isShow 设置是否展示
*/
override fun showOTAUpgradeDialog() {
override fun showOTAUpgradeDialog(isShow: Boolean) {
ThreadUtils.runOnUiThread{
context?.let {
if(otaUpgradeDialog == null){
otaUpgradeDialog = OTAUpgradeDialog(it)
}
if(otaUpgradeDialog?.isShowing == false){
otaUpgradeDialog?.show()
if(isShow){
if(otaUpgradeDialog == null){
otaUpgradeDialog = OTAUpgradeDialog(it)
}
if(otaUpgradeDialog?.isShowing == false){
otaUpgradeDialog?.show()
}
}else{
if(otaUpgradeDialog?.isShowing == true){
otaUpgradeDialog?.dismiss()
}
}
}
}
@@ -689,12 +698,14 @@ class MoGoHmiProvider : IMoGoHmiProvider {
override fun showOTADownloadStatusDialog(list: List<OtaUpgradeInfo>) {
ThreadUtils.runOnUiThread{
if(otaDownloadStatusDialog?.isShowing == true){
otaDownloadStatusDialog?.notifyDownloadStatus(list)
return@runOnUiThread
}
context?.let {
if(otaDownloadStatusDialog == null){
otaDownloadStatusDialog = OTADownloadStatusDialog(it)
}
otaDownloadStatusDialog?.show()
otaDownloadStatusDialog?.notifyDownloadStatus(list)
}
}
@@ -718,4 +729,22 @@ class MoGoHmiProvider : IMoGoHmiProvider {
}
}
/**
* 展示OTA升级结果弹窗
* @param result true升级成功 false升级失败
*/
override fun showOTAResultDialog(result: Boolean) {
ThreadUtils.runOnUiThread{
context?.let{
if(otaUpgradeResultDialog == null){
otaUpgradeResultDialog = OTAUpgradeResultDialog(it)
}
if(otaUpgradeResultDialog?.isShowing == false){
otaUpgradeResultDialog?.show()
}
otaUpgradeResultDialog?.showResult(result)
}
}
}
}

View File

@@ -37,9 +37,6 @@ class OTADownloadStatusDialog(context: Context) :
}
fun notifyDownloadStatus(list: List<OtaUpgradeInfo>){
if(!this.isShowing){
show()
}
otaDownloadStatusAdapter?.setData(list)
}

View File

@@ -2,14 +2,12 @@ package com.mogo.eagle.core.function.hmi.ui.tools
import android.content.Context
import android.os.CountDownTimer
import android.widget.TextView
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.zhjt.mogo_core_function_devatools.ota.OTAUpgradeConfig
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tv_upgrade_countdown
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tv_upgrade_later
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tv_upgrade_now
import system_master.SsmInfo
@@ -23,7 +21,6 @@ class OTAUpgradeDialog(context: Context) :
companion object {
private const val TAG = "OTAUpgradeDialog"
private const val UPGRADE_WAITING_TIME = 300000L //升级确认等待时间
private const val WAITING_TICK_TIME = 1000L //等待确认间隔时间
}
private var clickListener: ClickListener? = null
@@ -46,11 +43,8 @@ class OTAUpgradeDialog(context: Context) :
CallerAutoPilotControlManager.sendSsmFuncOtaDownloadResponse(OTAUpgradeConfig.otaToken,SsmInfo.IfUpgrade.DELAY)
dismiss()
}
upgradeWaitingTimer = object: CountDownTimer(UPGRADE_WAITING_TIME,WAITING_TICK_TIME){
upgradeWaitingTimer = object: CountDownTimer(UPGRADE_WAITING_TIME,UPGRADE_WAITING_TIME){
override fun onTick(millisUntilFinished: Long) {
ThreadUtils.runOnUiThread {
tv_upgrade_countdown.text = millisUntilFinished.toInt().toString()
}
}
override fun onFinish() {

View File

@@ -0,0 +1,49 @@
package com.mogo.eagle.core.function.hmi.ui.tools
import android.content.Context
import androidx.lifecycle.LifecycleObserver
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
import kotlinx.android.synthetic.main.dialog_ota_upgrade_result.tvResultContent
/**
* OTA升级结果提示窗
*/
class OTAUpgradeResultDialog(context: Context) :
BaseFloatDialog(context,TAG), LifecycleObserver {
companion object {
private const val TAG = "OTAUpgradeResultDialog"
}
init{
setContentView(R.layout.dialog_ota_upgrade_result)
setCanceledOnTouchOutside(false)
}
/**
* 展示OTA升级结果弹窗
* @param result true升级成功 false升级失败
*/
fun showResult(result: Boolean){
if(result){
//升级成功
tvResultContent.text = context.resources.getString(R.string.ota_result_success)
//消息盒子和语音提示升级成功结果
//TODO 消息盒子提示
AIAssist.getInstance(context).speakTTSVoice("车辆部署任务执行成功,请重启车辆")
}else{
//升级失败
tvResultContent.text = context.resources.getString(R.string.ota_result_fail)
//消息盒子和语音提示升级失败结果
//TODO 消息盒子提示
AIAssist.getInstance(context).speakTTSVoice("车辆部署任务执行失败")
}
}
}

View File

@@ -7,6 +7,8 @@ import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo_core_function_devatools.ota.OTAUpgradeConfig
import kotlinx.android.synthetic.main.view_ota_upgrade_tip.view.btn_upgrade
/**
@@ -29,8 +31,14 @@ class OTAUpgradeTipView @JvmOverloads constructor(
private fun initView(){
btn_upgrade.setOnClickListener {
//打开升级弹窗
CallerHmiManager.showOTAUpgradeDialog()
//冷启动已完成(包括成功/失败),且驾驶状态为非自驾状态,且当前无订单进行强提示,否则为弱提示
if(OTAUpgradeConfig.coldStartCompleted && !OTAUpgradeConfig.autopilotStatus
&& !OTAUpgradeConfig.inOrder){
//触发强提示升级
CallerHmiManager.showOTAUpgradeDialog(true)
}else{
ToastUtils.showLong("请结束订单后触发升级")
}
}
}

View File

@@ -31,33 +31,36 @@ class OTADownloadStatusAdapter(private val context: Context): RecyclerView.Adapt
override fun onBindViewHolder(holder: DownloadStatusHolder, position: Int) {
data?.let {
val otaUpgradeInfo = it[position]
holder.tvProductName.text = otaUpgradeInfo.product_name
holder.tvDownloadProgress.text = "${(otaUpgradeInfo.cur_size*100/otaUpgradeInfo.total_size).toInt()}%"
holder.pbDownloadProgress.progress = (otaUpgradeInfo.cur_size*100/otaUpgradeInfo.total_size).toInt()
// 0:默认(未开始), 1:下载中, 2:下载完成, 3:升级完成, 4:升级失败
holder.tvDownloadStatus.text = when (otaUpgradeInfo.status) {
1 -> {
"下载中"
}
2 -> {
"下载完成"
}
3 -> {
"升级完成"
}
4 -> {
"升级失败"
}
else -> {
"默认(未开始)"
}
}
// holder.tvDownloadStatus.text = when (otaUpgradeInfo.status) {
// 1 -> {
// "下载中"
// }
// 2 -> {
// "下载完成"
// }
// 3 -> {
// "升级完成"
// }
// 4 -> {
// "升级失败"
// }
// else -> {
// "默认(未开始)"
// }
// }
}
}
override fun getItemCount() = data?.size ?: 0
class DownloadStatusHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvProductName: TextView = itemView.findViewById(R.id.tvProductName)
var tvDownloadProgress: TextView = itemView.findViewById(R.id.tvDownloadProgress)
var pbDownloadProgress: ProgressBar = itemView.findViewById(R.id.pbDownloadProgress)
var tvDownloadStatus: TextView = itemView.findViewById(R.id.tvDownloadStatus)
}
}

View File

@@ -31,6 +31,7 @@ import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.mogo_core_function_devatools.coldstart.ColdStartAnalyticsManager
import com.zhjt.mogo_core_function_devatools.coldstart.ColdStartConfig
import com.zhjt.mogo_core_function_devatools.coldstart.ColdStartNodeAdapter
import com.zhjt.mogo_core_function_devatools.ota.OTAUpgradeConfig
import kotlinx.android.synthetic.main.view_cold_start.view.ivColdStartNow
import kotlinx.android.synthetic.main.view_cold_start.view.ivColdStartStatus
import kotlinx.android.synthetic.main.view_cold_start.view.ivIpcConnectStatus
@@ -490,6 +491,7 @@ class ColdStartView @JvmOverloads constructor(
coldStartStatus = false
currentColdStartSuccess = false
newColdStart = false
OTAUpgradeConfig.coldStartCompleted = false
}
/**
@@ -531,6 +533,7 @@ class ColdStartView @JvmOverloads constructor(
coldStartStatus = false
currentColdStartSuccess = false
newColdStart = false
OTAUpgradeConfig.coldStartCompleted = false
}
/**
@@ -578,6 +581,7 @@ class ColdStartView @JvmOverloads constructor(
coldStartStatus = false
currentColdStartSuccess = false
newColdStart = false
OTAUpgradeConfig.coldStartCompleted = false
}
/**
@@ -734,6 +738,7 @@ class ColdStartView @JvmOverloads constructor(
ssmConnectStatus = false
coldStartStatus = false
currentColdStartSuccess = false
OTAUpgradeConfig.coldStartCompleted = false
//取消连接SSM超时等待倒计时
connectSSMTimer?.cancel()
//展示连接SSM失败视图
@@ -760,6 +765,7 @@ class ColdStartView @JvmOverloads constructor(
//将冷启动状态置为false
coldStartStatus = false
currentColdStartSuccess = false
OTAUpgradeConfig.coldStartCompleted = true
//展示冷启动失败视图
showColdStartFailView()
//冷启动失败埋点统计
@@ -818,6 +824,7 @@ class ColdStartView @JvmOverloads constructor(
UiThreadHandler.postDelayed({
currentColdStartSuccess = true
this@ColdStartView.visibility = View.GONE
OTAUpgradeConfig.coldStartCompleted = true
}, 1000)
}

View File

@@ -1,16 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_width="@dimen/dp_900"
android:layout_height="@dimen/dp_720"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_bone_dialog"
app:roundLayoutRadius="@dimen/dp_50">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvDownloadStatus"
<TextView
android:id="@+id/tvDownloadTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="@string/ota_download_title"
android:textSize="56dp"
android:textColor="#FFFFFFFF"
android:layout_marginTop="50dp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvDownloadStatus"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDownloadTitle"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_margin="@dimen/dp_30"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_900"
android:layout_height="@dimen/dp_620"
android:layout_height="@dimen/dp_720"
android:background="@drawable/bg_bone_dialog"
app:roundLayoutRadius="@dimen/dp_50"
>
@@ -15,24 +15,12 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="@string/application_upgrade"
android:text="@string/ota_upgrade_title"
android:textSize="56dp"
android:textColor="#FFFFFFFF"
android:layout_marginTop="50dp"
/>
<TextView
android:id="@+id/tv_upgrade_countdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tv_upgrade_title"
app:layout_constraintBottom_toBottomOf="@id/tv_upgrade_title"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="@dimen/dp_50"
android:textSize="@dimen/sp_30"
android:textColor="@color/white"
/>
<TextView
android:id="@+id/tv_upgrade_content"
android:layout_width="0dp"
@@ -40,7 +28,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_title"
android:text="@string/application_upgrade_confirm"
android:text="@string/ota_upgrade_content"
android:textColor="#FFFFFFFF"
android:textSize="43dp"
android:gravity="start"
@@ -49,22 +37,6 @@
android:layout_marginTop="50dp"
/>
<TextView
android:id="@+id/tv_upgrade_tip"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_content"
app:layout_constraintBottom_toTopOf="@id/view_horizontal_line"
android:text="@string/application_upgrade_tips"
android:textColor="#FFFF4B1F"
android:textSize="36dp"
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
android:layout_marginTop="30dp"
/>
<TextView
android:id="@+id/tv_upgrade_now"
android:layout_width="@dimen/dp_356"

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_900"
android:layout_height="@dimen/dp_720"
android:background="@drawable/bg_bone_dialog"
app:roundLayoutRadius="@dimen/dp_50">
<ImageView
android:id="@+id/ivUpgradeResult"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_150"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_60"
android:contentDescription="@string/ota_result_image"
/>
<TextView
android:id="@+id/tvResultContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivUpgradeResult"
android:textColor="@color/white"
android:textSize="@dimen/sp_50"
android:layout_marginTop="@dimen/dp_30"
/>
<TextView
android:id="@+id/tvResultTip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvResultContent"
android:textColor="@color/white"
android:textSize="@dimen/sp_40"
android:layout_marginTop="@dimen/dp_20"
/>
<TextView
android:id="@+id/tvResultClose"
android:layout_width="@dimen/dp_356"
android:layout_height="@dimen/dp_120"
android:gravity="center"
android:text="@string/ota_result_close"
android:background="@drawable/bg_dialog_btn"
android:textColor="@color/color_2EACFF"
android:textSize="@dimen/dp_40"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="@dimen/dp_62"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -249,7 +249,15 @@
<string name="cold_start_process">冷启动进度条</string>
<!--OTA升级-->
<string name="ota_upgrade_title">车辆部署推送</string>
<string name="ota_upgrade_content">收到推送的车辆任务部署\n请确保⻋辆在安全位置再升级升级过程中保持⻋辆处于静⽌、上电状态\n升级过程中请勿进⾏任何操作包括任务及⾃驾等</string>
<string name="ota_upgrade_now">立即升级</string>
<string name="ota_upgrade_later">稍后升级</string>
<string name="ota_download_title">资源下载中</string>
<string name="ota_result_image">OTA升级结果图片示例</string>
<string name="ota_result_success">⻋辆部署任务执⾏成功</string>
<string name="ota_result_fail">⻋辆部署任务执⾏失败</string>
<string name="ota_result_tip">请重启⻋辆</string>
<string name="ota_result_close">关闭</string>
</resources>

View File

@@ -326,8 +326,9 @@ interface IMoGoHmiProvider :IProvider{
/**
* 展示OTA升级弹窗
* @param isShow 设置是否展示
*/
fun showOTAUpgradeDialog()
fun showOTAUpgradeDialog(isShow: Boolean)
/**
* 展示OTA升级下载状态弹窗
@@ -339,4 +340,10 @@ interface IMoGoHmiProvider :IProvider{
* @param visible 设置是否可见
*/
fun showOTAUpgradeTipView(visible: Boolean)
/**
* 展示OTA升级结果弹窗
* @param result true升级成功 false升级失败
*/
fun showOTAResultDialog(result: Boolean)
}

View File

@@ -476,8 +476,8 @@ object CallerHmiManager {
/**
* 展示OTA升级弹窗
*/
fun showOTAUpgradeDialog(){
hmiProviderApi?.showOTAUpgradeDialog()
fun showOTAUpgradeDialog(isShow: Boolean){
hmiProviderApi?.showOTAUpgradeDialog(isShow)
}
/**
@@ -495,4 +495,12 @@ object CallerHmiManager {
hmiProviderApi?.showOTAUpgradeTipView(visible)
}
/**
* 展示OTA升级结果弹窗
* @param result true升级成功 false升级失败
*/
fun showOTAResultDialog(result: Boolean){
hmiProviderApi?.showOTAResultDialog(result)
}
}