Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
package com.mogo.eagle.core.function.call.analytics
|
||||
|
||||
import android.content.Context
|
||||
import androidx.annotation.Keep
|
||||
import androidx.collection.ArrayMap
|
||||
import com.elegant.analytics.Analytics
|
||||
import com.elegant.analytics.AnalyticsConfig
|
||||
import com.elegant.analytics.IAnalyticsParamsProvider
|
||||
import com.elegant.analytics.UploadMode
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
|
||||
/**
|
||||
* 埋点&数据统计 管理
|
||||
* @author donghongyu
|
||||
*/
|
||||
object AnalyticsManager {
|
||||
|
||||
@Keep
|
||||
fun init(context: Context?, isDebug: Boolean) {
|
||||
// 1 - debug 近实时上报,积累一条埋点上报,或者积累3秒上报一次。
|
||||
// 2 - 本地缓存,聚合上报,积累30条埋点上报,或者积累60秒上报一次。
|
||||
AnalyticsConfig.getInstance(context).appKey = "0915430e5fdcbb553391f2a35cb8489f"
|
||||
AnalyticsConfig.getInstance(context).uploadMode = if (isDebug) UploadMode.instant else UploadMode.cache
|
||||
AnalyticsConfig.getInstance(context).setShouldLog(isDebug)
|
||||
// 设置参数提供者
|
||||
AnalyticsConfig.getInstance(context).paramsProvider = object : IAnalyticsParamsProvider {
|
||||
// 静态参数
|
||||
override fun staticParams(): Map<String, Any> {
|
||||
return getAnalyticsCustomParams(isDebug)
|
||||
}
|
||||
|
||||
//动态参数
|
||||
override fun dynamicParams(): Map<String, Any>? {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Analytics.getInstance().start(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 埋点
|
||||
*
|
||||
* @param event 事件名称
|
||||
* @param properties 事件参数
|
||||
*/
|
||||
fun track(event: String?, properties: HashMap<String, Any>) {
|
||||
Analytics.getInstance().track(event, properties)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 静态的统计参数
|
||||
*/
|
||||
fun getAnalyticsCustomParams(isDebug: Boolean): Map<String, Any> {
|
||||
val map: MutableMap<String, Any> = ArrayMap()
|
||||
map["debug"] = if (isDebug) 1 else 0
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["app_version"] = AppUtils.getAppVersionName()
|
||||
map["app_identity_mode"] = FunctionBuildConfig.appIdentityMode
|
||||
|
||||
return map
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.call.obu
|
||||
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.support.obu.model.MogoObuHvBasicsData
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.eagle.core.function.call.obu
|
||||
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuSaveMessageListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.support.obu.ObuScene
|
||||
|
||||
/**
|
||||
* OBU 保存到数据中心,展示在消息盒子的数据
|
||||
*
|
||||
*/
|
||||
object CallerObuSaveMessageListenerManager : CallerBase<IMoGoObuSaveMessageListener>() {
|
||||
|
||||
fun invokeObuSaveMessage(type: String, content: String, tts: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onMoGoObuSaveMessage(type, content, tts)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.eagle.core.function.call.obucombine
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.api.obucombine.IMoGoObuDcCombineListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.v2x.ObuWarningEvent
|
||||
@@ -15,44 +13,6 @@ object CallerObuDcCombineListenerManager : CallerBase<IMoGoObuDcCombineListener>
|
||||
private val M_DC_COMBINE_LISTENERS: ConcurrentHashMap<String, IMoGoObuDcCombineListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加 obu和dc数据通道 监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
// fun addListener(
|
||||
// @Nullable tag: String,
|
||||
// @Nullable listener: IMoGoObuDcCombineListener
|
||||
// ) {
|
||||
// if (M_DC_COMBINE_LISTENERS.containsKey(tag)) {
|
||||
// return
|
||||
// }
|
||||
// M_DC_COMBINE_LISTENERS[tag] = listener
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
// fun removeListener(@Nullable tag: String) {
|
||||
// if (!M_DC_COMBINE_LISTENERS.containsKey(tag)) {
|
||||
// return
|
||||
// }
|
||||
// M_DC_COMBINE_LISTENERS.remove(tag)
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
// fun removeListener(@Nullable listener: IMoGoObuDcCombineListener) {
|
||||
// M_DC_COMBINE_LISTENERS.forEach {
|
||||
// if (it.value == listener) {
|
||||
// M_DC_COMBINE_LISTENERS.remove(it.key)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* v2i数据
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user