Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0' into dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.ui.widget
|
||||
|
||||
import android.annotation.*
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
@@ -14,9 +15,10 @@ import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystem
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import kotlinx.android.synthetic.m2.p_m2_view_status_bar.view.*
|
||||
import kotlinx.coroutines.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
@@ -32,11 +34,18 @@ class M2StatusBarView @JvmOverloads constructor(
|
||||
const val TAG = "M2StatusBarView"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var oldBmsSoc: Float = -1.0f
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.p_m2_view_status_bar, this, true)
|
||||
setBackgroundColor(Color.parseColor("#80FFFFFF"))
|
||||
isClickable = true
|
||||
isFocusable = true
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
post {
|
||||
@@ -51,8 +60,12 @@ class M2StatusBarView @JvmOverloads constructor(
|
||||
//电量
|
||||
CallerBatteryManagementSystemListenerManager.addListener(TAG,this)
|
||||
|
||||
progress.progress = 50
|
||||
tv_power_cos.text = "50%"
|
||||
progress?.also {
|
||||
it.progress = 50
|
||||
}
|
||||
tv_power_cos?.also {
|
||||
it.text = "50%"
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
@@ -69,19 +82,24 @@ class M2StatusBarView @JvmOverloads constructor(
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onBatteryManagementSystemStates(states: ChassisStatesOuterClass.BMSSystemStates) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
val bmsSoc = states.bmsSoc
|
||||
if(bmsSoc >1){
|
||||
progress.progress = bmsSoc.toInt()
|
||||
tv_power_cos.text = "${bmsSoc.toInt()}%"
|
||||
}else{
|
||||
val currenPower = (bmsSoc * 100).toInt()
|
||||
progress.progress = currenPower
|
||||
tv_power_cos.text = "$currenPower%"
|
||||
val bmsSoc = states.bmsSoc
|
||||
try {
|
||||
if (oldBmsSoc != bmsSoc ) {
|
||||
scope.launch {
|
||||
if(bmsSoc >1){
|
||||
progress?.also { it.progress = bmsSoc.toInt() }
|
||||
tv_power_cos?.also { it.text = "${bmsSoc.toInt()}%" }
|
||||
}else{
|
||||
val power = (bmsSoc * 100).toInt()
|
||||
progress?.also { it.progress = power }
|
||||
tv_power_cos?.also {it.text = "$power%" }
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
oldBmsSoc = bmsSoc
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -45,7 +45,8 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
|
||||
|
||||
override fun changeUiToPauseShow() {
|
||||
Logger.d(ImageAndVideoRotation.TAG, "changeUiToPauseShow-hide")
|
||||
hideWidget()
|
||||
startPlayLogic()
|
||||
// hideWidget()
|
||||
}
|
||||
|
||||
override fun changeUiToCompleteShow() {
|
||||
|
||||
@@ -148,12 +148,12 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter
|
||||
|
||||
override fun onPrepared(url: String?, vararg objects: Any?) {
|
||||
Logger.d(ImageAndVideoRotation.TAG, "onPrepared--$url")
|
||||
if (viewList[mViewPager.currentItem] is AdvanceVideoView){
|
||||
val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
|
||||
UiThreadHandler.postDelayed(Runnable {
|
||||
videoView.setCacheImageViewGone()
|
||||
},1000)
|
||||
}
|
||||
// if (viewList[mViewPager.currentItem] is AdvanceVideoView){
|
||||
// val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
|
||||
// UiThreadHandler.postDelayed(Runnable {
|
||||
// videoView.setCacheImageViewGone()
|
||||
// },1000)
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onAutoComplete(url: String?, vararg objects: Any?) {
|
||||
|
||||
@@ -103,7 +103,7 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
// .into(it)
|
||||
// }
|
||||
videoViewPlayer?.thumbImageView = cacheImage
|
||||
setCacheImageViewVisible()
|
||||
// setCacheImageViewVisible()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_32" />
|
||||
|
||||
<SeekBar
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="@dimen/dp_115"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
@@ -42,9 +43,8 @@
|
||||
android:maxHeight="@dimen/dp_8"
|
||||
android:minHeight="@dimen/dp_8"
|
||||
android:layout_marginRight="4dp"
|
||||
android:splitTrack="false"
|
||||
android:progressDrawable="@drawable/m2_power_seekbar_style"
|
||||
android:thumb="@null" />
|
||||
android:background="@null"
|
||||
android:progressDrawable="@drawable/m2_power_seekbar_style" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_power_cos"
|
||||
|
||||
@@ -12,6 +12,8 @@ data class OrderInfoResponse(val data: OrderInfo?) : BaseData() {
|
||||
val productType: Int?,//车辆类型
|
||||
val lineId: Long?,//线路id
|
||||
val lineName: String?,//线路名称
|
||||
var startSiteId: Int?,
|
||||
var startSiteName: String?,
|
||||
val siteId: Long?,//站点id
|
||||
val siteName: String?,//站点名称
|
||||
val wgs84Lat: Double?,
|
||||
|
||||
@@ -40,6 +40,8 @@ import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManag
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.LEAVE_STATION
|
||||
import com.mogo.och.common.module.manager.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
@@ -901,4 +903,12 @@ object CharterPassengerModel {
|
||||
}
|
||||
return parameters
|
||||
}
|
||||
|
||||
fun sendTripInfo() {
|
||||
//发送前后屏出站消息 3:代表出站
|
||||
orderInfo?.let {
|
||||
CharterSendTripInfoManager.sendCharterTripInfo(LEAVE_STATION,
|
||||
it.lineName!!,it.startSiteName!!,it.siteName!!,false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,6 +125,7 @@ class BusPassengerFunctionDevicePresenter(view: M1DeviceFragment?) :
|
||||
CallerAutoPilotControlManager.sendPlanningCmd(2)
|
||||
CharterPassengerModel.startAutopilot()
|
||||
CharterPassengerModel.leaveStation()
|
||||
CharterPassengerModel.sendTripInfo()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 重新起步
|
||||
|
||||
@@ -16,10 +16,10 @@ import com.magic.mogo.och.charter.callback.DriverM1OrderCallback
|
||||
import com.magic.mogo.och.charter.callback.IDriverM1ControllerStatusCallback
|
||||
import com.magic.mogo.och.charter.constant.CharterConst
|
||||
import com.magic.mogo.och.charter.manager.CharterAnalyticsManager
|
||||
import com.magic.mogo.och.charter.manager.CharterSendTripInfoManager
|
||||
import com.magic.mogo.och.charter.manager.CharterSendTripInfoManager.ARRIVE_STATION
|
||||
import com.magic.mogo.och.charter.manager.CharterSendTripInfoManager.END_TRIP
|
||||
import com.magic.mogo.och.charter.manager.CharterSendTripInfoManager.START_TRIP
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.ARRIVE_STATION
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.END_TRIP
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.START_TRIP
|
||||
import com.magic.mogo.och.charter.manager.CharterTrajectoryManager
|
||||
import com.magic.mogo.och.charter.net.DriverM1ServiceManager
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.magic.mogo.och.charter.manager
|
||||
package com.mogo.och.common.module.manager
|
||||
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
@@ -93,7 +93,7 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
private fun loadCacheImg() {
|
||||
videoViewPlayer?.thumbImageView = cacheImage
|
||||
cacheImage?.setImageResource(R.drawable.video_holder)
|
||||
setCacheImageViewVisible()
|
||||
// setCacheImageViewVisible()
|
||||
Logger.d(ImageVideoRotationView.TAG, "setVideoPath")
|
||||
cacheImage?.let {
|
||||
Glide.with(context).asBitmap().load(cacheImageUrl)
|
||||
@@ -385,12 +385,12 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter
|
||||
|
||||
override fun onPrepared(url: String?, vararg objects: Any?) {
|
||||
Logger.d(ImageVideoRotationView.TAG, "onPrepared")
|
||||
if (viewList[mViewPager.currentItem] is AdvanceVideoView) {
|
||||
val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
|
||||
UiThreadHandler.postDelayed(Runnable {
|
||||
videoView.setCacheImageViewGone()
|
||||
}, 1000)
|
||||
}
|
||||
// if (viewList[mViewPager.currentItem] is AdvanceVideoView) {
|
||||
// val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
|
||||
// UiThreadHandler.postDelayed(Runnable {
|
||||
// videoView.setCacheImageViewGone()
|
||||
// }, 1000)
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onAutoComplete(url: String?, vararg objects: Any?) {
|
||||
@@ -523,7 +523,7 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
override fun changeUiToPauseShow() {
|
||||
Logger.d("ImageAndVideoRotation", "changeUiToPauseShow-hide")
|
||||
hideWidget()
|
||||
startPlayLogic()
|
||||
}
|
||||
|
||||
override fun changeUiToCompleteShow() {
|
||||
|
||||
@@ -64,10 +64,7 @@ if (!isAndroidTestBuild()) {
|
||||
memory_leak {
|
||||
enable true
|
||||
}
|
||||
object_hashcode {
|
||||
enable true
|
||||
}
|
||||
TextView_setTextProxy {
|
||||
textview_opt {
|
||||
enable true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,23 +14,29 @@ import com.knightboost.lancet.api.annotations.*
|
||||
@Group("crash_fix")
|
||||
class CrashFix {
|
||||
|
||||
/**
|
||||
* 修正Android8.0及之后,后台启动Service引起的崩溃
|
||||
* java.lang.IllegalStateException: Not allowed to start service Intent {
|
||||
* act=com.zhidao.cosupload.service.UPLOAD_ACTION cmp=com.mogo.launcher.f/com.zhidao.cosupload.service.UploadService }: app is in background uid UidRecord{6443b7b u0a404 LAST bg:+1m15s362ms idle change:idle procs:1 seq(0,0,0)}
|
||||
*/
|
||||
@Insert(mayCreateSuper = true)
|
||||
@TargetClass("android.content.Context", scope = LEAF)
|
||||
@TargetMethod(methodName = "startService")
|
||||
fun fixStartServiceCrash(intent: Intent): ComponentName? {
|
||||
return try {
|
||||
Origin.call() as ComponentName?
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
null
|
||||
|
||||
companion object {
|
||||
|
||||
/**
|
||||
* 修正Android8.0及之后,后台启动Service引起的崩溃
|
||||
* java.lang.IllegalStateException: Not allowed to start service Intent {
|
||||
* act=com.zhidao.cosupload.service.UPLOAD_ACTION cmp=com.mogo.launcher.f/com.zhidao.cosupload.service.UploadService }: app is in background uid UidRecord{6443b7b u0a404 LAST bg:+1m15s362ms idle change:idle procs:1 seq(0,0,0)}
|
||||
*/
|
||||
@JvmStatic
|
||||
@TargetClass("android.content.Context", scope = ALL)
|
||||
@TargetMethod(methodName = "startService")
|
||||
@ReplaceInvoke
|
||||
fun fixStartServiceCrash(context: Context, intent: Intent): ComponentName? {
|
||||
return try {
|
||||
context.startService(intent)
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* https://console.volcengine.com/apmplus/app/crash/detail/java/bb387ccd9c1a3c6ad2ede4e6f501a5e7?aid=302368&date=%7B%22granularity%22%3A%221h%22%2C%22duration%22%3A%22recently%22%2C%22range%22%3A%221w%22%7D&filters=%7B%22type%22%3A%22and%22%2C%22sub_conditions%22%3A%5B%7B%22dimension%22%3A%22os%22%2C%22op%22%3A%22in%22%2C%22type%22%3A%22expression%22%2C%22values%22%3A%5B%22Android%22%5D%7D%5D%7D&org_id=2100068151&os=Android&page_number=6&status=%5B%22pending%22%2C%22processing%22%2C%22solved%22%2C%22reopen%22%5D
|
||||
* java.lang.IllegalArgumentException: Invalid audio buffer size.
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.mogo.launcher.lancet;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import com.knightboost.lancet.api.Scope;
|
||||
import com.knightboost.lancet.api.annotations.Group;
|
||||
import com.knightboost.lancet.api.annotations.ImplementedInterface;
|
||||
import com.knightboost.lancet.api.annotations.NameRegex;
|
||||
import com.knightboost.lancet.api.annotations.ReplaceInvoke;
|
||||
import com.knightboost.lancet.api.annotations.TargetClass;
|
||||
import com.knightboost.lancet.api.annotations.TargetMethod;
|
||||
import com.knightboost.lancet.api.annotations.Weaver;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Weaver
|
||||
@Group("object_hashcode")
|
||||
@Keep
|
||||
public class ObjectHashCodeProxy {
|
||||
|
||||
public static final ConcurrentHashMap<String, Integer> hashCodes = new ConcurrentHashMap<>();
|
||||
|
||||
@NameRegex("(com\\.mogo\\.eagle\\.core\\.utilcode\\.util\\.ThreadUtils|com\\.mogo\\.eagle\\.core\\.utilcode\\.util\\.UiThreadHandler)")
|
||||
@TargetClass(value = "java.lang.Object",scope = Scope.SELF)
|
||||
@TargetMethod(methodName = "hashCode")
|
||||
@ReplaceInvoke
|
||||
public static int hashCodeProxy(Object r) {
|
||||
Class<?> clazz = r.getClass();
|
||||
String className = clazz.getName();
|
||||
if (hashCodes.containsKey(className)) {
|
||||
Integer value = hashCodes.get(className);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
int hashCode = System.identityHashCode(r);
|
||||
hashCodes.put(className, hashCode);
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.mogo.launcher.lancet;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.knightboost.lancet.api.Scope;
|
||||
import com.knightboost.lancet.api.annotations.Group;
|
||||
import com.knightboost.lancet.api.annotations.NameRegex;
|
||||
@@ -13,7 +12,7 @@ import com.knightboost.lancet.api.annotations.TargetMethod;
|
||||
import com.knightboost.lancet.api.annotations.Weaver;
|
||||
|
||||
@Weaver
|
||||
@Group("TextView_setTextProxy")
|
||||
@Group("textview_opt")
|
||||
public class TextViewSetTextOpt {
|
||||
|
||||
@NameRegex("(com\\.mogo|com\\.zhidao|com\\.elegant|com\\.zhidaoauto|com\\.zhjt).*")
|
||||
@@ -31,6 +30,7 @@ public class TextViewSetTextOpt {
|
||||
sb.setLength(sb.length() - 1);
|
||||
}
|
||||
Log.e("ALERT", sb.toString());
|
||||
return;
|
||||
}
|
||||
CharSequence old = view.getText();
|
||||
if (old != null && !old.equals(text)) {
|
||||
|
||||
@@ -12,10 +12,12 @@ import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.launcher.BuildConfig
|
||||
import com.mogo.launcher.R
|
||||
import com.mogo.test.crashreport.CrashReportConstants
|
||||
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
|
||||
import com.zhidaoauto.map.sdk.open.HDTypes
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.MapParams
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
||||
|
||||
object ConfigStartUp {
|
||||
|
||||
@@ -27,6 +29,9 @@ object ConfigStartUp {
|
||||
}
|
||||
|
||||
private fun initBuildConfig() {
|
||||
//ijk关闭log
|
||||
IjkPlayerManager.setLogLevel(IjkMediaPlayer.IJK_LOG_SILENT);
|
||||
|
||||
// 初始化构建APP的时候的分支及提交HASH,用于辅助定位问题
|
||||
AppConfigInfo.workingBranchName = BuildConfig.WORKING_BRANCH_NAME
|
||||
AppConfigInfo.workingBranchHash = BuildConfig.WORKING_BRANCH_HASH
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.support.obu.model.MogoObuRsiWarningData;
|
||||
import com.mogo.support.obu.model.MogoObuRsmWarningData;
|
||||
import com.mogo.support.obu.model.MogoObuRvWarningData;
|
||||
import com.mogo.support.obu.model.MogoObuSpatWarningData;
|
||||
import com.mogo.support.obu.model.MogoObuSystemStatusData;
|
||||
import com.mogo.support.obu.model.advance.AccFourAxes;
|
||||
import com.mogo.support.obu.model.advance.DateTime;
|
||||
import com.mogo.support.obu.model.advance.NodeId;
|
||||
@@ -293,6 +294,11 @@ public class ObuTest {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onObuSystemStatus(MogoObuSystemStatusData data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGnssInfo(MessagePad.GnssInfo gnssInfo) {
|
||||
Log.i("ddddd", "onGnssInfo=\n" + TextFormat.printer().escapingNonAscii(false).printToString(gnssInfo));
|
||||
|
||||
@@ -93,7 +93,7 @@ ext {
|
||||
|
||||
// obu sdk
|
||||
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
||||
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta3',
|
||||
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta4',
|
||||
|
||||
// google
|
||||
googlezxing : "com.google.zxing:core:3.3.3",
|
||||
@@ -132,8 +132,8 @@ ext {
|
||||
crashreport : "com.mogo.test:crashreport:${CRASHREPORT_VERSION}",
|
||||
crashreportapmbyte : "com.mogo.test:crashreport-apmbyte:${CRASHREPORT_APMBYTE_VERSION}",
|
||||
crashreportnoop : "com.mogo.test:crashreport-noop:${CRASHREPORT_NOOP_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',
|
||||
apm_insight : 'com.volcengine:apm_insight:1.4.10.cn-rc.0',
|
||||
apm_insight_crash : 'com.volcengine:apm_insight_crash:1.4.6-rc.17',
|
||||
cicle_indicator : 'me.relex:circleindicator:2.1.6',
|
||||
|
||||
//========================= TTS语音 Maven 版本管理 =========================
|
||||
|
||||
@@ -109,7 +109,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
override fun onCurrentVersion(version: MogoObuSystemBConfigData) {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "onCurrentVersion version = ${version.version}")
|
||||
if (!version.version.isNullOrEmpty()) {
|
||||
CallerObuInfoListenerManager.invokeObuVersionName(version.version)
|
||||
CallerDevaToolsManager.queryObuUpgrade(version.version)
|
||||
}
|
||||
}
|
||||
@@ -194,6 +193,15 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 系统状态
|
||||
*
|
||||
* @param data 系统状态
|
||||
*/
|
||||
override fun onObuSystemStatus(data: MogoObuSystemStatusData?) {
|
||||
CallerObuInfoListenerManager.invokeGetObuInfo(data.toString())
|
||||
}
|
||||
|
||||
/**
|
||||
* HV车辆基础信息 gnssInfo
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,15 @@ object MoGoObuListenerImpl : OnObuListener {
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener()
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 系统状态
|
||||
*
|
||||
* @param data 系统状态
|
||||
*/
|
||||
override fun onObuSystemStatus(data: MogoObuSystemStatusData?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HV车辆基础信息
|
||||
|
||||
@@ -152,8 +152,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
//OBU连接状态
|
||||
private var obuConnectStatus: Boolean = false
|
||||
private var mObuVersionName: String = ""
|
||||
private var mObuDeviceId: String = ""
|
||||
private var mObuInfoStr: String = ""
|
||||
|
||||
//渠道包标签
|
||||
private var onlineSelected: Boolean = true
|
||||
@@ -574,7 +573,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
setLogCheckedChangeListener()
|
||||
|
||||
//OBU配置信息
|
||||
tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString()
|
||||
// tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString()
|
||||
|
||||
//工控机配置信息
|
||||
tvAutopilotInfo.text =
|
||||
@@ -1537,7 +1536,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}"
|
||||
)
|
||||
|
||||
|
||||
tvServerSocketStatus.text = Html.fromHtml(
|
||||
"服务器Socket状态:${
|
||||
if (MogoStatusManager.getInstance().isSocketOnLine) {
|
||||
@@ -1607,7 +1605,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tvAutopilotInfo.text = autopilotJson
|
||||
tvIpcInfo.text = autopilotJson
|
||||
tvIpcInfoKey.text = autopilotJson
|
||||
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)
|
||||
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)?:""
|
||||
|
||||
tvCarInfo.text =
|
||||
"GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
|
||||
@@ -1645,10 +1643,8 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbIsDemoMode.text = "开启美化模式"
|
||||
}
|
||||
|
||||
//obu TODO 后面会添加很多os那边需要显示的内容
|
||||
obuVersionNameTv.text = Html.fromHtml(
|
||||
"OBU版本号:$mObuVersionName"
|
||||
)
|
||||
//obu信息,排查obu相关问题使用
|
||||
tvObuInfoContent.text = mObuInfoStr
|
||||
|
||||
obuConnectStatusTv.text = Html.fromHtml(
|
||||
"OBU连接状态:${
|
||||
@@ -1667,7 +1663,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onConnectStatus(obuStatusInfo: ObuStatusInfo) {
|
||||
lifecycleOwner.lifecycleScope.launch {
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
// tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
|
||||
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
||||
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
||||
@@ -2058,12 +2054,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
setLogCheckedChangeListener()
|
||||
}
|
||||
|
||||
override fun onGetObuVersionName(obuVersionName: String) {
|
||||
mObuVersionName = obuVersionName
|
||||
override fun onGetObuInfo(obuInfoStr: String) {
|
||||
mObuInfoStr = obuInfoStr
|
||||
}
|
||||
|
||||
override fun onObuDeviceId(obuDeviceId: String) {
|
||||
mObuDeviceId = obuDeviceId
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1086,16 +1086,16 @@
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSetObuIP" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvObuInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_5"
|
||||
android:minLines="4"
|
||||
android:text="OBU配置信息"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/obuDivider" />
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tvObuInfo"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_margin="@dimen/dp_5"-->
|
||||
<!-- android:minLines="3"-->
|
||||
<!-- android:text="OBU配置信息"-->
|
||||
<!-- android:textColor="#000"-->
|
||||
<!-- android:textSize="@dimen/dp_24"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/obuDivider" />-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/obuStatusCenterLayout"
|
||||
@@ -1104,31 +1104,33 @@
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvObuInfo"
|
||||
app:layout_constraintTop_toBottomOf="@id/obuDivider"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/obuVersionNameTv"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/obuConnectStatusTv"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/obuConnectStatusTv"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
<TextView
|
||||
android:id="@+id/obuVersionNameTv"
|
||||
style="@style/DebugSettingText"
|
||||
android:text="OBU信息:"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
<TextView
|
||||
android:id="@+id/tvObuInfoContent"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -125,7 +125,7 @@ public class TrackManager {
|
||||
cellIdCaches.forcePut(uuid, trackObj.getCellIdPos());
|
||||
mMarkersCaches.put(uuid, trackObj);
|
||||
trafficDataUuid.add(uuid);
|
||||
Log.i("costTime","" + (System.currentTimeMillis() - cost));
|
||||
//Log.i("costTime","" + (System.currentTimeMillis() - cost));
|
||||
}
|
||||
return mFilterTrafficData;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ object MarkerDrawerManager {
|
||||
|
||||
fun startLoopCalCarLocation() {
|
||||
routeWipeDisposable = CompositeDisposable()
|
||||
getLoopCalCarObservable().delay(1000L, TimeUnit.MILLISECONDS, true)
|
||||
getLoopCalCarObservable().delay(500L, TimeUnit.MILLISECONDS, true)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.repeat()
|
||||
.retry()
|
||||
|
||||
@@ -261,7 +261,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, this)
|
||||
initAMapView(context)
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 20, this)
|
||||
//设置全览模式
|
||||
overLayerView?.setOnClickListener { displayCustomOverView() }
|
||||
overLayerView?.let {
|
||||
|
||||
@@ -9,14 +9,8 @@ package com.mogo.eagle.core.function.api.datacenter.obu
|
||||
interface IMoGoObuInfoListener {
|
||||
|
||||
/**
|
||||
* @param obuVersionName OBU硬件版本
|
||||
* @param obuInfoStr OBU信息
|
||||
*/
|
||||
fun onGetObuVersionName(obuVersionName: String)
|
||||
|
||||
/**
|
||||
* obuDeviceId
|
||||
*/
|
||||
fun onObuDeviceId(obuDeviceId: String)
|
||||
|
||||
fun onGetObuInfo(obuInfoStr: String)
|
||||
|
||||
}
|
||||
@@ -9,25 +9,12 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
*/
|
||||
object CallerObuInfoListenerManager : CallerBase<IMoGoObuInfoListener>() {
|
||||
|
||||
fun invokeObuVersionName(obuVersionName: String) {
|
||||
fun invokeGetObuInfo(obuInfoStr: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onGetObuVersionName(obuVersionName)
|
||||
listener.onGetObuInfo(obuInfoStr)
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeObuDeviceId(obuDeviceId: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onObuDeviceId(obuDeviceId)
|
||||
}
|
||||
}
|
||||
|
||||
// fun invokeQueryContainersResponse(dockerList: List<String>) {
|
||||
// M_LISTENERS.forEach {
|
||||
// val listener = it.value
|
||||
// //TODO
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.mogo.eagle.core.utilcode.util;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 根据对象的类名,返回一致的hashCode
|
||||
* 如果缓存中不存在,则创建hashCode并存入缓存
|
||||
* 如果缓存中存在,直接用缓存数据
|
||||
*/
|
||||
public class ObjectHashCodeUtils {
|
||||
|
||||
private static final ConcurrentHashMap<String, Integer> hashCodes = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
public static int getHashCodeIfNeed(Object obj) {
|
||||
if (obj == null) {
|
||||
return -1;
|
||||
}
|
||||
String name = obj.getClass().getName();
|
||||
Integer value = hashCodes.get(name);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
int hashCode = System.identityHashCode(obj);
|
||||
hashCodes.put(name, hashCode);
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public final class ThreadUtils {
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
r.run();
|
||||
} else {
|
||||
int what = r.hashCode();
|
||||
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
|
||||
HANDLER.removeMessages(what);
|
||||
Message msg = Message.obtain(HANDLER, r);
|
||||
msg.what = what;
|
||||
@@ -75,7 +75,7 @@ public final class ThreadUtils {
|
||||
}
|
||||
|
||||
public static void runOnUiThreadDelayed(final Runnable r, long delayMillis) {
|
||||
int what = r.hashCode();
|
||||
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
|
||||
HANDLER.removeMessages(what);
|
||||
Message msg = Message.obtain(HANDLER, r);
|
||||
msg.what = what;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class UiThreadHandler {
|
||||
private UiThreadHandler() { }
|
||||
|
||||
public static boolean post( Runnable r ) {
|
||||
int what = r.hashCode();
|
||||
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
|
||||
sUiHandler.removeMessages(what);
|
||||
Message msg = Message.obtain(sUiHandler, r);
|
||||
msg.what = what;
|
||||
@@ -19,7 +19,7 @@ public class UiThreadHandler {
|
||||
}
|
||||
|
||||
public static boolean postDelayed( Runnable r, long delayMillis ) {
|
||||
int what = r.hashCode();
|
||||
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
|
||||
sUiHandler.removeMessages(what);
|
||||
Message msg = Message.obtain(sUiHandler, r);
|
||||
msg.what = what;
|
||||
@@ -27,7 +27,7 @@ public class UiThreadHandler {
|
||||
}
|
||||
|
||||
public static void removeCallbacks( Runnable r ) {
|
||||
int what = r.hashCode();
|
||||
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
|
||||
sUiHandler.removeMessages(what);
|
||||
}
|
||||
}
|
||||
@@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4
|
||||
LOGLIB_VERSION=1.5.11
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.4.5.7
|
||||
MOGO_NETWORK_VERSION=1.4.5.10
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.4.5.7
|
||||
MOGO_PASSPORT_VERSION=1.4.5.10
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.4.5.7
|
||||
MOGO_SOCKET_VERSION=1.4.5.10
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.4.5.7
|
||||
MOGO_REALTIME_VERSION=1.4.5.10
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.4.5.7
|
||||
MOGO_TANLU_VERSION=1.4.5.10
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.4.5.7
|
||||
MOGO_LIVE_VERSION=1.4.5.10
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.5.7
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.5.10
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.4.5.7
|
||||
MOGO_LOCATION_VERSION=1.4.5.10
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.4.5.7
|
||||
MOGO_TELEMATIC_VERSION=1.4.5.10
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.10.0.9
|
||||
|
||||
@@ -4,7 +4,6 @@ import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_INIT_ON_MAP_LOADED;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_INIT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.Logger.d;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS;
|
||||
@@ -41,8 +40,8 @@ import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
@@ -168,17 +167,19 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
MapAutoViewHelper options = mMapView.getMapAutoViewHelper();
|
||||
if (options != null) {
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
ThreadUtils.getIoPool().submit(() -> {
|
||||
if (options != null) {
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
// options.setAllGesturesEnabled(false); //禁止全部手势
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
}
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
}
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
@@ -982,21 +983,30 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void setLockMode(boolean isLock) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setLockMode(true);
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
mapAutoViewHelper.setLockMode(isLock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollGesturesEnable(boolean isEnable) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setScrollGesturesEnabled(isEnable);
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
mapAutoViewHelper.setScrollGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllGesturesEnabled(boolean isEnable) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setAllGesturesEnabled(isEnable);
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
mapAutoViewHelper.setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
|
||||
|
||||
// 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等
|
||||
mapLocation?.let {
|
||||
aMapLocation.let {
|
||||
// 转换 GCJ02-->WGS84 坐标
|
||||
val wgs84Location =
|
||||
CoordinateTransform.GCJ02ToWGS84(it.longitude, it.latitude)
|
||||
@@ -112,17 +112,17 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
lastGaoDeLocation.errorInfo = it.errorInfo
|
||||
}
|
||||
|
||||
// 回掉给监听者
|
||||
CallerGaoDeMapLocationListenerManager.invokeMoGoLocationChanged(lastGaoDeLocation)
|
||||
|
||||
mapLocation = aMapLocation
|
||||
// 本地SP缓存城市Code
|
||||
val cityCode = aMapLocation.cityCode
|
||||
if (cityCode != null && cityCode.isNotEmpty()) {
|
||||
mCityCode = aMapLocation.cityCode
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
|
||||
try {
|
||||
mapLocation = aMapLocation
|
||||
// 本地SP缓存城市Code
|
||||
val cityCode = aMapLocation.cityCode
|
||||
if (cityCode != null && cityCode.isNotEmpty()) {
|
||||
mCityCode = aMapLocation.cityCode
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
|
||||
}
|
||||
|
||||
// 缓存经纬度
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(
|
||||
SharedPrefsConstants.LOCATION_LATITUDE,
|
||||
@@ -133,7 +133,11 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
SharedPrefsConstants.LOCATION_LONGITUDE,
|
||||
aMapLocation.longitude.toString()
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
// 回掉给监听者
|
||||
CallerGaoDeMapLocationListenerManager.invokeMoGoLocationChanged(lastGaoDeLocation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zhidao.support.obu;
|
||||
|
||||
import com.mogo.support.obu.ObuScene;
|
||||
import com.mogo.support.obu.constants.Define;
|
||||
import com.mogo.support.obu.model.MogoObuSystemStatusData;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -15,6 +16,12 @@ public interface OnObuListener {
|
||||
*/
|
||||
void onConnectStatus(@Define.ConnectStatus int connectStatus);
|
||||
|
||||
/**
|
||||
* OBU 系统状态
|
||||
*
|
||||
* @param data 系统状态
|
||||
*/
|
||||
void onObuSystemStatus(MogoObuSystemStatusData data);
|
||||
|
||||
/**
|
||||
* HV车辆基础信息
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
rootProject.name = 'MoGoEagleEye'
|
||||
include ':app'
|
||||
include ':app_ipc_monitoring'
|
||||
include ':app_mogo_magic_ring'
|
||||
//include ':app_ipc_monitoring'
|
||||
//include ':app_mogo_magic_ring'
|
||||
|
||||
|
||||
// 核心模块
|
||||
|
||||
@@ -39,6 +39,10 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.mogo.test.crashreport.apm;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.apm.insight.AttachUserData;
|
||||
import com.apm.insight.CrashType;
|
||||
import com.apm.insight.MonitorCrash;
|
||||
import com.apm.insight.log.VLog;
|
||||
import com.bytedance.apm.insight.ApmInsight;
|
||||
@@ -12,8 +10,9 @@ import com.bytedance.apm.insight.ApmInsightAgent;
|
||||
import com.bytedance.apm.insight.ApmInsightInitConfig;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.CarInfo;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.CarInfo;
|
||||
import com.mogo.eagle.core.function.api.devatools.apm.IApmEnvProvider;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
@@ -22,11 +21,11 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.CommonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.MetaDataUtils;
|
||||
import com.mogo.test.crashreport.CrashReportConstants;
|
||||
import com.mogo.test.crashreport.ITestCrashReportProvider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,7 +37,9 @@ import java.util.Map;
|
||||
@Route(path = CrashReportConstants.PATH)
|
||||
public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
private static final String BYTEAMP_APPID = "302368";
|
||||
private static final String BYTEAMP_AppToken = "de428a1a8b204c82ac60088aaf9205a3";
|
||||
private static final String BYTEAMP_APPID_DEV = "379950";
|
||||
private static final String BYTEAMP_AppToken_DEV = "3a78191bc18842118c5b4515ec9bfefc";
|
||||
|
||||
private static final String TAG = "ApmCrashReportProvider";
|
||||
private static final String MAP_SDK_VERSION = "MAP_SDK_VERSION";
|
||||
@@ -49,11 +50,6 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
initCrash(context);
|
||||
initApmInsight(context);
|
||||
}
|
||||
|
||||
private void initCrash(final Context context) {
|
||||
IApmEnvProvider provider = CallerDevaToolsManager.INSTANCE.apmEnvProvider();
|
||||
boolean isDebug = DebugConfig.isDebug();
|
||||
if (provider != null) {
|
||||
@@ -62,85 +58,167 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
isDebug = enabled;
|
||||
}
|
||||
}
|
||||
MonitorCrash crash = MonitorCrash.init(context, isDebug ? BYTEAMP_APPID_DEV : BYTEAMP_APPID, CommonUtils.getVersionCode(context), CommonUtils.getVersionName(context))
|
||||
.setCustomDataCallback(new AttachUserData() {
|
||||
@Override
|
||||
public Map<? extends String, ? extends String> getUserData(CrashType type) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
//车辆信息
|
||||
String carInfoString = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO);
|
||||
initCrash(context, isDebug);
|
||||
initApmInsight(context, isDebug);
|
||||
}
|
||||
|
||||
if (carInfoString != null && !carInfoString.isEmpty()) {
|
||||
mInfo = GsonUtils.fromJson(carInfoString, CarInfo.class);
|
||||
}
|
||||
private void initCrash(final Context context, boolean isDebug) {
|
||||
MonitorCrash.Config config =
|
||||
MonitorCrash.Config
|
||||
.app(isDebug ? BYTEAMP_APPID_DEV : BYTEAMP_APPID)
|
||||
.token(isDebug ? BYTEAMP_AppToken_DEV : BYTEAMP_AppToken)// 设置鉴权token,可从平台应用信息处获取,token错误无法上报数据
|
||||
.versionCode(CommonUtils.getVersionCode(context))// 可选,默认取PackageInfo中的versionCode
|
||||
.versionName(CommonUtils.getVersionName(context))// 可选,默认取PackageInfo中的versionName
|
||||
.channel(MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"))// 可选,设置App发布渠道,在平台可以筛选
|
||||
// .url("www.xxx.com")// 默认不需要,私有化部署才配置上报地址
|
||||
//可选,可以设置自定义 did,不设置会使用内部默认的
|
||||
.dynamicParams(new MonitorCrash.Config.IDynamicParams() {
|
||||
@Override
|
||||
public String getDid() {//返回空会使用内部默认的did
|
||||
String sn = SharedPrefsMgr.getInstance(context).getString("sn");
|
||||
if (sn != null && !sn.isEmpty()) {
|
||||
return sn;
|
||||
} else {
|
||||
return DeviceUtils.getDeviceSN().isEmpty() ? null : DeviceUtils.getDeviceSN();
|
||||
}
|
||||
}
|
||||
|
||||
//车辆所在位置
|
||||
mCityCode = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_CITY_CODE);
|
||||
mLat = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LATITUDE);
|
||||
mLogt = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LONGITUDE);
|
||||
//地图版本
|
||||
String mapSDKVersion = DebugConfig.getMapVersion();
|
||||
map.put("MAP_SDK_VERSION", mapSDKVersion);
|
||||
map.put("CITYCODE", mCityCode);
|
||||
map.put("LATITUDE", mLat);
|
||||
map.put("LONGITUTE", mLogt);
|
||||
@Override
|
||||
public String getUserId() {
|
||||
return DeviceUtils.getDeviceSN();
|
||||
}
|
||||
})
|
||||
//应用崩溃后会执行这里,可选,添加业务自定义数据,在崩溃详情页->现场数据展示->自定义数据
|
||||
.customData(crashType -> {
|
||||
//车辆所在位置
|
||||
mCityCode = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_CITY_CODE);
|
||||
mLat = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LATITUDE);
|
||||
mLogt = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LONGITUDE);
|
||||
//车辆信息
|
||||
String carInfoString = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO);
|
||||
if (carInfoString != null && !carInfoString.isEmpty()) {
|
||||
mInfo = GsonUtils.fromJson(carInfoString, CarInfo.class);
|
||||
}
|
||||
|
||||
if (mInfo != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "nuber = " + mInfo.getNumber_plate() + "--brand = " + mInfo.getBrand() + "--modle = " + mInfo.getModel());
|
||||
map.put("PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
map.put("BRAND", mInfo.getBrand());
|
||||
map.put("MODEL", mInfo.getModel());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
});
|
||||
String mapSDKVersion = DebugConfig.getMapVersion();
|
||||
crash.config().setChannel("MAP_SDK_VERSION:" + mapSDKVersion);
|
||||
//可选,可以设置自定义did,不设置会使用内部默认的
|
||||
String sn = SharedPrefsMgr.getInstance(context).getString("sn");
|
||||
if (sn != null && !sn.isEmpty()) {
|
||||
crash.config().setDeviceId(sn);
|
||||
} else {
|
||||
crash.config().setDeviceId(DeviceUtils.getDeviceSN());
|
||||
}
|
||||
crash.addTags(MAP_SDK_VERSION, mapSDKVersion);
|
||||
crash.addTags("CITYCODE", mCityCode);
|
||||
crash.addTags("LATITUDE", mLat);
|
||||
crash.addTags("LONGITUTE", mLogt);
|
||||
crash.addTags("CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
|
||||
//======================================== 自定义维度值 begin========================================
|
||||
HashMap<String, String> dimension = new HashMap<>();
|
||||
// dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceUtils.getDeviceSN());
|
||||
// dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
// dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
// Git版本信息
|
||||
dimension.put("GIT_BRANCH", AppConfigInfo.INSTANCE.getWorkingBranchName());
|
||||
dimension.put("GIT_HASH", AppConfigInfo.INSTANCE.getWorkingBranchHash());
|
||||
// 地图版本
|
||||
dimension.put("APP_MAP_SDK_VERSION", DebugConfig.getMapVersion());
|
||||
// 渠道信息
|
||||
dimension.put("APP_CHANNEL", MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
|
||||
// 车辆类型
|
||||
dimension.put("APP_CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
|
||||
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
|
||||
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
// 连接的OBU 状态
|
||||
dimension.put("OBU_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectObu());
|
||||
// 车牌号,从工控机获取的数据
|
||||
dimension.put("IPC_PLATE_NUMBER", AppConfigInfo.INSTANCE.getPlateNumber());
|
||||
// 连接的工控机 状态
|
||||
dimension.put("IPC_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectAutopilot());
|
||||
// 连接的工控机 MAC地址
|
||||
dimension.put("IPC_MAC", AppConfigInfo.INSTANCE.getIPCMacAddress());
|
||||
// 连接的工控机 Docker版本
|
||||
dimension.put("IPC_MAP_VERSION", AppConfigInfo.INSTANCE.getDockerVersion());
|
||||
// 连接的工控机 Protocol版本
|
||||
dimension.put("IPC_MAP_PROTOCOL_VERSION", "" + AppConfigInfo.INSTANCE.getProtocolVersionNumber());
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
|
||||
HashMap<String, String> dimension = new HashMap<>();
|
||||
//维度值
|
||||
dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceUtils.getDeviceSN());
|
||||
// dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
// dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
dimension.put(MAP_SDK_VERSION, mapSDKVersion);
|
||||
dimension.put("CITYCODE", mCityCode);
|
||||
dimension.put("LATITUDE", mLat);
|
||||
dimension.put("LONGITUTE", mLogt);
|
||||
if (mInfo != null) {
|
||||
dimension.put("PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
dimension.put("BRAND", mInfo.getBrand());
|
||||
dimension.put("MODEL", mInfo.getModel());
|
||||
}
|
||||
//************************************* 位置信息 ***********************************************
|
||||
// 城市信息
|
||||
dimension.put("LOCATION_CITY_CODE", mCityCode);
|
||||
dimension.put("LOCATION_LATITUDE", mLat);
|
||||
dimension.put("LOCATION_LONGITUTE", mLogt);
|
||||
//************************************* 位置信息 ***********************************************
|
||||
|
||||
HashMap<String, Double> metric = new HashMap<>();
|
||||
//指标值
|
||||
//metric.put("Devices_ID_metric", (double) 100);
|
||||
ApmInsightAgent.monitorEvent("Devices_ID_EVENT", dimension, metric);
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
if (mInfo != null) {
|
||||
dimension.put("CMDB_PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
dimension.put("CMDB_BRAND", mInfo.getBrand());
|
||||
dimension.put("CMDB_MODEL", mInfo.getModel());
|
||||
}
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
|
||||
HashMap<String, Double> metric = new HashMap<>();
|
||||
//指标值
|
||||
//metric.put("Devices_ID_metric", (double) 100);
|
||||
ApmInsightAgent.monitorEvent("Devices_ID_EVENT", dimension, metric);
|
||||
//======================================== 自定义维度值 end========================================
|
||||
|
||||
|
||||
//===================================== 自定义收集一些信息,在崩溃详情页->现场数据展示->自定义数据 begin========================================
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
// Git版本信息
|
||||
map.put("GIT_BRANCH", AppConfigInfo.INSTANCE.getWorkingBranchName());
|
||||
map.put("GIT_HASH", AppConfigInfo.INSTANCE.getWorkingBranchHash());
|
||||
// 地图版本
|
||||
map.put("APP_MAP_SDK_VERSION", DebugConfig.getMapVersion());
|
||||
// 渠道信息
|
||||
map.put("APP_CHANNEL", MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
|
||||
// 车辆类型
|
||||
map.put("APP_CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
|
||||
//************************************* APP构建的信息 ***********************************************
|
||||
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
// 连接的OBU 状态
|
||||
map.put("OBU_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectObu());
|
||||
// 车牌号,从工控机获取的数据
|
||||
map.put("IPC_PLATE_NUMBER", AppConfigInfo.INSTANCE.getPlateNumber());
|
||||
// 连接的工控机 状态
|
||||
map.put("IPC_CONNECT_STATUS", "" + AppConfigInfo.INSTANCE.isConnectAutopilot());
|
||||
// 连接的工控机 MAC地址
|
||||
map.put("IPC_MAC", AppConfigInfo.INSTANCE.getIPCMacAddress());
|
||||
// 连接的工控机 Docker版本
|
||||
map.put("IPC_MAP_VERSION", AppConfigInfo.INSTANCE.getDockerVersion());
|
||||
// 连接的工控机 Protocol版本
|
||||
map.put("IPC_MAP_PROTOCOL_VERSION", "" + AppConfigInfo.INSTANCE.getProtocolVersionNumber());
|
||||
//************************************* 与车辆连接的 IPC(工控机)、OBU 等信息 ***********************************************
|
||||
|
||||
//************************************* 位置信息 ***********************************************
|
||||
// 城市信息
|
||||
map.put("LOCATION_CITY_CODE", mCityCode);
|
||||
map.put("LOCATION_LATITUDE", mLat);
|
||||
map.put("LOCATION_LONGITUTE", mLogt);
|
||||
//************************************* 位置信息 ***********************************************
|
||||
|
||||
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
if (mInfo != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "nuber = " + mInfo.getNumber_plate() + "--brand = " + mInfo.getBrand() + "--modle = " + mInfo.getModel());
|
||||
map.put("CMDB_PLATE_NUMBER", mInfo.getNumber_plate());
|
||||
map.put("CMDB_BRAND", mInfo.getBrand());
|
||||
map.put("CMDB_MODEL", mInfo.getModel());
|
||||
}
|
||||
//************************************* CMDB绑定的信息 ***********************************************
|
||||
|
||||
return map;
|
||||
//===================================== 自定义收集一些信息,在崩溃详情页->现场数据展示->自定义数据 end========================================
|
||||
})
|
||||
// 可选,添加pv事件的自定义tag,可以用来筛选崩溃率计算的分母数据
|
||||
//.pageViewTags(<<Map<String, String>>>)
|
||||
.build();
|
||||
MonitorCrash monitorCrash = MonitorCrash.init(context, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* ApmInsight性能监控初始化
|
||||
*/
|
||||
private void initApmInsight(Context context) {
|
||||
|
||||
private void initApmInsight(Context context, boolean isDebug) {
|
||||
ApmInsightInitConfig.Builder builder = ApmInsightInitConfig.builder();
|
||||
//设置分配的appid
|
||||
builder.aid(BYTEAMP_APPID);
|
||||
builder.aid(isDebug ? BYTEAMP_APPID_DEV : BYTEAMP_APPID);
|
||||
//设置分配的AppToken
|
||||
builder.token(isDebug ? BYTEAMP_AppToken_DEV : BYTEAMP_AppToken);
|
||||
//是否开启卡顿功能
|
||||
builder.blockDetect(true);
|
||||
//是否开启严重卡顿功能
|
||||
@@ -153,6 +231,12 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
builder.memoryMonitor(true);
|
||||
//控制是否打开电量监控
|
||||
builder.batteryMonitor(true);
|
||||
//控制是否打开CPU监控
|
||||
builder.cpuMonitor(true);
|
||||
//控制是否打开磁盘监控
|
||||
builder.diskMonitor(true);
|
||||
//控制是否打开流量监控
|
||||
builder.trafficMonitor(true);
|
||||
//是否打印日志,注:线上release版本要配置为false
|
||||
builder.debugMode(true);
|
||||
//支持用户自定义user_id把平台数据和自己用户关联起来,可以不配置
|
||||
@@ -160,7 +244,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
//私有化部署:配置数据上报的域名 (私有化部署才需要配置,内部有默认域名),测试支持设置http://www.xxx.com 默认是https协议
|
||||
// builder.defaultReportDomain("www.xxx.com");
|
||||
//设置渠道。1.3.16版本增加接口
|
||||
builder.channel("local");
|
||||
builder.channel(MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
|
||||
//打开自定义日志回捞能力,1.4.1版本新增接口
|
||||
builder.enableLogRecovery(true);
|
||||
//设置数据和Rangers Applog数据打通,设备标识did必填。1.3.16版本增加接口
|
||||
|
||||
Reference in New Issue
Block a user