Merge branch 'dev_robotaxi-d_240523_6.4.4' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_240523_6.4.4
This commit is contained in:
@@ -69,12 +69,19 @@ object DataManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* FSM消息(缓存数据库时使用)
|
||||
* FM消息(缓存数据库时使用)
|
||||
*/
|
||||
private val fmInfoList by lazy {
|
||||
mutableListOf<MsgBoxBean>()
|
||||
}
|
||||
|
||||
/**
|
||||
* FSM消息(缓存数据库时使用)
|
||||
*/
|
||||
private val fsmInfoList by lazy {
|
||||
mutableListOf<MsgBoxBean>()
|
||||
}
|
||||
|
||||
private val scope by lazy {
|
||||
Utils.getApp().lifeCycleScope
|
||||
}
|
||||
@@ -149,6 +156,13 @@ object DataManager {
|
||||
CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg)
|
||||
}
|
||||
|
||||
MsgBoxType.FSM -> {
|
||||
synchronized(this) {
|
||||
fsmInfoList.add(msg)
|
||||
}
|
||||
CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg)
|
||||
}
|
||||
|
||||
MsgBoxType.SSMINFO -> {// 不存数据库
|
||||
CallerMsgBoxListenerManager.invokeListener(MsgCategory.SYS_INFO, msg)
|
||||
}
|
||||
@@ -346,6 +360,18 @@ object DataManager {
|
||||
}
|
||||
}
|
||||
|
||||
MsgBoxType.FSM.ordinal -> {
|
||||
return@map MsgBoxBean(
|
||||
MsgBoxType.FSM,
|
||||
GsonUtils.fromJson(json, FSMMsg::class.java)
|
||||
).apply {
|
||||
this.timestamp = msgInfo.timeStamp
|
||||
withContext(Dispatchers.Main) {
|
||||
cacheNotifyList.add(this@apply)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
return@map null
|
||||
}
|
||||
@@ -396,6 +422,13 @@ object DataManager {
|
||||
fmInfoList.clear()
|
||||
}
|
||||
|
||||
if (fsmInfoList.isNotEmpty()) {
|
||||
fsmInfoList.forEach {
|
||||
msgInfoList.add(MsgBoxInfo(it.bean2Json, it.type.ordinal, it.timestamp))
|
||||
}
|
||||
fsmInfoList.clear()
|
||||
}
|
||||
|
||||
if (msgInfoList.isNotEmpty()) {
|
||||
MsgBoxDb.getDb(context)
|
||||
.monitorDao()
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.tencent.matrix.trace.config.SharePluginInfo
|
||||
import com.tencent.matrix.trace.config.TraceConfig
|
||||
import com.zhjt.mogo_core_function_devatools.apm.*
|
||||
import com.mogo.eagle.core.function.api.upgrade.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.IAppStateListener
|
||||
@@ -73,8 +74,10 @@ import com.zhjt.mogo_core_function_devatools.upgrade.UpgradeManager.Companion.up
|
||||
import com.zhjt.mogo_core_function_devatools.weaknetwork.DetectResultImpl
|
||||
import com.zhjt.mogo_core_function_devatools.weaknetwork.WeakNetworkStrategy
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
@@ -217,6 +220,35 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查上传崩溃日志
|
||||
*/
|
||||
override fun checkUploadCrashLog() {
|
||||
mContext?.let {
|
||||
val crashDir = File(it.getExternalFilesDir(null), "crash")
|
||||
if(crashDir.exists() && crashDir.canExecute() && crashDir.listFiles()?.isNotEmpty() == true){
|
||||
it.lifeCycleScope.launch(Dispatchers.IO){
|
||||
val startTime = crashDir.lastModified() - 60*1000
|
||||
val endTime = if(System.currentTimeMillis() - crashDir.lastModified()>60*1000){
|
||||
crashDir.lastModified() + 60*1000
|
||||
}else{
|
||||
System.currentTimeMillis()
|
||||
}
|
||||
var isUploadSuccess = false
|
||||
try {
|
||||
CallerDevaToolsManager.logcat()?.upload(startTime, endTime)
|
||||
isUploadSuccess = true
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
if(isUploadSuccess){
|
||||
crashDir.deleteRecursively()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initMatrix() {
|
||||
val builder: Matrix.Builder = Matrix.Builder(AbsMogoApplication.getApp())
|
||||
builder.pluginListener(object : PluginListener {
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.function.api.devatools.logcat.*
|
||||
import com.mogo.eagle.core.utilcode.download.DownloadUtils
|
||||
import com.zhidao.loglib.bean.RemoteLogPushContent
|
||||
import com.zhjt.mogo_core_function_devatools.BuildConfig
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.checker.AnrLogChecker
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.config.LogRecordConfig
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.uploader.*
|
||||
@@ -130,18 +129,16 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider,
|
||||
.systemTags("ActivityManager")
|
||||
.checker(AnrLogChecker())
|
||||
}
|
||||
if (BuildConfig.DEBUG) {
|
||||
builder.crashConfig(
|
||||
CrashConfig.Builder()
|
||||
.enabled(true)
|
||||
.crashDir(File(context.getExternalFilesDir(null), "crash"))
|
||||
.expireDuration(TimeUnit.DAYS.toMillis(3))
|
||||
.javaCrash(true)
|
||||
.nativeCrash(true)
|
||||
.anr(true)
|
||||
.build()
|
||||
)
|
||||
}
|
||||
builder.crashConfig(
|
||||
CrashConfig.Builder()
|
||||
.enabled(true)
|
||||
.crashDir(File(context.getExternalFilesDir(null), "crash"))
|
||||
.expireDuration(TimeUnit.DAYS.toMillis(3))
|
||||
.javaCrash(true)
|
||||
.nativeCrash(true)
|
||||
.anr(true)
|
||||
.build()
|
||||
)
|
||||
builder.extraFilesToUpload(object : IExtraFileToUpload {
|
||||
override fun filesToUpload(): List<ToUploadFile> {
|
||||
return ArrayList<ToUploadFile>().also {
|
||||
|
||||
@@ -46,7 +46,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
private val fm: Int = 6
|
||||
private val ssm: Int = 7
|
||||
private val autopilot: Int = 8
|
||||
private val none: Int = 9
|
||||
private val fsm: Int = 9
|
||||
private val none: Int = 10
|
||||
|
||||
private var changeViewListener: ChangeViewListener?=null
|
||||
|
||||
@@ -103,6 +104,10 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_autopilot,parent,false)
|
||||
return BubbleAutopilotHolder(view)
|
||||
}
|
||||
fsm -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_fsm,parent,false)
|
||||
return BubbleFSMHolder(view)
|
||||
}
|
||||
else -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false)
|
||||
return BubbleV2XHolder(view)
|
||||
@@ -308,6 +313,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat())
|
||||
}
|
||||
}
|
||||
|
||||
//FSM消息
|
||||
is BubbleFSMHolder ->{
|
||||
data?.let {
|
||||
val fsmMsg = it[position].msgBoxBean.bean as FSMMsg
|
||||
holder.tvFSMTitle.text = fsmMsg.title
|
||||
holder.tvFSMContent.text = fsmMsg.content
|
||||
holder.tvFSMTime.text = TimeUtils.millis2String(fsmMsg.timestamp,getHourMinFormat())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val msgBoxBean: MsgBoxCountDownBean = data!![position]
|
||||
@@ -361,6 +376,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
ssm
|
||||
}else if(data!![position].msgBoxBean.type == MsgBoxType.AUTOPILOT){
|
||||
autopilot
|
||||
}else if(data!![position].msgBoxBean.type == MsgBoxType.FSM){
|
||||
fsm
|
||||
} else {
|
||||
v2x
|
||||
}
|
||||
@@ -445,6 +462,14 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent)
|
||||
}
|
||||
|
||||
//FSM状态消息(现阶段提示启动自驾失败消息,过渡阶段提示,未来展示fsm消息提醒)
|
||||
class BubbleFSMHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivFSMImage: ImageView = itemView.findViewById(R.id.ivFSMImage)
|
||||
var tvFSMTitle: TextView = itemView.findViewById(R.id.tvFSMTitle)
|
||||
var tvFSMTime: TextView = itemView.findViewById(R.id.tvFSMTime)
|
||||
var tvFSMContent: TextView = itemView.findViewById(R.id.tvFSMContent)
|
||||
}
|
||||
|
||||
fun setChangeListener(listener: ChangeViewListener){
|
||||
changeViewListener = listener
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
private val summary: Int = 8 //汇总消息
|
||||
private val ssm: Int = 9 //SSM连接消息
|
||||
private val autopilot = 20 //工控机连接消息
|
||||
private val fsm = 21 //fsm消息
|
||||
|
||||
private val none = -1
|
||||
|
||||
@@ -131,6 +132,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
.inflate(R.layout.item_msg_box_autopilot,parent,false)
|
||||
return MsgBoxAutopilot(view)
|
||||
}
|
||||
fsm -> {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_fsm,parent,false)
|
||||
return MsgBoxFSM(view)
|
||||
}
|
||||
else -> {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_v2x, parent, false)
|
||||
@@ -696,6 +702,15 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat())
|
||||
}
|
||||
}
|
||||
//fsm消息
|
||||
is MsgBoxFSM ->{
|
||||
data?.let {
|
||||
val fsmMsg = it[position].bean as FSMMsg
|
||||
holder.tvFSMTitle.text = fsmMsg.title
|
||||
holder.tvFSMContent.text = fsmMsg.content
|
||||
holder.tvFSMTime.text = TimeUtils.millis2String(fsmMsg.timestamp,getHourMinFormat())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -736,6 +751,8 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
ssm
|
||||
} else if(data!![position].type == MsgBoxType.AUTOPILOT){
|
||||
autopilot
|
||||
} else if(data!![position].type == MsgBoxType.FSM){
|
||||
fsm
|
||||
} else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){
|
||||
v2x
|
||||
} else {
|
||||
@@ -852,4 +869,12 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent)
|
||||
}
|
||||
|
||||
//fsm状态
|
||||
class MsgBoxFSM(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var ivFSMImage: ImageView = itemView.findViewById(R.id.ivFSMImage)
|
||||
var tvFSMTitle: TextView = itemView.findViewById(R.id.tvFSMTitle)
|
||||
var tvFSMTime: TextView = itemView.findViewById(R.id.tvFSMTime)
|
||||
var tvFSMContent: TextView = itemView.findViewById(R.id.tvFSMContent)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -212,6 +212,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
startLeakMonitor()
|
||||
}
|
||||
CallerDevaToolsManager.checkMonitorDb()
|
||||
CallerDevaToolsManager.checkUploadCrashLog()
|
||||
}
|
||||
|
||||
private fun startLeakMonitor() {
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFSMImage"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="110dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_margin="25dp"
|
||||
android:src="@drawable/icon_warning_take_over"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFSMTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvFSMContent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivFSMImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFSMTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvFSMTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvFSMTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFSMContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvFSMTitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvFSMTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvFSMTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clFSMLayout"
|
||||
android:layout_width="@dimen/dp_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFSMImage"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="110dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_margin="25dp"
|
||||
android:src="@drawable/icon_warning_take_over"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFSMTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvFSMContent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivFSMImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFSMTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvFSMTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvFSMTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFSMContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvFSMTitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvFSMTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvFSMTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user