diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
index 752bfc730c..88c7e0146a 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
@@ -1058,6 +1058,9 @@ internal class DebugSettingView @JvmOverloads constructor(
ToastUtils.showLong("经纬度复制成功")
}
+ val certTxt = if(CallerCloudCertManager.getRootCrtF().isNullOrEmpty()) "未下载证书" else "已下载证书"
+ tvCertFile.text = "证书状态: $certTxt"
+
//状态中心-后台优化状态
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val backgroundStatus = "后台运行:" + if (BackgrounderPermission.getInstance()
@@ -1269,26 +1272,28 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
//是否启用证书认证
- cbSsl.isChecked = !CallerCloudCertManager.getRootCrtF().isNullOrEmpty()
+ cbSsl.isChecked = SharedPrefsMgr.getInstance().getBoolean(MoGoConfig.AUTOPILOT_CERTIFICATION,false)
cbSsl.setOnCheckedChangeListener { _, isChecked ->
+ cbSsl.isChecked = isChecked
+ SharedPrefsMgr.getInstance().putBoolean(MoGoConfig.AUTOPILOT_CERTIFICATION,isChecked)
+ //下载证书
if(isChecked){
- if(!CallerCloudCertManager.getRootCrtF().isNullOrEmpty()){
- cbSsl.isChecked = true
- }else{
+ if(CallerCloudCertManager.getRootCrtF().isNullOrEmpty()){
CallerCloudCertManager.certFileDownLoad{ errorMsg ->
- ToastUtils.showShort(errorMsg)
- cbSsl.isChecked = false
+ ThreadUtils.runOnUiThread {
+ ToastUtils.showShort(errorMsg)
+ }
}
}
- }else{
- cbSsl.isChecked = false
}
}
}
override fun authCrtFile(device: String, root: String) {
super.authCrtFile(device, root)
- cbSsl.isChecked = true
+ ThreadUtils.runOnUiThread {
+ tvCertFile.text = "证书状态: 已下载证书"
+ }
}
/**
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
index aa99aae206..29fe1d60a7 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
@@ -662,6 +662,13 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
+
+