[6.9.0]OTA升级检查更新调整
This commit is contained in:
@@ -16,4 +16,7 @@ object OTAUpgradeConfig {
|
||||
//是否有订单 true有订单 false没有订单
|
||||
@JvmField
|
||||
var inOrder: Boolean = false
|
||||
//当前SSM版本是否支持OTA升级,默认不支持
|
||||
@JvmField
|
||||
var supportOTA: Boolean = false
|
||||
}
|
||||
@@ -87,16 +87,8 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
// 并toast提示“收到车辆部署任务,请在车辆空闲时发起升级”
|
||||
CallerAutoPilotControlManager.sendSsmFuncOtaDownloadResponse(OTAUpgradeConfig.otaToken,SsmInfo.IfUpgrade.DELAY)
|
||||
ToastUtils.showLong("收到车辆部署任务,请在车辆空闲时发起升级")
|
||||
//展示OTA升级提示
|
||||
CallerHmiManager.showOTAUpgradeTipView(true)
|
||||
}
|
||||
}else{
|
||||
//展示OTA升级提示
|
||||
CallerHmiManager.showOTAUpgradeTipView(true)
|
||||
}
|
||||
}else{
|
||||
//隐藏OTA升级提示
|
||||
CallerHmiManager.showOTAUpgradeTipView(false)
|
||||
}
|
||||
//解析JSON
|
||||
var upgradeComplete = true
|
||||
@@ -135,6 +127,9 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
//// 状态 0:默认(未开始), 1:下载中, 2:下载完成, 3:升级完成, 4:升级失败
|
||||
if(productStatus == 0 || productStatus == 1 || productStatus == 2){
|
||||
upgradeComplete = false
|
||||
CallerOTAManager.invokeOtaDownloadStatus(true)
|
||||
}else{
|
||||
CallerOTAManager.invokeOtaDownloadStatus(false)
|
||||
}
|
||||
|
||||
val otaUpgradeInfo = OtaUpgradeInfo(token, productStatus,failReason,upgradeReason,
|
||||
@@ -167,13 +162,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
OTAUpgradeConfig.otaToken = status.otaInfo.otaToken
|
||||
//触发升级提示
|
||||
CallerHmiManager.showOTAUpgradeDialog(true)
|
||||
}else{
|
||||
//展示OTA升级提示
|
||||
CallerHmiManager.showOTAUpgradeTipView(true)
|
||||
}
|
||||
}else{
|
||||
//隐藏OTA升级提示
|
||||
CallerHmiManager.showOTAUpgradeTipView(false)
|
||||
}
|
||||
|
||||
//解析JSON
|
||||
@@ -213,6 +202,9 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
//// 状态 0:默认(未开始), 1:下载中, 2:下载完成, 3:升级完成, 4:升级失败
|
||||
if(productStatus == 0 || productStatus == 1 || productStatus == 2){
|
||||
upgradeComplete = false
|
||||
CallerOTAManager.invokeOtaDownloadStatus(true)
|
||||
}else{
|
||||
CallerOTAManager.invokeOtaDownloadStatus(false)
|
||||
}
|
||||
if(productStatus == 4){
|
||||
upgradeResult = false
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.bone.tab
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
@@ -11,13 +12,16 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.IDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IOTAListener
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchCustomViewManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -31,9 +35,11 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.MogoData
|
||||
import com.zhjt.mogo_core_function_devatools.ota.OTAUpgradeConfig
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.clBind
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.ivCarType
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADMapVersion
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADUpdate
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADVersionName
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarExit
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarLoginInfo
|
||||
@@ -59,7 +65,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoCheckAutoPilotBtnListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IDataCenterBizListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IDataCenterBizListener, IOTAListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CarInfoTabView"
|
||||
@@ -125,7 +131,19 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//域控OTA升级 检查更新
|
||||
tvADUpdate.setOnClickListener {
|
||||
HmiActionLog.hmiAction(
|
||||
"${SceneConstant.M_HMI}${TAG}",
|
||||
"ad version view clicked"
|
||||
)
|
||||
if(OTAUpgradeConfig.supportOTA){
|
||||
//查询OTA状态
|
||||
CallerAutoPilotControlManager.sendSsmFuncOtaStatusQuery(OTAUpgradeConfig.otaToken)
|
||||
}else{
|
||||
ToastUtils.showLong("当前域控版本不支持OTA升级")
|
||||
}
|
||||
}
|
||||
tvHDMapVersion.text = tvHDMapVersion.text.toString() + DebugConfig.getMapVersion()
|
||||
//高精地图 检查更新
|
||||
tvHDMapUpdate.setOnClickListener {
|
||||
@@ -262,4 +280,26 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
updateAdHdMapVersion()
|
||||
}
|
||||
|
||||
/**
|
||||
* SSM发送OTA升级提示请求,主动触发
|
||||
* @param request SSM发送OTA升级提示内容
|
||||
*/
|
||||
override fun onOtaDownloadRequest(request: SsmInfo.OtaDownloadRequest) {
|
||||
super.onOtaDownloadRequest(request)
|
||||
Log.i(TAG,"onOtaDownloadRequest otaToken"+request.otaToken)
|
||||
Log.i(TAG,"onOtaDownloadRequest productName"+request.productName)
|
||||
if(request.otaToken.isNotEmpty()){
|
||||
//冷启动已完成(包括成功/失败),且驾驶状态为非自驾状态,且当前无订单进行强提示,否则为弱提示
|
||||
if(OTAUpgradeConfig.coldStartCompleted && !OTAUpgradeConfig.autopilotStatus
|
||||
&& !OTAUpgradeConfig.inOrder){
|
||||
//触发强提示升级
|
||||
CallerHmiManager.showOTAUpgradeDialog(true)
|
||||
}else{
|
||||
ToastUtils.showLong("请结束订单后触发升级")
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showLong("暂无待升级任务!")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,6 @@ import android.view.animation.AccelerateDecelerateInterpolator
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.doOnAttach
|
||||
import androidx.lifecycle.ProcessLifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.transition.Slide
|
||||
@@ -43,7 +42,6 @@ import com.mogo.eagle.core.function.api.och.toolkit.IToolKitItemClickListener
|
||||
import com.mogo.eagle.core.function.api.och.toolkit.ToolKitCustomItemAddParam
|
||||
import com.mogo.eagle.core.function.api.och.toolkit.ToolKitDefaultItemAddParam
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -62,7 +60,6 @@ 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
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||
@@ -667,7 +664,6 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
private var otaUpgradeDialog: OTAUpgradeDialog ?= null
|
||||
private var otaDownloadStatusDialog: OTADownloadStatusDialog ?= null
|
||||
private var otaUpgradeResultDialog: OTAUpgradeResultDialog ?= null
|
||||
private var otaUpgradeTipView: OTAUpgradeTipView ?= null
|
||||
|
||||
/**
|
||||
* 展示OTA升级弹窗
|
||||
@@ -711,23 +707,6 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示OTA升级提示
|
||||
* @param visible 设置是否可见
|
||||
*/
|
||||
override fun showOTAUpgradeTipView(visible: Boolean) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
if(otaUpgradeDialog?.isShowing == true){
|
||||
return@runOnUiThread
|
||||
}
|
||||
if(otaUpgradeTipView == null){
|
||||
context?.let {
|
||||
otaUpgradeTipView = OTAUpgradeTipView(it)
|
||||
}
|
||||
}
|
||||
otaUpgradeTipView?.setDisplayStatus(visible)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示OTA升级结果弹窗
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
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
|
||||
|
||||
/**
|
||||
* OTA升级任务标记提示
|
||||
*/
|
||||
class OTAUpgradeTipView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr){
|
||||
|
||||
companion object {
|
||||
private const val TAG = "OTAUpgradeTipView"
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_ota_upgrade_tip, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
btn_upgrade.setOnClickListener {
|
||||
//冷启动已完成(包括成功/失败),且驾驶状态为非自驾状态,且当前无订单进行强提示,否则为弱提示
|
||||
if(OTAUpgradeConfig.coldStartCompleted && !OTAUpgradeConfig.autopilotStatus
|
||||
&& !OTAUpgradeConfig.inOrder){
|
||||
//触发强提示升级
|
||||
CallerHmiManager.showOTAUpgradeDialog(true)
|
||||
}else{
|
||||
ToastUtils.showLong("请结束订单后触发升级")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置视图是否可见
|
||||
* @param visible 是否可见
|
||||
*/
|
||||
fun setDisplayStatus(visible: Boolean){
|
||||
if(visible){
|
||||
if(this@OTAUpgradeTipView.visibility == View.VISIBLE){
|
||||
return
|
||||
}else{
|
||||
this@OTAUpgradeTipView.visibility = View.VISIBLE
|
||||
}
|
||||
}else{
|
||||
if(this@OTAUpgradeTipView.visibility != View.VISIBLE){
|
||||
return
|
||||
}else{
|
||||
this@OTAUpgradeTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -279,6 +279,8 @@ class ColdStartView @JvmOverloads constructor(
|
||||
ColdStartConfig.setColdStartSuccessTime(System.currentTimeMillis())
|
||||
}
|
||||
}
|
||||
//判断当前SSM版本是否支持OTA升级
|
||||
OTAUpgradeConfig.supportOTA = parseVersion(true, statusInf.masterVersion) >= 40800
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,25 +171,26 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvADVersionName"
|
||||
android:layout_width="@dimen/dp_514"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:gravity="start"
|
||||
android:maxLines="2"
|
||||
android:maxLines="3"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvADUpdate"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvADUpdate"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvADVersion"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvPadVersion" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvPadVersion"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvADUpdate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:text="@string/tab_version_update"
|
||||
android:textColor="@color/color_2EACFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:visibility="gone"
|
||||
android:text="@string/tab_version_update"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvADVersion"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvCarExit"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvADVersion" />
|
||||
|
||||
@@ -141,15 +141,6 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.tools.OTAUpgradeTipView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_39"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<!-- 事件弹框 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.v2n.RoadV2NEventWindowView
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_upgrade"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="OTA升级"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -335,12 +335,6 @@ interface IMoGoHmiProvider :IProvider{
|
||||
*/
|
||||
fun showOTADownloadStatusDialog(list: List<OtaUpgradeInfo>)
|
||||
|
||||
/**
|
||||
* 展示OTA升级提示
|
||||
* @param visible 设置是否可见
|
||||
*/
|
||||
fun showOTAUpgradeTipView(visible: Boolean)
|
||||
|
||||
/**
|
||||
* 展示OTA升级结果弹窗
|
||||
* @param result true升级成功 false升级失败
|
||||
|
||||
@@ -487,13 +487,6 @@ object CallerHmiManager {
|
||||
hmiProviderApi?.showOTADownloadStatusDialog(list)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示OTA升级提示
|
||||
* @param visible 设置是否可见
|
||||
*/
|
||||
fun showOTAUpgradeTipView(visible: Boolean){
|
||||
hmiProviderApi?.showOTAUpgradeTipView(visible)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示OTA升级结果弹窗
|
||||
|
||||
Reference in New Issue
Block a user