Merge branch 'dev_robotaxi-d_241112_6.8.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_241112_6.8.0

This commit is contained in:
renwj
2024-11-20 19:28:30 +08:00
24 changed files with 436 additions and 143 deletions

View File

@@ -9,7 +9,6 @@ import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Build
import android.os.Environment
import android.os.Environment.*
import android.os.Process
import android.text.Html
@@ -135,9 +134,9 @@ import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
import com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT
import com.mogo.tts.base.IMogoTTSCallback
import com.mogo.support.device.DevicesManager
import com.mogo.support.device.IBindStateChangeListener
import com.mogo.tts.base.IMogoTTSCallback
import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.service.chain.ChainLog
import kotlinx.android.synthetic.main.view_debug_setting.view.appVersionInfoLayout
@@ -337,6 +336,7 @@ import kotlin.collections.component4
import kotlin.collections.set
import kotlin.math.abs
import kotlin.system.exitProcess
import com.mogo.eagle.core.function.hmi.ui.tools.ShowVersionDialog
/**
@@ -1336,37 +1336,16 @@ internal class DebugSettingView @JvmOverloads constructor(
}
//硬件服务绑定状态以及版本
tvHardwareDeviceBindState.text =
getBindDeviceServiceState(DevicesManager.getServiceBindState())
tvHardwareDeviceBindState.setOnClickListener {
val state = when (DevicesManager.getServiceBindState()) {
0 -> {
"绑定成功"
}
1 -> {
"绑定失败未安装“硬件服务”APP"
}
2 -> {
"绑定失败:没有绑定权限或找不到服务"
}
3 -> {
"服务被异常销毁"
}
else -> {
"未知"
}
}
var msg = "客户端SDK版本${DevicesManager.getSDKVersion() ?: "未知"}\n"
var msg =
"${getBindDeviceServiceState(DevicesManager.getServiceBindState(), false)}\n"
msg += "客户端SDK版本${DevicesManager.getSDKVersion() ?: "未知"}\n"
msg += "客户端SDK AIDL版本${DevicesManager.getSDKAIDLVersion() ?: "未知"}\n"
msg += "硬件服务端APP版本${DevicesManager.getServerVersion() ?: "未知"}\n"
msg += "硬件服务端APP AIDL版本${DevicesManager.getServerAIDLVersion() ?: ""}"
AlertDialog.Builder(context)
.setTitle("硬件服务绑定状态: $state")
.setMessage(msg)
.setPositiveButton("确定", null)
.create().show()
msg += "硬件服务端APP AIDL版本${DevicesManager.getServerAIDLVersion() ?: "未知"}"
ShowVersionDialog(context, "硬件服务绑定", msg).show()
}
}
@@ -2766,29 +2745,42 @@ internal class DebugSettingView @JvmOverloads constructor(
}
override fun onServiceState(state: Int) {
val stateMsg = when (state) {
UiThreadHandler.post {
tvHardwareDeviceBindState.text = getBindDeviceServiceState(state)
}
}
private fun getBindDeviceServiceState(state: Int, isUseTitle: Boolean = true): CharSequence {
val msg = when (state) {
0 -> {
"绑定成功"
"<font color='green'>绑定成功</font>"
}
1 -> {
"绑定失败未安装“硬件服务”APP"
"<font color='red'>绑定失败未安装“硬件服务”APP</font>"
}
2 -> {
"绑定失败没有绑定权限或找不到服务"
"<font color='red'>绑定失败没有绑定权限或找不到服务</font>"
}
3 -> {
"服务被异常销毁"
"<font color='red'>绑定失败,服务被异常销毁</font>"
}
else -> {
"未知"
"<font color='red'>未知</font>"
}
}
UiThreadHandler.post {
tvHardwareDeviceBindState.text = "硬件服务绑定状态: $stateMsg"
val title = if (isUseTitle) {
"硬件服务绑定"
} else {
""
}
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Html.fromHtml("${title}状态:${msg}", Html.FROM_HTML_MODE_LEGACY)
} else {
Html.fromHtml("${title}状态:${msg}")
}
}
}

View File

@@ -0,0 +1,49 @@
package com.mogo.eagle.core.function.hmi.ui.tools
import android.content.Context
import android.widget.TextView
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
import com.mogo.support.device.DevicesManager
/**
* 离线地图缓存
*/
class ShowVersionDialog(context: Context, val title: String, val msg: String) :
BaseFloatDialog(context, TAG) {
companion object {
private const val TAG = "ShowVersionDialog"
}
private var tvTitle: TextView? = null
private var tvMsg: TextView? = null
private var okView: TextView? = null
init {
setContentView(R.layout.dialog_show_version)
setCanceledOnTouchOutside(true)
setCancelable(true)
initView()
}
private fun initView() {
tvTitle = findViewById(R.id.tv_title)
tvMsg = findViewById(R.id.tv_msg)
okView = findViewById(R.id.tv_ok)
tvTitle?.text = title
tvMsg?.text = msg
okView?.setOnClickListener {
dismiss()
}
}
override fun dismiss() {
super.dismiss()
}
}

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/roundRootLayout"
android:layout_width="@dimen/dp_900"
android:layout_height="wrap_content"
android:background="@drawable/bg_bone_dialog"
app:roundLayoutRadius="@dimen/dp_50">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:textColor="@color/white"
android:textSize="@dimen/dp_45"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
android:textColor="@color/white"
android:textSize="@dimen/dp_36"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="@dimen/dp_356"
android:layout_height="@dimen/dp_120"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_40"
android:background="@drawable/bg_dialog_btn"
android:gravity="center"
android:text="@string/ok_tip"
android:textColor="@color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_msg" />
</com.mogo.eagle.core.widget.RoundConstraintLayout>