From 2061d0c158c01242c8bac7748e684448e5be23fd Mon Sep 17 00:00:00 2001 From: donghongyu-pc Date: Thu, 2 Jan 2025 14:43:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[6.8.4]=201=E3=80=81=E5=AF=B9=20Countly=20?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=BF=9B=E8=A1=8C=E5=AE=9C=E6=98=8C?= =?UTF-8?q?=E6=8D=95=E8=8E=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/launcher/MogoApplication.java | 118 +++++++++--------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index 33eefbdc85..968a76bc08 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -63,65 +63,69 @@ public class MogoApplication extends MainMoGoApplication { //设置debug模式,日志不上传 crashSystem.setDebug(BuildConfig.DEBUG); - if (BuildConfig.DEBUG){ - // debug测试用的key - COUNTLY_APP_KEY = "d8cfb7be4679f650a6dc806d289a0d8c1996ed05"; + try { + if (BuildConfig.DEBUG) { + // debug测试用的key + COUNTLY_APP_KEY = "d8cfb7be4679f650a6dc806d289a0d8c1996ed05"; + } + + // 初始化自建APM统计 Countly + CountlyConfig countlyConfig = + // 创建配置对象 + new CountlyConfig( + this, + COUNTLY_APP_KEY, + COUNTLY_SERVER_URL + ); + // 优先获取设备在 蘑菇平台注册的SN + String devicesID = SharedPrefsMgr.getInstance().getSn(); + // 如果拿不到 蘑菇SN,则使用设备自己的序列号 + if (TextUtils.isEmpty(devicesID)) { + devicesID = DeviceUtils.getDeviceSN(); + } + + // 设置设备唯一标志 + countlyConfig.setDeviceId(devicesID) + // 获取您在 Countly 服务器中设置的一些配置 + .enableServerConfiguration() + // 自动视图跟踪 + .enableAutomaticViewTracking() + .enableAutomaticViewShortNames() + .enableTemporaryDeviceIdMode() + // 参数篡改保护,salt + .setParameterTamperingProtectionSalt("mogo_auto") + // 如果发送到服务器的数据足够短,SDK 将使用 HTTP GET 请求。要覆盖该行为, + // 以便在所有情况下都使用 HTTP POST 请求,您需要在 init 配置中将“setHttpPostForced”标志设置为 true。 + .setHttpPostForced(true) + // 启用日志记录: + .setLoggingEnabled(true); + + // 限制每个线程记录的堆栈跟踪行(默认值:30 行) + countlyConfig.sdkInternalLimits.setMaxStackTraceLinesPerThread(10000); + // 限制每个堆栈跟踪行允许的字符(默认:200 个字符) + countlyConfig.sdkInternalLimits.setMaxStackTraceLineLength(10000); + // 限制所有用户设置的字符串分段(或其等效值)值的大小(默认值:256 个字符) + countlyConfig.sdkInternalLimits.setMaxValueSize(10000); + // 限制用户设置的分段键值对的数量(默认:100 个条目) + countlyConfig.sdkInternalLimits.setMaxSegmentationValues(1000); + // 限制可以记录的用户设置痕迹导航的数量(默认值:100 个条目,超过此值将删除最早的条目) + countlyConfig.sdkInternalLimits.setMaxBreadcrumbCount(1000); + + // 自动崩溃处理 + countlyConfig.crashes.enableCrashReporting(); + // 记录所有线程 + countlyConfig.crashes.enableRecordAllThreadsWithCrash(); + + // 初始化Countly SDK配置 + Countly.sharedInstance().init(countlyConfig); + // java崩溃报告 + Countly.sharedInstance().crashes(); + // C++ 崩溃报告 + CountlyNative.initNative(this); + } catch (Exception e) { + e.printStackTrace(); } - // 初始化自建APM统计 Countly - CountlyConfig countlyConfig = - // 创建配置对象 - new CountlyConfig( - this, - COUNTLY_APP_KEY, - COUNTLY_SERVER_URL - ); - // 优先获取设备在 蘑菇平台注册的SN - String devicesID = SharedPrefsMgr.getInstance().getSn(); - // 如果拿不到 蘑菇SN,则使用设备自己的序列号 - if (TextUtils.isEmpty(devicesID)) { - devicesID = DeviceUtils.getDeviceSN(); - } - - // 设置设备唯一标志 - countlyConfig.setDeviceId(devicesID) - // 获取您在 Countly 服务器中设置的一些配置 - .enableServerConfiguration() - // 自动视图跟踪 - .enableAutomaticViewTracking() - .enableAutomaticViewShortNames() - .enableTemporaryDeviceIdMode() - // 参数篡改保护,salt - .setParameterTamperingProtectionSalt("mogo_auto") - // 如果发送到服务器的数据足够短,SDK 将使用 HTTP GET 请求。要覆盖该行为, - // 以便在所有情况下都使用 HTTP POST 请求,您需要在 init 配置中将“setHttpPostForced”标志设置为 true。 - .setHttpPostForced(true) - // 启用日志记录: - .setLoggingEnabled(true); - - // 限制每个线程记录的堆栈跟踪行(默认值:30 行) - countlyConfig.sdkInternalLimits.setMaxStackTraceLinesPerThread(10000); - // 限制每个堆栈跟踪行允许的字符(默认:200 个字符) - countlyConfig.sdkInternalLimits.setMaxStackTraceLineLength(10000); - // 限制所有用户设置的字符串分段(或其等效值)值的大小(默认值:256 个字符) - countlyConfig.sdkInternalLimits.setMaxValueSize(10000); - // 限制用户设置的分段键值对的数量(默认:100 个条目) - countlyConfig.sdkInternalLimits.setMaxSegmentationValues(1000); - // 限制可以记录的用户设置痕迹导航的数量(默认值:100 个条目,超过此值将删除最早的条目) - countlyConfig.sdkInternalLimits.setMaxBreadcrumbCount(1000); - - // 自动崩溃处理 - countlyConfig.crashes.enableCrashReporting(); - // 记录所有线程 - countlyConfig.crashes.enableRecordAllThreadsWithCrash(); - - // 初始化Countly SDK配置 - Countly.sharedInstance().init(countlyConfig); - // java崩溃报告 - Countly.sharedInstance().crashes(); - // C++ 崩溃报告 - CountlyNative.initNative(this); - } @Override From 2fed57ed8ac0e5f0c0eff5b2c050937c48a5e761 Mon Sep 17 00:00:00 2001 From: donghongyu-pc Date: Thu, 2 Jan 2025 16:10:10 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[6.8.4]=201=E3=80=81=E9=99=8D=E4=BD=8E?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A8=98=E9=8C=84=E7=9A=84=E6=95=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/launcher/MogoApplication.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index 968a76bc08..c419527a59 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -101,15 +101,15 @@ public class MogoApplication extends MainMoGoApplication { .setLoggingEnabled(true); // 限制每个线程记录的堆栈跟踪行(默认值:30 行) - countlyConfig.sdkInternalLimits.setMaxStackTraceLinesPerThread(10000); + countlyConfig.sdkInternalLimits.setMaxStackTraceLinesPerThread(100); // 限制每个堆栈跟踪行允许的字符(默认:200 个字符) - countlyConfig.sdkInternalLimits.setMaxStackTraceLineLength(10000); + countlyConfig.sdkInternalLimits.setMaxStackTraceLineLength(1000); // 限制所有用户设置的字符串分段(或其等效值)值的大小(默认值:256 个字符) - countlyConfig.sdkInternalLimits.setMaxValueSize(10000); + countlyConfig.sdkInternalLimits.setMaxValueSize(256); // 限制用户设置的分段键值对的数量(默认:100 个条目) - countlyConfig.sdkInternalLimits.setMaxSegmentationValues(1000); + countlyConfig.sdkInternalLimits.setMaxSegmentationValues(100); // 限制可以记录的用户设置痕迹导航的数量(默认值:100 个条目,超过此值将删除最早的条目) - countlyConfig.sdkInternalLimits.setMaxBreadcrumbCount(1000); + countlyConfig.sdkInternalLimits.setMaxBreadcrumbCount(100); // 自动崩溃处理 countlyConfig.crashes.enableCrashReporting(); From dbaacaa3c0ca45be42af9f7722365d564dd9f6c0 Mon Sep 17 00:00:00 2001 From: xyz Date: Fri, 3 Jan 2025 17:18:36 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[6.8.4]=201=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9B=A0=E8=87=AA=E5=AE=9A=E4=B9=89DNS=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E7=BD=91=E7=BB=9C=E6=97=B6=E8=BF=94=E5=9B=9E=E7=A9=BA?= =?UTF-8?q?=E9=9B=86=E5=90=88=E8=A7=A6=E5=8F=91okhttp=E7=9A=84=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5088783952..ef3d9c9c52 100644 --- a/gradle.properties +++ b/gradle.properties @@ -64,21 +64,21 @@ bytex.ASM_API=ASM7 LOGLIB_VERSION=1.10.18 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.7.59 +MOGO_NETWORK_VERSION=1.4.7.58 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.7.59 +MOGO_PASSPORT_VERSION=1.4.7.58 # 长链接 -MOGO_SOCKET_VERSION=1.4.7.59 +MOGO_SOCKET_VERSION=1.4.7.58 # 数据采集 -MOGO_REALTIME_VERSION=1.4.7.59 +MOGO_REALTIME_VERSION=1.4.7.58 # 直播推流 -MOGO_LIVE_VERSION=1.4.7.59 +MOGO_LIVE_VERSION=1.4.7.58 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.7.59 +MOGO_TRAFFICLIVE_VERSION=1.4.7.58 # 定位服务 -MOGO_LOCATION_VERSION=1.4.7.59 +MOGO_LOCATION_VERSION=1.4.7.58 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.7.59 +MOGO_TELEMATIC_VERSION=1.4.7.58 # 动态换肤SDK MOGO_SKIN_VERSION=1.4.7.50 ######## MogoAiCloudSDK Version ######## From 83fecb11610b084c3be0c82a55824d747aa79a4d Mon Sep 17 00:00:00 2001 From: zhongchao Date: Mon, 6 Jan 2025 09:59:59 +0800 Subject: [PATCH 4/4] [6.9.0] fix bug of driver seat --- .../video/DriveSeatVideoProviderImpl.kt | 59 +++++++++++++------ .../hmi/ui/operate/OperatePanelLayout.kt | 6 +- .../driver/video/IDriveSeatVideoProvider.kt | 2 +- 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/driver/video/DriveSeatVideoProviderImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/driver/video/DriveSeatVideoProviderImpl.kt index 0669d5e034..8344aa300b 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/driver/video/DriveSeatVideoProviderImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/driver/video/DriveSeatVideoProviderImpl.kt @@ -16,6 +16,8 @@ import com.mogo.eagle.core.function.api.driver.video.IDriveSeatVideoProvider.Eve import com.mogo.eagle.core.function.api.driver.video.IDriveSeatVideoProvider.Event.Playing import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener 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.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.AppStateManager import com.tencent.liteav.basic.log.TXCLog @@ -48,9 +50,11 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider { private const val TAG = "DriveSeatVideoProvider" } - @Volatile private var target: WeakReference? = null + @Volatile + private var target: WeakReference? = null - @Volatile private var timer: Job? = null + @Volatile + private var timer: Job? = null private val scope by lazy { CoroutineScope(Dispatchers.IO + SupervisorJob()) } @@ -63,22 +67,40 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider { internal interface IVideoLiveUrlApi { @Headers("Content-Type:application/json;charset=UTF-8") @GET("/eagleEye-mis/camera/monitor/watch/status") - suspend fun requestVideoLiveUrl(@Query(value = "numberPlate") numberPlate: String, @Query("cameraType") cameraType: Int, @Query("protocolType") protocolType: Int): BaseResponse + suspend fun requestVideoLiveUrl( + @Query(value = "numberPlate") numberPlate: String, + @Query("cameraType") cameraType: Int, + @Query("protocolType") protocolType: Int + ): BaseResponse } - - override suspend fun requestVideoInfo(): VideoUrlData? { + override fun requestVideoInfo(onSuccess: (VideoUrlData) -> Unit, onError: (String) -> Unit) { val plateNumber = CallerDataCenterBizListener.getPlateNumber() // val plateNumber = "京A40188D" Log.d(TAG, "requestVideoInfo -> $plateNumber") if (plateNumber == null || TextUtils.isEmpty(plateNumber)) { Log.e(TAG, "-- isVideoLiveUsable -- plate number is empty.") - return null + onError.invoke("plate number is empty.") + } + request> { + loader { + apiCall { + getApi().requestVideoLiveUrl(plateNumber!!, 2, 2) + } + } + onSuccess { + data = it.result + Log.e( + TAG, + "-- isVideoLiveUsable -- receive 请求成功: { msg: ${it.msg}, result: ${it.result}}" + ) + onSuccess.invoke(it.result) + } + onError { + Log.e(TAG, "-- isVideoLiveUsable -- receive 请求失败: { msg: ${it.message}") + onError.invoke("请求失败 , ${it.message}") + } } - val resp = getApi()?.requestVideoLiveUrl(plateNumber, 2, 2) ?: return null - Log.e(TAG, "-- isVideoLiveUsable -- receive response: {code: ${resp.code}, msg: ${resp.msg}, result: ${resp.result}}") - data = resp.result - return resp.result } override fun getDriveVideoView(playUrl: String, playCallback: ((Event) -> Unit)?): View? { @@ -148,7 +170,8 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider { } - @OptIn(ExperimentalCoroutinesApi::class) override fun poller(): Flow = channelFlow { + @OptIn(ExperimentalCoroutinesApi::class) + override fun poller(): Flow = channelFlow { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { throw AssertionError("此方法不支持司机屏使用") } @@ -174,13 +197,12 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider { Log.d(TAG, "开启定时轮询请求...") while (true) { Log.d(TAG, "当次请求开始...") - val result = requestVideoInfo() - if (result != null) { - data = result + requestVideoInfo({ + data = it chl.get()?.trySend(true) - } else { + },{ chl.get()?.trySend(false) - } + }) Log.d(TAG, "当次请求结束...") delay(5000) } @@ -200,7 +222,8 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider { return isPlaying.get() } - private fun getApi(): IVideoLiveUrlApi? { - return MoGoRetrofitFactory.getInstanceNoCallAdapter(HostConst.HOST_RELEASE).create(IVideoLiveUrlApi::class.java) + private fun getApi(): IVideoLiveUrlApi { + return MoGoRetrofitFactory.getInstanceNoCallAdapter(HostConst.HOST_RELEASE) + .create(IVideoLiveUrlApi::class.java) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt index 9824d618a4..d81f6ca4af 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt @@ -699,7 +699,11 @@ class OperatePanelLayout : LinearLayout { CallerTelematicListenerManager.addListener(TAG, this) lifecycleScope.launchWhenResumed { val p = preferenceScreen.findPreferenceReal(KEY_DRIVE_SEAT_VIDEO_STREAM)?.also { - it.isEnabled = CallerDevaToolsManager.driveSeatVideoProvider()?.requestVideoInfo()?.livePlayUrl?.isNotEmpty() ?: false + CallerDevaToolsManager.driveSeatVideoProvider()?.requestVideoInfo({ data -> + it.isEnabled = !data.livePlayUrl.isNullOrEmpty() + },{ _ -> + it.isEnabled = false + }) } if (FunctionBuildConfig.isDriveSeatVideoStream && p?.isEnabled == true) { diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/driver/video/IDriveSeatVideoProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/driver/video/IDriveSeatVideoProvider.kt index 5e10c2a4e7..2f34693f24 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/driver/video/IDriveSeatVideoProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/driver/video/IDriveSeatVideoProvider.kt @@ -10,7 +10,7 @@ interface IDriveSeatVideoProvider { * 视频直播是否可用 * @return true: 可用; false: 不可用 */ - suspend fun requestVideoInfo(): VideoUrlData? + fun requestVideoInfo(onSuccess: (VideoUrlData) -> Unit, onError: (String) -> Unit) /** * 获取司机位视频展示控件