Merge remote-tracking branch 'origin/dev_arch_opt_3.0' into dev_arch_opt_3.0

This commit is contained in:
donghongyu
2023-03-15 16:20:54 +08:00
8 changed files with 85 additions and 52 deletions

View File

@@ -14,23 +14,29 @@ import com.knightboost.lancet.api.annotations.*
@Group("crash_fix")
class CrashFix {
/**
* 修正Android8.0及之后后台启动Service引起的崩溃
* java.lang.IllegalStateException: Not allowed to start service Intent {
* act=com.zhidao.cosupload.service.UPLOAD_ACTION cmp=com.mogo.launcher.f/com.zhidao.cosupload.service.UploadService }: app is in background uid UidRecord{6443b7b u0a404 LAST bg:+1m15s362ms idle change:idle procs:1 seq(0,0,0)}
*/
@Insert(mayCreateSuper = true)
@TargetClass("android.content.Context", scope = LEAF)
@TargetMethod(methodName = "startService")
fun fixStartServiceCrash(intent: Intent): ComponentName? {
return try {
Origin.call() as ComponentName?
} catch (t: Throwable) {
t.printStackTrace()
null
companion object {
/**
* 修正Android8.0及之后后台启动Service引起的崩溃
* java.lang.IllegalStateException: Not allowed to start service Intent {
* act=com.zhidao.cosupload.service.UPLOAD_ACTION cmp=com.mogo.launcher.f/com.zhidao.cosupload.service.UploadService }: app is in background uid UidRecord{6443b7b u0a404 LAST bg:+1m15s362ms idle change:idle procs:1 seq(0,0,0)}
*/
@JvmStatic
@TargetClass("android.content.Context", scope = ALL)
@TargetMethod(methodName = "startService")
@ReplaceInvoke
fun fixStartServiceCrash(context: Context, intent: Intent): ComponentName? {
return try {
context.startService(intent)
} catch (t: Throwable) {
t.printStackTrace()
null
}
}
}
/**
* https://console.volcengine.com/apmplus/app/crash/detail/java/bb387ccd9c1a3c6ad2ede4e6f501a5e7?aid=302368&date=%7B%22granularity%22%3A%221h%22%2C%22duration%22%3A%22recently%22%2C%22range%22%3A%221w%22%7D&filters=%7B%22type%22%3A%22and%22%2C%22sub_conditions%22%3A%5B%7B%22dimension%22%3A%22os%22%2C%22op%22%3A%22in%22%2C%22type%22%3A%22expression%22%2C%22values%22%3A%5B%22Android%22%5D%7D%5D%7D&org_id=2100068151&os=Android&page_number=6&status=%5B%22pending%22%2C%22processing%22%2C%22solved%22%2C%22reopen%22%5D
* java.lang.IllegalArgumentException: Invalid audio buffer size.

View File

@@ -13,6 +13,7 @@ import com.mogo.support.obu.model.MogoObuRsiWarningData;
import com.mogo.support.obu.model.MogoObuRsmWarningData;
import com.mogo.support.obu.model.MogoObuRvWarningData;
import com.mogo.support.obu.model.MogoObuSpatWarningData;
import com.mogo.support.obu.model.MogoObuSystemStatusData;
import com.mogo.support.obu.model.advance.AccFourAxes;
import com.mogo.support.obu.model.advance.DateTime;
import com.mogo.support.obu.model.advance.NodeId;
@@ -293,6 +294,11 @@ public class ObuTest {
}
@Override
public void onObuSystemStatus(MogoObuSystemStatusData data) {
}
@Override
public void onGnssInfo(MessagePad.GnssInfo gnssInfo) {
Log.i("ddddd", "onGnssInfo=\n" + TextFormat.printer().escapingNonAscii(false).printToString(gnssInfo));

View File

@@ -93,7 +93,7 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta3',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta4',
// google
googlezxing : "com.google.zxing:core:3.3.3",

View File

@@ -194,6 +194,15 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
}
}
/**
* OBU 系统状态
*
* @param data 系统状态
*/
override fun onObuSystemStatus(data: MogoObuSystemStatusData?) {
}
/**
* HV车辆基础信息 gnssInfo
*/

View File

@@ -31,6 +31,15 @@ object MoGoObuListenerImpl : OnObuListener {
CallerObuConnectListenerManager.invokeObuConnectListener()
}
/**
* OBU 系统状态
*
* @param data 系统状态
*/
override fun onObuSystemStatus(data: MogoObuSystemStatusData?) {
}
/**
* HV车辆基础信息

View File

@@ -564,7 +564,7 @@ internal class DebugSettingView @JvmOverloads constructor(
setLogCheckedChangeListener()
//OBU配置信息
tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString()
// tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString()
//工控机配置信息
tvAutopilotInfo.text =
@@ -1597,7 +1597,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tvAutopilotInfo.text = autopilotJson
tvIpcInfo.text = autopilotJson
tvIpcInfoKey.text = autopilotJson
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)?:""
tvCarInfo.text =
"GPS时间${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
@@ -1637,7 +1637,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//obu TODO 后面会添加很多os那边需要显示的内容
obuVersionNameTv.text = Html.fromHtml(
"OBU版本号$mObuVersionName"
"OBU信息$mObuVersionName"
)
obuConnectStatusTv.text = Html.fromHtml(
@@ -1657,7 +1657,7 @@ internal class DebugSettingView @JvmOverloads constructor(
*/
override fun onConnectStatus(obuStatusInfo: ObuStatusInfo) {
lifecycleOwner.lifecycleScope.launch {
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
// tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus

View File

@@ -1085,16 +1085,16 @@
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnSetObuIP" />
<TextView
android:id="@+id/tvObuInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_5"
android:minLines="4"
android:text="OBU配置信息"
android:textColor="#000"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/obuDivider" />
<!-- <TextView-->
<!-- android:id="@+id/tvObuInfo"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_margin="@dimen/dp_5"-->
<!-- android:minLines="3"-->
<!-- android:text="OBU配置信息"-->
<!-- android:textColor="#000"-->
<!-- android:textSize="@dimen/dp_24"-->
<!-- app:layout_constraintTop_toBottomOf="@id/obuDivider" />-->
<LinearLayout
android:id="@+id/obuStatusCenterLayout"
@@ -1103,30 +1103,26 @@
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible"
app:layout_constraintTop_toBottomOf="@id/tvObuInfo"
app:layout_constraintTop_toBottomOf="@id/obuDivider"
tools:ignore="MissingConstraints">
<TextView
android:id="@+id/obuVersionNameTv"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/obuConnectStatusTv"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/obuConnectStatusTv"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/obuVersionNameTv"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
</LinearLayout>

View File

@@ -2,6 +2,7 @@ package com.zhidao.support.obu;
import com.mogo.support.obu.ObuScene;
import com.mogo.support.obu.constants.Define;
import com.mogo.support.obu.model.MogoObuSystemStatusData;
import mogo.telematics.pad.MessagePad;
@@ -15,6 +16,12 @@ public interface OnObuListener {
*/
void onConnectStatus(@Define.ConnectStatus int connectStatus);
/**
* OBU 系统状态
*
* @param data 系统状态
*/
void onObuSystemStatus(MogoObuSystemStatusData data);
/**
* HV车辆基础信息