From 62051ed749d9918a9789842f2ee8600b9cbba619 Mon Sep 17 00:00:00 2001 From: aibingbing Date: Wed, 10 Jul 2024 19:16:10 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0]=20feat:=20=E5=A2=9E=E5=8A=A0=20?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=85=AC=E4=BA=A4=E7=AB=99=E7=82=B9=20?= =?UTF-8?q?=E5=9F=8B=E7=82=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busstation/PassBusStationEventManager.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt index 31d352aaee..5aa3369d3d 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt @@ -2,6 +2,9 @@ package com.mogo.eagle.function.biz.v2x.busstation import android.os.Handler import android.os.HandlerThread +import androidx.lifecycle.ProcessLifecycleOwner +import androidx.lifecycle.lifecycleScope +import com.mogo.commons.utils.MogoAnalyticUtils import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.enums.EventTypeEnumNew @@ -39,10 +42,12 @@ import kotlin.random.Random object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { const val TAG = "PassBusStationEventManager" + const val ANALYTICS_KEY = "biz_v2x_road_pass_bus_station_manager" private val coroutineExceptionHandler = CoroutineExceptionHandler { coroutineContext, exception -> Logger.e(TAG, "coroutineExceptionHandler --> Handle $exception in $coroutineContext") + trackEvent("coroutineExceptionHandler --> Handle $exception in $coroutineContext") isCalculateNearByStation.set(false) } @@ -123,6 +128,7 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { if (angle >= 90) { CallerRoadV2NEventWindowListenerManager.dismiss(it.getBusStationId()) busStationListNeedNotified.remove(it.getBusStationId()) + trackEvent("dismiss --> busStationId=${it.getBusStationId()}") Logger.d( TAG, "removeNeedNotifiedBusStation --> ${it.toString()}" @@ -181,6 +187,7 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { ).toString() ).toString() ) + trackEvent("showBusStationNotification --> ${it.toString()}") Logger.d( TAG, "showBusStationNotification --> ${it.toString()}" @@ -207,6 +214,7 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { fun init() { CallerChassisLocationWGS84ListenerManager.addListener(TAG, 1, this) handler?.post(checkDistanceRunnable) + trackEvent("init") } fun unInit() { @@ -217,6 +225,7 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { handler?.removeCallbacks(checkDistanceRunnable) handler?.removeCallbacks(notificationCheckRunnable) handler?.looper?.quit() + trackEvent("unInit") } override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { @@ -282,6 +291,17 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { } } + fun trackEvent(msg: String) { + ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.IO) { + val map: MutableMap = HashMap() + map["msg"] = msg + MogoAnalyticUtils.track( + ANALYTICS_KEY, + map + ) + } + } + private var hasShownBorderPointHDMarker = false private fun busStationHDMarkerStrategy() { if (HmiBuildConfig.isShowBusStationStrategyBorderPoint) {