Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'
Dev arch opt 3.0 See merge request zhjt/AndroidApp/MoGoEagleEye!692
This commit is contained in:
@@ -12,10 +12,12 @@ import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.launcher.BuildConfig
|
||||
import com.mogo.launcher.R
|
||||
import com.mogo.test.crashreport.CrashReportConstants
|
||||
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
|
||||
import com.zhidaoauto.map.sdk.open.HDTypes
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.MapParams
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
||||
|
||||
object ConfigStartUp {
|
||||
|
||||
@@ -27,6 +29,9 @@ object ConfigStartUp {
|
||||
}
|
||||
|
||||
private fun initBuildConfig() {
|
||||
//ijk关闭log
|
||||
IjkPlayerManager.setLogLevel(IjkMediaPlayer.IJK_LOG_SILENT);
|
||||
|
||||
// 初始化构建APP的时候的分支及提交HASH,用于辅助定位问题
|
||||
AppConfigInfo.workingBranchName = BuildConfig.WORKING_BRANCH_NAME
|
||||
AppConfigInfo.workingBranchHash = BuildConfig.WORKING_BRANCH_HASH
|
||||
|
||||
@@ -132,8 +132,8 @@ ext {
|
||||
crashreport : "com.mogo.test:crashreport:${CRASHREPORT_VERSION}",
|
||||
crashreportapmbyte : "com.mogo.test:crashreport-apmbyte:${CRASHREPORT_APMBYTE_VERSION}",
|
||||
crashreportnoop : "com.mogo.test:crashreport-noop:${CRASHREPORT_NOOP_VERSION}",
|
||||
apm_insight : 'com.volcengine:apm_insight:1.4.9.cn-rc.5',
|
||||
apm_insight_crash : 'com.volcengine:apm_insight_crash:1.4.6-rc.14',
|
||||
apm_insight : 'com.volcengine:apm_insight:1.4.10.cn-rc.0',
|
||||
apm_insight_crash : 'com.volcengine:apm_insight_crash:1.4.6-rc.17',
|
||||
cicle_indicator : 'me.relex:circleindicator:2.1.6',
|
||||
|
||||
//========================= TTS语音 Maven 版本管理 =========================
|
||||
|
||||
@@ -109,7 +109,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
override fun onCurrentVersion(version: MogoObuSystemBConfigData) {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "onCurrentVersion version = ${version.version}")
|
||||
if (!version.version.isNullOrEmpty()) {
|
||||
CallerObuInfoListenerManager.invokeObuVersionName(version.version)
|
||||
CallerDevaToolsManager.queryObuUpgrade(version.version)
|
||||
}
|
||||
}
|
||||
@@ -200,7 +199,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
* @param data 系统状态
|
||||
*/
|
||||
override fun onObuSystemStatus(data: MogoObuSystemStatusData?) {
|
||||
|
||||
CallerObuInfoListenerManager.invokeGetObuInfo(data.toString())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -152,8 +152,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
//OBU连接状态
|
||||
private var obuConnectStatus: Boolean = false
|
||||
private var mObuVersionName: String = ""
|
||||
private var mObuDeviceId: String = ""
|
||||
private var mObuInfoStr: String = ""
|
||||
|
||||
//渠道包标签
|
||||
private var onlineSelected: Boolean = true
|
||||
@@ -574,7 +573,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
setLogCheckedChangeListener()
|
||||
|
||||
//OBU配置信息
|
||||
tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString()
|
||||
// tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString()
|
||||
|
||||
//工控机配置信息
|
||||
tvAutopilotInfo.text =
|
||||
@@ -1537,7 +1536,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}"
|
||||
)
|
||||
|
||||
|
||||
tvServerSocketStatus.text = Html.fromHtml(
|
||||
"服务器Socket状态:${
|
||||
if (MogoStatusManager.getInstance().isSocketOnLine) {
|
||||
@@ -1645,10 +1643,8 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbIsDemoMode.text = "开启美化模式"
|
||||
}
|
||||
|
||||
//obu TODO 后面会添加很多os那边需要显示的内容
|
||||
obuVersionNameTv.text = Html.fromHtml(
|
||||
"OBU版本号:$mObuVersionName"
|
||||
)
|
||||
//obu信息,排查obu相关问题使用
|
||||
tvObuInfoContent.text = mObuInfoStr
|
||||
|
||||
obuConnectStatusTv.text = Html.fromHtml(
|
||||
"OBU连接状态:${
|
||||
@@ -1667,7 +1663,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
|
||||
@@ -2058,12 +2054,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
setLogCheckedChangeListener()
|
||||
}
|
||||
|
||||
override fun onGetObuVersionName(obuVersionName: String) {
|
||||
mObuVersionName = obuVersionName
|
||||
override fun onGetObuInfo(obuInfoStr: String) {
|
||||
mObuInfoStr = obuInfoStr
|
||||
}
|
||||
|
||||
override fun onObuDeviceId(obuDeviceId: String) {
|
||||
mObuDeviceId = obuDeviceId
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1086,16 +1086,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"
|
||||
@@ -1104,31 +1104,33 @@
|
||||
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:text="OBU信息:"
|
||||
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/tvObuInfoContent"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -125,7 +125,7 @@ public class TrackManager {
|
||||
cellIdCaches.forcePut(uuid, trackObj.getCellIdPos());
|
||||
mMarkersCaches.put(uuid, trackObj);
|
||||
trafficDataUuid.add(uuid);
|
||||
Log.i("costTime","" + (System.currentTimeMillis() - cost));
|
||||
//Log.i("costTime","" + (System.currentTimeMillis() - cost));
|
||||
}
|
||||
return mFilterTrafficData;
|
||||
}
|
||||
|
||||
@@ -9,14 +9,8 @@ package com.mogo.eagle.core.function.api.datacenter.obu
|
||||
interface IMoGoObuInfoListener {
|
||||
|
||||
/**
|
||||
* @param obuVersionName OBU硬件版本
|
||||
* @param obuInfoStr OBU信息
|
||||
*/
|
||||
fun onGetObuVersionName(obuVersionName: String)
|
||||
|
||||
/**
|
||||
* obuDeviceId
|
||||
*/
|
||||
fun onObuDeviceId(obuDeviceId: String)
|
||||
|
||||
fun onGetObuInfo(obuInfoStr: String)
|
||||
|
||||
}
|
||||
@@ -9,25 +9,12 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
*/
|
||||
object CallerObuInfoListenerManager : CallerBase<IMoGoObuInfoListener>() {
|
||||
|
||||
fun invokeObuVersionName(obuVersionName: String) {
|
||||
fun invokeGetObuInfo(obuInfoStr: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onGetObuVersionName(obuVersionName)
|
||||
listener.onGetObuInfo(obuInfoStr)
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeObuDeviceId(obuDeviceId: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onObuDeviceId(obuDeviceId)
|
||||
}
|
||||
}
|
||||
|
||||
// fun invokeQueryContainersResponse(dockerList: List<String>) {
|
||||
// M_LISTENERS.forEach {
|
||||
// val listener = it.value
|
||||
// //TODO
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4
|
||||
LOGLIB_VERSION=1.5.11
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.4.5.7
|
||||
MOGO_NETWORK_VERSION=1.4.5.10
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.4.5.7
|
||||
MOGO_PASSPORT_VERSION=1.4.5.10
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.4.5.7
|
||||
MOGO_SOCKET_VERSION=1.4.5.10
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.4.5.7
|
||||
MOGO_REALTIME_VERSION=1.4.5.10
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.4.5.7
|
||||
MOGO_TANLU_VERSION=1.4.5.10
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.4.5.7
|
||||
MOGO_LIVE_VERSION=1.4.5.10
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.5.7
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.5.10
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.4.5.7
|
||||
MOGO_LOCATION_VERSION=1.4.5.10
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.4.5.7
|
||||
MOGO_TELEMATIC_VERSION=1.4.5.10
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.10.0.9
|
||||
|
||||
@@ -4,7 +4,6 @@ import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_INIT_ON_MAP_LOADED;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_INIT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.Logger.d;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS;
|
||||
@@ -41,8 +40,8 @@ import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
@@ -168,17 +167,19 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
MapAutoViewHelper options = mMapView.getMapAutoViewHelper();
|
||||
if (options != null) {
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
ThreadUtils.getIoPool().submit(() -> {
|
||||
if (options != null) {
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
// options.setAllGesturesEnabled(false); //禁止全部手势
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
}
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
}
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
|
||||
@@ -77,7 +77,7 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
|
||||
|
||||
// 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等
|
||||
mapLocation?.let {
|
||||
aMapLocation.let {
|
||||
// 转换 GCJ02-->WGS84 坐标
|
||||
val wgs84Location =
|
||||
CoordinateTransform.GCJ02ToWGS84(it.longitude, it.latitude)
|
||||
@@ -112,17 +112,17 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
lastGaoDeLocation.errorInfo = it.errorInfo
|
||||
}
|
||||
|
||||
// 回掉给监听者
|
||||
CallerGaoDeMapLocationListenerManager.invokeMoGoLocationChanged(lastGaoDeLocation)
|
||||
|
||||
mapLocation = aMapLocation
|
||||
// 本地SP缓存城市Code
|
||||
val cityCode = aMapLocation.cityCode
|
||||
if (cityCode != null && cityCode.isNotEmpty()) {
|
||||
mCityCode = aMapLocation.cityCode
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
|
||||
try {
|
||||
mapLocation = aMapLocation
|
||||
// 本地SP缓存城市Code
|
||||
val cityCode = aMapLocation.cityCode
|
||||
if (cityCode != null && cityCode.isNotEmpty()) {
|
||||
mCityCode = aMapLocation.cityCode
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
|
||||
}
|
||||
|
||||
// 缓存经纬度
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(
|
||||
SharedPrefsConstants.LOCATION_LATITUDE,
|
||||
@@ -133,7 +133,11 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
SharedPrefsConstants.LOCATION_LONGITUDE,
|
||||
aMapLocation.longitude.toString()
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
// 回掉给监听者
|
||||
CallerGaoDeMapLocationListenerManager.invokeMoGoLocationChanged(lastGaoDeLocation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.mogo.test.crashreport.apm;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.apm.insight.AttachUserData;
|
||||
import com.apm.insight.CrashType;
|
||||
import com.apm.insight.MonitorCrash;
|
||||
import com.apm.insight.log.VLog;
|
||||
import com.bytedance.apm.insight.ApmInsight;
|
||||
@@ -12,8 +10,9 @@ import com.bytedance.apm.insight.ApmInsightAgent;
|
||||
import com.bytedance.apm.insight.ApmInsightInitConfig;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.CarInfo;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.CarInfo;
|
||||
import com.mogo.eagle.core.function.api.devatools.apm.IApmEnvProvider;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
@@ -22,11 +21,11 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.CommonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.MetaDataUtils;
|
||||
import com.mogo.test.crashreport.CrashReportConstants;
|
||||
import com.mogo.test.crashreport.ITestCrashReportProvider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,7 +37,9 @@ import java.util.Map;
|
||||
@Route(path = CrashReportConstants.PATH)
|
||||
public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
private static final String BYTEAMP_APPID = "302368";
|
||||
private static final String BYTEAMP_AppToken = "de428a1a8b204c82ac60088aaf9205a3";
|
||||
private static final String BYTEAMP_APPID_DEV = "379950";
|
||||
private static final String BYTEAMP_AppToken_DEV = "3a78191bc18842118c5b4515ec9bfefc";
|
||||
|
||||
private static final String TAG = "ApmCrashReportProvider";
|
||||
private static final String MAP_SDK_VERSION = "MAP_SDK_VERSION";
|
||||
@@ -49,11 +50,6 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
initCrash(context);
|
||||
initApmInsight(context);
|
||||
}
|
||||
|
||||
private void initCrash(final Context context) {
|
||||
IApmEnvProvider provider = CallerDevaToolsManager.INSTANCE.apmEnvProvider();
|
||||
boolean isDebug = DebugConfig.isDebug();
|
||||
if (provider != null) {
|
||||
@@ -62,85 +58,167 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
isDebug = enabled;
|
||||
}
|
||||
}
|
||||
MonitorCrash crash = MonitorCrash.init(context, isDebug ? BYTEAMP_APPID_DEV : BYTEAMP_APPID, CommonUtils.getVersionCode(context), CommonUtils.getVersionName(context))
|
||||
.setCustomDataCallback(new AttachUserData() {
|
||||
@Override
|
||||
public Map<? extends String, ? extends String> getUserData(CrashType type) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
//车辆信息
|
||||
String carInfoString = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO);
|
||||
initCrash(context, isDebug);
|
||||
initApmInsight(context, isDebug);
|
||||
}
|
||||
|
||||
if (carInfoString != null && !carInfoString.isEmpty()) {
|
||||
mInfo = GsonUtils.fromJson(carInfoString, CarInfo.class);
|
||||
}
|
||||
private void initCrash(final Context context, boolean isDebug) {
|
||||
MonitorCrash.Config config =
|
||||
MonitorCrash.Config
|
||||
.app(isDebug ? BYTEAMP_APPID_DEV : BYTEAMP_APPID)
|
||||
.token(isDebug ? BYTEAMP_AppToken_DEV : BYTEAMP_AppToken)// 设置鉴权token,可从平台应用信息处获取,token错误无法上报数据
|
||||
.versionCode(CommonUtils.getVersionCode(context))// 可选,默认取PackageInfo中的versionCode
|
||||
.versionName(CommonUtils.getVersionName(context))// 可选,默认取PackageInfo中的versionName
|
||||
.channel(MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"))// 可选,设置App发布渠道,在平台可以筛选
|
||||
// .url("www.xxx.com")// 默认不需要,私有化部署才配置上报地址
|
||||
//可选,可以设置自定义 did,不设置会使用内部默认的
|
||||
.dynamicParams(new MonitorCrash.Config.IDynamicParams() {
|
||||
@Override
|
||||
public String getDid() {//返回空会使用内部默认的did
|
||||
String sn = SharedPrefsMgr.getInstance(context).getString("sn");
|
||||
if (sn != null && !sn.isEmpty()) {
|
||||
return sn;
|
||||
} else {
|
||||
return DeviceUtils.getDeviceSN().isEmpty() ? null : DeviceUtils.getDeviceSN();
|
||||
}
|
||||
}
|
||||
|
||||
//车辆所在位置
|
||||
mCityCode = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_CITY_CODE);
|
||||
mLat = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LATITUDE);
|
||||
mLogt = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LONGITUDE);
|
||||
//地图版本
|
||||
String mapSDKVersion = DebugConfig.getMapVersion();
|
||||
map.put("MAP_SDK_VERSION", mapSDKVersion);
|
||||
map.put("CITYCODE", mCityCode);
|
||||
map.put("LATITUDE", mLat);
|
||||
map.put("LONGITUTE", mLogt);
|
||||
@Override
|
||||
public String getUserId() {
|
||||
return DeviceUtils.getDeviceSN();
|
||||
}
|
||||
})
|
||||
//应用崩溃后会执行这里,可选,添加业务自定义数据,在崩溃详情页->现场数据展示->自定义数据
|
||||
.customData(crashType -> {
|
||||
//车辆所在位置
|
||||
mCityCode = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_CITY_CODE);
|
||||
mLat = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LATITUDE);
|
||||
mLogt = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LONGITUDE);
|
||||
//车辆信息
|
||||
String carInfoString = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO);
|
||||
if (carInfoString != null && !carInfoString.isEmpty()) {
|
||||
mInfo = GsonUtils.fromJson(carInfoString, CarInfo.class);
|
||||
}
|
||||
|
||||
if (mInfo != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "nuber = " + mInfo.getNumber_plate() + "--brand = " + mInfo.getBrand() + "--modle = " + mInfo.getModel());
|
||||
map.put("PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
map.put("BRAND", mInfo.getBrand());
|
||||
map.put("MODEL", mInfo.getModel());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
});
|
||||
String mapSDKVersion = DebugConfig.getMapVersion();
|
||||
crash.config().setChannel("MAP_SDK_VERSION:" + mapSDKVersion);
|
||||
//可选,可以设置自定义did,不设置会使用内部默认的
|
||||
String sn = SharedPrefsMgr.getInstance(context).getString("sn");
|
||||
if (sn != null && !sn.isEmpty()) {
|
||||
crash.config().setDeviceId(sn);
|
||||
} else {
|
||||
crash.config().setDeviceId(DeviceUtils.getDeviceSN());
|
||||
}
|
||||
crash.addTags(MAP_SDK_VERSION, mapSDKVersion);
|
||||
crash.addTags("CITYCODE", mCityCode);
|
||||
crash.addTags("LATITUDE", mLat);
|
||||
crash.addTags("LONGITUTE", mLogt);
|
||||
crash.addTags("CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
|
||||
//======================================== 自定义维度值 begin========================================
|
||||
HashMap<String, String> dimension = new HashMap<>();
|
||||
// dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceUtils.getDeviceSN());
|
||||
// dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
// dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
// Git版本信息
|
||||
dimension.put("GIT_BRANCH", AppConfigInfo.INSTANCE.getWorkingBranchName());
|
||||
dimension.put("GIT_HASH", AppConfigInfo.INSTANCE.getWorkingBranchHash());
|
||||
// 地图版本
|
||||
dimension.put("APP_MAP_SDK_VERSION", DebugConfig.getMapVersion());
|
||||
// 渠道信息
|
||||
dimension.put("APP_CHANNEL", MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
|
||||
// 车辆类型
|
||||
dimension.put("APP_CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
|
||||
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
|
||||
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
// 连接的OBU 状态
|
||||
dimension.put("OBU_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectObu());
|
||||
// 车牌号,从工控机获取的数据
|
||||
dimension.put("IPC_PLATE_NUMBER", AppConfigInfo.INSTANCE.getPlateNumber());
|
||||
// 连接的工控机 状态
|
||||
dimension.put("IPC_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectAutopilot());
|
||||
// 连接的工控机 MAC地址
|
||||
dimension.put("IPC_MAC", AppConfigInfo.INSTANCE.getIPCMacAddress());
|
||||
// 连接的工控机 Docker版本
|
||||
dimension.put("IPC_MAP_VERSION", AppConfigInfo.INSTANCE.getDockerVersion());
|
||||
// 连接的工控机 Protocol版本
|
||||
dimension.put("IPC_MAP_PROTOCOL_VERSION", "" + AppConfigInfo.INSTANCE.getProtocolVersionNumber());
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
|
||||
HashMap<String, String> dimension = new HashMap<>();
|
||||
//维度值
|
||||
dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceUtils.getDeviceSN());
|
||||
// dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
// dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
dimension.put(MAP_SDK_VERSION, mapSDKVersion);
|
||||
dimension.put("CITYCODE", mCityCode);
|
||||
dimension.put("LATITUDE", mLat);
|
||||
dimension.put("LONGITUTE", mLogt);
|
||||
if (mInfo != null) {
|
||||
dimension.put("PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
dimension.put("BRAND", mInfo.getBrand());
|
||||
dimension.put("MODEL", mInfo.getModel());
|
||||
}
|
||||
//************************************* 位置信息 ***********************************************
|
||||
// 城市信息
|
||||
dimension.put("LOCATION_CITY_CODE", mCityCode);
|
||||
dimension.put("LOCATION_LATITUDE", mLat);
|
||||
dimension.put("LOCATION_LONGITUTE", mLogt);
|
||||
//************************************* 位置信息 ***********************************************
|
||||
|
||||
HashMap<String, Double> metric = new HashMap<>();
|
||||
//指标值
|
||||
//metric.put("Devices_ID_metric", (double) 100);
|
||||
ApmInsightAgent.monitorEvent("Devices_ID_EVENT", dimension, metric);
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
if (mInfo != null) {
|
||||
dimension.put("CMDB_PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
dimension.put("CMDB_BRAND", mInfo.getBrand());
|
||||
dimension.put("CMDB_MODEL", mInfo.getModel());
|
||||
}
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
|
||||
HashMap<String, Double> metric = new HashMap<>();
|
||||
//指标值
|
||||
//metric.put("Devices_ID_metric", (double) 100);
|
||||
ApmInsightAgent.monitorEvent("Devices_ID_EVENT", dimension, metric);
|
||||
//======================================== 自定义维度值 end========================================
|
||||
|
||||
|
||||
//===================================== 自定义收集一些信息,在崩溃详情页->现场数据展示->自定义数据 begin========================================
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
// Git版本信息
|
||||
map.put("GIT_BRANCH", AppConfigInfo.INSTANCE.getWorkingBranchName());
|
||||
map.put("GIT_HASH", AppConfigInfo.INSTANCE.getWorkingBranchHash());
|
||||
// 地图版本
|
||||
map.put("APP_MAP_SDK_VERSION", DebugConfig.getMapVersion());
|
||||
// 渠道信息
|
||||
map.put("APP_CHANNEL", MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
|
||||
// 车辆类型
|
||||
map.put("APP_CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
// 连接的OBU 状态
|
||||
map.put("OBU_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectObu());
|
||||
// 车牌号,从工控机获取的数据
|
||||
map.put("IPC_PLATE_NUMBER", AppConfigInfo.INSTANCE.getPlateNumber());
|
||||
// 连接的工控机 状态
|
||||
map.put("IPC_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectAutopilot());
|
||||
// 连接的工控机 MAC地址
|
||||
map.put("IPC_MAC", AppConfigInfo.INSTANCE.getIPCMacAddress());
|
||||
// 连接的工控机 Docker版本
|
||||
map.put("IPC_MAP_VERSION", AppConfigInfo.INSTANCE.getDockerVersion());
|
||||
// 连接的工控机 Protocol版本
|
||||
map.put("IPC_MAP_PROTOCOL_VERSION", "" + AppConfigInfo.INSTANCE.getProtocolVersionNumber());
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
|
||||
//************************************* 位置信息 ***********************************************
|
||||
// 城市信息
|
||||
map.put("LOCATION_CITY_CODE", mCityCode);
|
||||
map.put("LOCATION_LATITUDE", mLat);
|
||||
map.put("LOCATION_LONGITUTE", mLogt);
|
||||
//************************************* 位置信息 ***********************************************
|
||||
|
||||
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
if (mInfo != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "nuber = " + mInfo.getNumber_plate() + "--brand = " + mInfo.getBrand() + "--modle = " + mInfo.getModel());
|
||||
map.put("CMDB_PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
map.put("CMDB_BRAND", mInfo.getBrand());
|
||||
map.put("CMDB_MODEL", mInfo.getModel());
|
||||
}
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
|
||||
return map;
|
||||
//===================================== 自定义收集一些信息,在崩溃详情页->现场数据展示->自定义数据 end========================================
|
||||
})
|
||||
// 可选,添加pv事件的自定义tag,可以用来筛选崩溃率计算的分母数据
|
||||
//.pageViewTags(<<Map<String, String>>>)
|
||||
.build();
|
||||
MonitorCrash monitorCrash = MonitorCrash.init(context, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* ApmInsight性能监控初始化
|
||||
*/
|
||||
private void initApmInsight(Context context) {
|
||||
|
||||
private void initApmInsight(Context context, boolean isDebug) {
|
||||
ApmInsightInitConfig.Builder builder = ApmInsightInitConfig.builder();
|
||||
//设置分配的appid
|
||||
builder.aid(BYTEAMP_APPID);
|
||||
builder.aid(isDebug ? BYTEAMP_APPID_DEV : BYTEAMP_APPID);
|
||||
//设置分配的AppToken
|
||||
builder.token(isDebug ? BYTEAMP_AppToken_DEV : BYTEAMP_AppToken);
|
||||
//是否开启卡顿功能
|
||||
builder.blockDetect(true);
|
||||
//是否开启严重卡顿功能
|
||||
@@ -153,6 +231,12 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
builder.memoryMonitor(true);
|
||||
//控制是否打开电量监控
|
||||
builder.batteryMonitor(true);
|
||||
//控制是否打开CPU监控
|
||||
builder.cpuMonitor(true);
|
||||
//控制是否打开磁盘监控
|
||||
builder.diskMonitor(true);
|
||||
//控制是否打开流量监控
|
||||
builder.trafficMonitor(true);
|
||||
//是否打印日志,注:线上release版本要配置为false
|
||||
builder.debugMode(true);
|
||||
//支持用户自定义user_id把平台数据和自己用户关联起来,可以不配置
|
||||
@@ -160,7 +244,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
//私有化部署:配置数据上报的域名 (私有化部署才需要配置,内部有默认域名),测试支持设置http://www.xxx.com 默认是https协议
|
||||
// builder.defaultReportDomain("www.xxx.com");
|
||||
//设置渠道。1.3.16版本增加接口
|
||||
builder.channel("local");
|
||||
builder.channel(MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
|
||||
//打开自定义日志回捞能力,1.4.1版本新增接口
|
||||
builder.enableLogRecovery(true);
|
||||
//设置数据和Rangers Applog数据打通,设备标识did必填。1.3.16版本增加接口
|
||||
|
||||
Reference in New Issue
Block a user