diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt index b4dd06db5a..7037828edf 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt @@ -25,7 +25,6 @@ object AppIdentityModeUtils { private const val SWEEPER = "Sweeper" - private fun getInfo(appIdentityMode: String): Array { val split = appIdentityMode.split("_") if (split.size == 3) { @@ -34,6 +33,14 @@ object AppIdentityModeUtils { return arrayOf("", "", "") } + fun getBuildCarType(appIdentityMode: String): String { + val (_, _, carType) = getInfo(appIdentityMode) + if(carType.isNotEmpty()){ + return carType + } + return "" + } + /** * 是否是 司机端(这里不细分具体是:小巴、出租车等类型) * @@ -43,7 +50,7 @@ object AppIdentityModeUtils { @JvmStatic fun isDriver(appIdentityMode: String): Boolean { val (_, identity, _) = getInfo(appIdentityMode) - if (!identity.isEmpty()) { + if (identity.isNotEmpty()) { return identity == DRIVER } return false @@ -58,7 +65,7 @@ object AppIdentityModeUtils { @JvmStatic fun isPassenger(appIdentityMode: String): Boolean { val (_, identity, _) = getInfo(appIdentityMode) - if (!identity.isEmpty()) { + if (identity.isNotEmpty()) { return identity == PASSENGER } return false @@ -73,7 +80,7 @@ object AppIdentityModeUtils { @JvmStatic fun isBus(appIdentityMode: String): Boolean { val (bussness, _, _) = getInfo(appIdentityMode) - if (!bussness.isEmpty()) { + if (bussness.isNotEmpty()) { return bussness == BUS } return false @@ -88,7 +95,7 @@ object AppIdentityModeUtils { @JvmStatic fun isSweeper(appIdentityMode: String): Boolean { val (bussness, _, _) = getInfo(appIdentityMode) - if (!bussness.isEmpty()) { + if (bussness.isNotEmpty()) { return bussness == SWEEPER } return false @@ -103,7 +110,7 @@ object AppIdentityModeUtils { @JvmStatic fun isTaxi(appIdentityMode: String): Boolean { val (bussness, _, _) = getInfo(appIdentityMode) - if (!bussness.isEmpty()) { + if (bussness.isNotEmpty()) { return bussness == TAXI } return false diff --git a/test/crashreport-apmbyte/src/main/java/com/mogo/test/crashreport/apm/ApmCrashReportProvider.java b/test/crashreport-apmbyte/src/main/java/com/mogo/test/crashreport/apm/ApmCrashReportProvider.java index ac22671363..ac143c2920 100644 --- a/test/crashreport-apmbyte/src/main/java/com/mogo/test/crashreport/apm/ApmCrashReportProvider.java +++ b/test/crashreport-apmbyte/src/main/java/com/mogo/test/crashreport/apm/ApmCrashReportProvider.java @@ -13,6 +13,8 @@ import com.bytedance.apm.insight.ApmInsightInitConfig; import com.mogo.commons.constants.SharedPrefsConstants; import com.mogo.commons.debug.DebugConfig; import com.mogo.eagle.core.data.bindingcar.CarInfo; +import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.CommonUtils; @@ -96,6 +98,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider { crash.addTags("CITYCODE", mCityCode); crash.addTags("LATITUDE", mLat); crash.addTags("LONGITUTE", mLogt); + crash.addTags("CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode)); // crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址 // crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖