diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java index 117ca80f85..46dd3a6b50 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java @@ -333,6 +333,11 @@ public class BusPassengerModel { private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){ + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index 3f09f3ab14..f657813645 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -267,6 +267,11 @@ public class BusPresenter extends Presenter onAutopilotStatusResponse(info); } + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) { BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo); diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java index 6f3e5c5281..a00b559fe2 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java @@ -162,6 +162,11 @@ public class SweeperPresenter extends Presenter } + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) { if (autopilotStatusInfo == null) return; diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java index 37c153bc23..e185cc829f 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java @@ -498,6 +498,10 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){ + @Override + public void onAutopilotRouteLineId(long lineId) { + + } @Override public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java index 1acf8e307c..cee492c584 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java @@ -1146,6 +1146,11 @@ public class TaxiModel { private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() { + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } diff --git a/ZD_README/README_VersionHistory.md b/ZD_README/README_VersionHistory.md index aa6e59dedd..73cb553140 100644 --- a/ZD_README/README_VersionHistory.md +++ b/ZD_README/README_VersionHistory.md @@ -79,9 +79,7 @@ skinsupportimpl : "com.mogo.skin:skin-support-impl:${MOGO_COMMONS_V skinsupportnoop : "com.mogo.skin:skin-support-noop:${MOGO_COMMONS_VERSION}", skinsupportlight : "com.mogo.skin:skin-light:${MOGO_COMMONS_VERSION}", crashreport : "com.mogo.test:crashreport:${MOGO_COMMONS_VERSION}", -crashreportbugly : "com.mogo.test:crashreport-bugly:${MOGO_COMMONS_VERSION}", crashreportnoop : "com.mogo.test:crashreport-noop:${MOGO_COMMONS_VERSION}", -crashreportupgrade : "com.mogo.test:crashreport-upgrade:${MOGO_COMMONS_VERSION}", skinsupportbase : "com.mogo.skin:skin-support-base:${MOGO_COMMONS_VERSION}", skinsupportappcompat : "com.mogo.skin:skin-support-appcompat:${MOGO_COMMONS_VERSION}", skinsupportcardview : "com.mogo.skin:skin-support-cardview:${MOGO_COMMONS_VERSION}", diff --git a/app/src/main/java/com/mogo/launcher/stageone/APMStartup.kt b/app/src/main/java/com/mogo/launcher/stageone/APMStartup.kt index b3a3d8345a..33d13a30a7 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/APMStartup.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/APMStartup.kt @@ -3,13 +3,10 @@ package com.mogo.launcher.stageone import android.content.Context import com.rousetime.android_startup.AndroidStartup import com.alibaba.android.arouter.launcher.ARouter -import com.mogo.test.crashreport.upgrade.UpgradeReportConstants import com.mogo.test.crashreport.CrashReportConstants class APMStartup : AndroidStartup() { override fun create(context: Context): Boolean? { - // bugly - ARouter.getInstance().build(UpgradeReportConstants.PATH).navigation() // apm ARouter.getInstance().build(CrashReportConstants.PATH).navigation() return true diff --git a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt index dd5ef2f13b..13cc882668 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt @@ -113,7 +113,7 @@ class HttpDnsStartUp : AndroidStartup() { // 使用中台长链接 clientConfig.isUseOriginSocket = true // 设置是否输出网络日志 - clientConfig.isShowNetDebugLog = false + clientConfig.isShowNetDebugLog = true // 设置是否是直播推流的主播 clientConfig.isAnchor = true when (DebugConfig.getCarMachineType()) { diff --git a/config.gradle b/config.gradle index ee629f5b6b..2f1b8ba59f 100644 --- a/config.gradle +++ b/config.gradle @@ -149,10 +149,8 @@ ext { mogologlib : "com.mogo.module:module-loglib:${LOGLIB_VERSION}", kotlingradleplugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}", crashreport : "com.mogo.test:crashreport:${CRASHREPORT_VERSION}", - crashreportbugly : "com.mogo.test:crashreport-bugly:${CRASHREPORT_BUGLY_VERSION}", crashreportapmbyte : "com.mogo.test:crashreport-apmbyte:${CRASHREPORT_APMBYTE_VERSION}", crashreportnoop : "com.mogo.test:crashreport-noop:${CRASHREPORT_NOOP_VERSION}", - crashreportupgrade : "com.mogo.test:crashreport-upgrade:${CRASHREPORT_UPGRADE_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', cicle_indicator : 'me.relex:circleindicator:2.1.6', diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java index 72a42c653c..7774d55b64 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java @@ -350,4 +350,9 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener implement } + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + private void updateConnectInfoView(@NonNull AutopilotStatusInfo autoPilotStatusInfo) { if (!isFloatingLayerHidden) {// 遮罩层显示的时候 mConnAdapter.updateData(autoPilotStatusInfo); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java index 74ebc44c12..68c36320b3 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java @@ -124,4 +124,9 @@ public class MogoRouteOverlayManager implements @Override public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {} + + @Override + public void onAutopilotRouteLineId(long lineId) { + + } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java index c8b5804dd4..5fe40afaf7 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java @@ -196,4 +196,9 @@ public class SmallMapFragment extends BaseFragment public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) { } + + @Override + public void onAutopilotRouteLineId(long lineId) { + + } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/LineUploadManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/LineUploadManager.kt index 9538562e7d..9f70f2a4ff 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/LineUploadManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/LineUploadManager.kt @@ -1,20 +1,27 @@ package com.mogo.eagle.core.function.v2x import android.content.Context +import android.util.Log import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.commons.constants.HostConst +import com.mogo.commons.constants.HostConst.DATA_CENTER_HOST +import com.mogo.commons.debug.DebugConfig +import com.mogo.eagle.core.data.BaseResponse import com.mogo.eagle.core.data.v2x.LineUploadData +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.v2x.events.network.V2XRefreshModel import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi import com.mogo.eagle.core.network.MoGoRetrofitFactory +import com.mogo.eagle.core.network.apiCall +import com.mogo.eagle.core.network.request import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable import io.reactivex.schedulers.Schedulers import kotlin.properties.Delegates -class LineUploadManager private constructor(context: Context) { +class LineUploadManager private constructor(context: Context) : IMoGoAutopilotStatusListener { companion object { @@ -43,33 +50,44 @@ class LineUploadManager private constructor(context: Context) { mContext = context } - private var lineId: Long? by Delegates.observable( - CallerAutoPilotStatusListenerManager - .getAutoPilotStatusInfo().autopilotControlParameters?.autoPilotLine?.lineId - ) { _, _, newValue -> - CallerLogger.d(TAG, " old line : $lineId , new line : $newValue") - lineId = newValue -// uploadLine() + fun init(){ + Log.d("emArrow","LineUploadManager addListener") + CallerAutoPilotStatusListenerManager.addListener(TAG, this) } - private fun uploadLine() { - lineId?.let { - val lineUploadData = LineUploadData(it, MoGoAiCloudClientConfig.getInstance().sn) - disposable = MoGoRetrofitFactory.getInstance(HostConst.getHost()) //todo 改域名 - .create(V2XEventServiceApi::class.java) - .uploadLineId(lineUploadData) - .retry(3) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe { data -> - CallerLogger.d(TAG, " uploadLine : $data") - } + private fun getHost(): String { + return when (DebugConfig.getNetMode()) { + DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_QA -> "http://dzt-test.zhidaozhixing.com/" + DebugConfig.NET_MODE_RELEASE -> "http://dzt.zhidaozhixing.com/" + else -> "http://dzt.zhidaozhixing.com/" } } + override fun onAutopilotRouteLineId(lineId: Long) { + super.onAutopilotRouteLineId(lineId) + if (lineId > 0) { + uploadLine(lineId) + } + } + + private fun uploadLine(lineId: Long) { + val lineUploadData = LineUploadData(lineId, MoGoAiCloudClientConfig.getInstance().sn) + disposable = MoGoRetrofitFactory.getInstance(DATA_CENTER_HOST) + .create(V2XEventServiceApi::class.java) + .uploadLineId(lineUploadData) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe ({ data -> + Log.d("emArrow", " uploadLine : $data") + },{ + Log.d("emArrow", "e : ${it.message}") + }) + } + fun onDestroy() { mContext = null disposable?.dispose() + CallerAutoPilotStatusListenerManager.removeListener(TAG) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt index b2345e8b84..db01053a32 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt @@ -29,7 +29,10 @@ class V2XProvider : IV2XEventProvider { SpeedLimitDataManager.getInstance().start() TrafficLightDispatcher.INSTANCE.initServer(context) SpeedLimitDispatcher.INSTANCE.initLimit(context) - LineUploadManager.getInstance(context) + + if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ + LineUploadManager.getInstance(context)?.init() + } if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { //不处理 @@ -52,9 +55,13 @@ class V2XProvider : IV2XEventProvider { } else { V2XEventManager.onDestroy() } - mContext?.let { - LineUploadManager.getInstance(it)?.onDestroy() + + if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ + mContext?.let { + LineUploadManager.getInstance(it)?.onDestroy() + } } + // RedLightWarningManager.INSTANCE.onDestroy() } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt index e08ffaead1..d24d0cdce1 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt @@ -1,6 +1,7 @@ package com.mogo.eagle.core.function.v2x.road import com.mogo.eagle.core.data.BaseData +import com.mogo.eagle.core.data.BaseResponse import com.mogo.eagle.core.data.v2x.LineUploadData import io.reactivex.Observable import retrofit2.http.* @@ -11,7 +12,7 @@ interface V2XEventServiceApi { fun queryAllV2XEventsByLineId(@Query("lineId") lineId: String, @Query("sn") sn: String): Observable @Headers("Content-type:application/json;charset=UTF-8" ) - @POST( "" ) + @POST( "/yycp-data-center-service/carTrack/receiveCarTrack/") fun uploadLineId(@Body lineId: LineUploadData): Observable } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt index 73aa0a4baa..4bb3e99cfe 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt @@ -45,7 +45,12 @@ interface IMoGoAutopilotStatusListener { /** * 工控机主动查询 AdasManager#sendStatusQueryReq(),后会收到如下回调 */ - fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) { } + fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {} + + /** + * 自动驾驶路线ID回调 + */ + fun onAutopilotRouteLineId(lineId: Long){} companion object { /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index 60056dc1a2..0e42e27b27 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -1,15 +1,18 @@ package com.mogo.eagle.core.function.call.autopilot +import android.util.Log import androidx.annotation.Nullable import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.util.GsonUtils import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg import system_master.* import java.util.concurrent.ConcurrentHashMap +import kotlin.properties.Delegates /** * @author xiaoyuzhou @@ -22,6 +25,16 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { @Volatile private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo() + private var lineId: Long? by Delegates.observable(0) { _, _, newValue -> + if(newValue == null){ + return@observable + } + M_AUTOPILOT_STATUS_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotRouteLineId(newValue) + } + } + // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap = ConcurrentHashMap() @@ -209,6 +222,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { */ fun updateAutopilotControlParameters(autopilotControlParameters: AutopilotControlParameters? = null) { mAutopilotStatusInfo.autopilotControlParameters = autopilotControlParameters + lineId = autopilotControlParameters?.autoPilotLine?.lineId invokeAutoPilotStatus(mAutopilotStatusInfo) } } \ No newline at end of file diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java index d4168cb1d5..42298f91dc 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java @@ -12,6 +12,7 @@ public class HostConst { public static final String CAMERA_STREAM_HOST = "http://dzt-smartTransportationAiCloud.zhidaozhixing.com"; public static final String OPEN_CAMERA_STREAM_HOST = "http://10.0.16.6:18080"; + public static final String DATA_CENTER_HOST = "http://dzt-data-center.zhidaozhixing.com"; public static final String CITY_HOST = "http://dzt-city.zhidaozhixing.com"; public static final String SOCKET_CENTER_DOMAIN = "socketRegion"; diff --git a/gradle.properties b/gradle.properties index ae4ebc51b8..05094db3c7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -131,10 +131,8 @@ MOGO_MODULE_V2X_VERSION=2.1.16.10 MOGO_MODULE_OBU_MOGO_VERSION=2.1.16.10 # bugly CRASHREPORT_VERSION=2.1.16.10 -CRASHREPORT_BUGLY_VERSION=2.1.16.10 CRASHREPORT_NOOP_VERSION=2.1.16.10 CRASHREPORT_APMBYTE_VERSION=2.1.16.10 -CRASHREPORT_UPGRADE_VERSION=2.1.16.10 ## tts TTS_BASE_VERSION=2.1.16.10 TTS_DI_VERSION=2.1.16.10 diff --git a/modules.txt b/modules.txt index b952d62967..c4137f974f 100644 --- a/modules.txt +++ b/modules.txt @@ -19,7 +19,6 @@ :test:crashreport :test:crashreport-apm :test:crashreport-noop -:test:crashreport-upgrade :core:function-impl:mogo-core-function-obu-mogo :core:function-impl:mogo-core-function-check :services:mogo-service diff --git a/settings.gradle b/settings.gradle index f0b654ad1f..044d6a962e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -76,9 +76,7 @@ include ':tts:tts-pad' // 测试DEBUG include ':test:crashreport' -//include ':test:crashreport-bugly' include ':test:crashreport-noop' -include ':test:crashreport-upgrade' include ':test:crashreport-apmbyte' //OCH 业务模块 diff --git a/test/crashreport-bugly/.gitignore b/test/crashreport-bugly/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/test/crashreport-bugly/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/test/crashreport-bugly/build.gradle b/test/crashreport-bugly/build.gradle deleted file mode 100644 index aa854f978a..0000000000 --- a/test/crashreport-bugly/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-android-extensions' - id 'kotlin-kapt' - id 'com.alibaba.arouter' -} - - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - // buildToolsVersion rootProject.ext.android.buildToolsVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - ndk { - // 设置支持的SO库架构 - abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a' - } - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - - //ARouter apt 参数 - kapt { - useBuildCache = false - arguments { - arg("AROUTER_MODULE_NAME", project.getName()) - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation rootProject.ext.dependencies.androidxappcompat - - implementation rootProject.ext.dependencies.arouter - kapt rootProject.ext.dependencies.aroutercompiler - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - api rootProject.ext.dependencies.crashreport - implementation rootProject.ext.dependencies.mogo_core_utils - implementation rootProject.ext.dependencies.mogocommons - } else { - api project(":test:crashreport") - implementation project(':core:mogo-core-utils') - implementation project(":foudations:mogo-commons") - } - - implementation 'com.tencent.bugly:crashreport_upgrade:latest.release' - //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9 - implementation 'com.tencent.bugly:nativecrashreport:latest.release' - //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0 -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/test/crashreport-bugly/consumer-rules.pro b/test/crashreport-bugly/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/crashreport-bugly/gradle.properties b/test/crashreport-bugly/gradle.properties deleted file mode 100644 index 6b451eda5d..0000000000 --- a/test/crashreport-bugly/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.test -POM_ARTIFACT_ID=crashreport-bugly -VERSION_CODE=1 diff --git a/test/crashreport-bugly/proguard-rules.pro b/test/crashreport-bugly/proguard-rules.pro deleted file mode 100644 index 481bb43481..0000000000 --- a/test/crashreport-bugly/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/test/crashreport-bugly/src/main/AndroidManifest.xml b/test/crashreport-bugly/src/main/AndroidManifest.xml deleted file mode 100644 index d9f7357150..0000000000 --- a/test/crashreport-bugly/src/main/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - / - \ No newline at end of file diff --git a/test/crashreport-bugly/src/main/java/com/mogo/test/crashreport/bugly/BuglyCrashReportProvider.java b/test/crashreport-bugly/src/main/java/com/mogo/test/crashreport/bugly/BuglyCrashReportProvider.java deleted file mode 100644 index 549dee35e9..0000000000 --- a/test/crashreport-bugly/src/main/java/com/mogo/test/crashreport/bugly/BuglyCrashReportProvider.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.mogo.test.crashreport.bugly; - -import android.content.Context; -import android.text.TextUtils; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.cloud.passport.MoGoAiCloudClientConfig; -import com.mogo.commons.debug.DebugConfig; -import com.mogo.eagle.core.utilcode.util.AppUtils; -import com.mogo.test.crashreport.CrashReportConstants; -import com.mogo.test.crashreport.ITestCrashReportProvider; -import com.tencent.bugly.Bugly; -import com.tencent.bugly.crashreport.CrashReport; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; - - -/** - * @author congtaowang - * @since 2020/9/9 - * - * 描述 - */ -//@Route(path = CrashReportConstants.PATH) -public class BuglyCrashReportProvider implements ITestCrashReportProvider { - - private static final String TAG = "BuglyCrashReportProvider"; - - @Override - public void init(Context context) { - String packageName = context.getPackageName(); - String processName = getProcessName(android.os.Process.myPid()); - CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context); - strategy.setUploadProcess(processName == null || processName.equals(packageName)); - //该用户本次启动后的异常日志用户ID都将是 sn - CrashReport.setUserId(MoGoAiCloudClientConfig.getInstance().getSn()); - String productFlavor = DebugConfig.getProductFlavor(); - strategy.setAppChannel(productFlavor); - Bugly.init(context, CrashReportConstants.buglyAppID, true, strategy); - Bugly.putUserData(context, "serial", MoGoAiCloudClientConfig.getInstance().getSn()); - String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context); - Bugly.putUserData(context, "MAP_SDK_VERSION", mapSDKVersion); - } - - /** - * 获取进程号对应的进程名 - * - * @param pid 进程号 - * @return 进程名 - */ - private static String getProcessName(int pid) { - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader("/proc/" + pid + "/cmdline")); - String processName = reader.readLine(); - if (!TextUtils.isEmpty(processName)) { - processName = processName.trim(); - } - return processName; - } catch (Throwable throwable) { - throwable.printStackTrace(); - } finally { - try { - if (reader != null) { - reader.close(); - } - } catch (IOException exception) { - exception.printStackTrace(); - } - } - return null; - } -} - diff --git a/test/crashreport-upgrade/.gitignore b/test/crashreport-upgrade/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/test/crashreport-upgrade/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/test/crashreport-upgrade/build.gradle b/test/crashreport-upgrade/build.gradle deleted file mode 100644 index 75b79de321..0000000000 --- a/test/crashreport-upgrade/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-android-extensions' - id 'kotlin-kapt' - id 'com.alibaba.arouter' -} - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - ndk { - // 设置支持的SO库架构 - abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a' - } - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - - //ARouter apt 参数 - kapt { - useBuildCache = false - arguments { - arg("AROUTER_MODULE_NAME", project.getName()) - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation rootProject.ext.dependencies.androidxappcompat - - implementation rootProject.ext.dependencies.arouter - kapt rootProject.ext.dependencies.aroutercompiler - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - api rootProject.ext.dependencies.crashreport - implementation rootProject.ext.dependencies.mogo_core_utils - implementation rootProject.ext.dependencies.mogocommons - } else { - api project(":test:crashreport") - implementation project(':core:mogo-core-utils') - implementation project(":foudations:mogo-commons") - } - - implementation 'com.tencent.bugly:crashreport_upgrade:latest.release' - //其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0 -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/test/crashreport-upgrade/consumer-rules.pro b/test/crashreport-upgrade/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/crashreport-upgrade/gradle.properties b/test/crashreport-upgrade/gradle.properties deleted file mode 100644 index bcb33e8a94..0000000000 --- a/test/crashreport-upgrade/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.test -POM_ARTIFACT_ID=crashreport-upgrade -VERSION_CODE=1 diff --git a/test/crashreport-upgrade/proguard-rules.pro b/test/crashreport-upgrade/proguard-rules.pro deleted file mode 100644 index 68dec0863c..0000000000 --- a/test/crashreport-upgrade/proguard-rules.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile --dontwarn com.tencent.bugly.** --keep public class com.tencent.bugly.**{*;} --keep class android.support.**{*;} diff --git a/test/crashreport-upgrade/src/main/AndroidManifest.xml b/test/crashreport-upgrade/src/main/AndroidManifest.xml deleted file mode 100644 index 9f5b88a7f2..0000000000 --- a/test/crashreport-upgrade/src/main/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/test/crashreport-upgrade/src/main/java/com/mogo/test/crashreport/upgrade/UpgradeReportConstants.java b/test/crashreport-upgrade/src/main/java/com/mogo/test/crashreport/upgrade/UpgradeReportConstants.java deleted file mode 100644 index 8e2b0380b8..0000000000 --- a/test/crashreport-upgrade/src/main/java/com/mogo/test/crashreport/upgrade/UpgradeReportConstants.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.mogo.test.crashreport.upgrade; - - -/** - * @author donghongyu - * @since 2020/9/9 - *

- * 描述 - */ -public class UpgradeReportConstants { - - public static final String PATH = "/upgradereport/api"; - - public static final String NAME = "UpgradeReportApi"; -} diff --git a/test/crashreport-upgrade/src/main/java/com/mogo/test/crashreport/upgrade/UpgradeReportProvider.java b/test/crashreport-upgrade/src/main/java/com/mogo/test/crashreport/upgrade/UpgradeReportProvider.java deleted file mode 100644 index 4dc27958a7..0000000000 --- a/test/crashreport-upgrade/src/main/java/com/mogo/test/crashreport/upgrade/UpgradeReportProvider.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.mogo.test.crashreport.upgrade; - -import android.content.Context; -import android.text.TextUtils; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.alibaba.android.arouter.facade.template.IProvider; -import com.mogo.commons.debug.DebugConfig; -import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; -import com.mogo.eagle.core.utilcode.util.AppUtils; -import com.mogo.test.crashreport.CrashReportConstants; -import com.tencent.bugly.Bugly; -import com.tencent.bugly.crashreport.CrashReport; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; - - -/** - * @author donghongyu - * @since 2020/9/9 - *

- * 升级模块 - */ -@Route(path = UpgradeReportConstants.PATH) -public class UpgradeReportProvider implements IProvider { - - private static final String TAG = "UpgradeReportProvider"; - - @Override - public void init(Context context) { - String packageName = context.getPackageName(); - String processName = getProcessName(android.os.Process.myPid()); - CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context); - strategy.setUploadProcess(processName == null || processName.equals(packageName)); - - String productFlavor = DebugConfig.getProductFlavor(); - strategy.setAppChannel(productFlavor); - Bugly.init(context, CrashReportConstants.buglyAppID, true, strategy); - String sn = SharedPrefsMgr.getInstance(context).getString("sn"); - if (sn != null && !sn.isEmpty()) { - Bugly.putUserData(context, "serial", sn); - } - String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context); - Bugly.putUserData(context, "MAP_SDK_VERSION", mapSDKVersion); - } - - /** - * 获取进程号对应的进程名 - * - * @param pid 进程号 - * @return 进程名 - */ - private static String getProcessName(int pid) { - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader("/proc/" + pid + "/cmdline")); - String processName = reader.readLine(); - if (!TextUtils.isEmpty(processName)) { - processName = processName.trim(); - } - return processName; - } catch (Throwable throwable) { - throwable.printStackTrace(); - } finally { - try { - if (reader != null) { - reader.close(); - } - } catch (IOException exception) { - exception.printStackTrace(); - } - } - return null; - } -} - diff --git a/test/crashreport-upgrade/src/main/res/xml/provider_paths.xml b/test/crashreport-upgrade/src/main/res/xml/provider_paths.xml deleted file mode 100644 index 1b4e49502c..0000000000 --- a/test/crashreport-upgrade/src/main/res/xml/provider_paths.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file