This commit is contained in:
tongchenfei
2020-06-28 15:37:34 +08:00
parent 2cf3bc8463
commit dcb88d70dc
3 changed files with 18 additions and 11 deletions

View File

@@ -43,7 +43,6 @@ public class MogoApplication extends AbsMogoApplication {
DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE);
DebugConfig.setUseCustomNavi(BuildConfig.USE_CUSTOM_NAVI);
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER);
DebugConfig.setUseMockObuData(true);
super.onCreate();
// Crash 日志收集
final long start = System.currentTimeMillis();

View File

@@ -39,8 +39,8 @@ object MockUtil {
when (random) {
0->{
// 绿波引导
carEventInfo.type = ObuConstant.TYPE_OPTIMAL_SPEED_ADVISORY.toString()
carEventInfo.typeCode = ObuConstant.TYPE_OPTIMAL_SPEED_ADVISORY.toString()
carEventInfo.type = "绿波车速引导"
carEventInfo.typeCode = "13"
val r = Random.nextInt(0, 3)
carEventInfo.describe = when (r) {
0 -> "保持当前车速行驶!"
@@ -51,15 +51,15 @@ object MockUtil {
}
1->{
// 前方急刹预警
carEventInfo.type = ObuConstant.TYPE_URGENCY_COLLISION_WARNING.toString()
carEventInfo.typeCode = ObuConstant.TYPE_URGENCY_COLLISION_WARNING.toString()
carEventInfo.type = "紧急制动预警"
carEventInfo.typeCode = "06"
carEventInfo.describe = "这个应该是随便写,反正也不用"
dataCallback.showCarEventInfo(carEventInfo)
}
2->{
// 行人碰撞预警
carEventInfo.type = ObuConstant.TYPE_ROAD_USER_COLLISION_WARNING.toString()
carEventInfo.typeCode = ObuConstant.TYPE_ROAD_USER_COLLISION_WARNING.toString()
carEventInfo.type = "行人碰撞预警"
carEventInfo.typeCode = "39"
carEventInfo.describe = "这个应该是随便写,反正也不用"
dataCallback.showCarEventInfo(carEventInfo)
}

View File

@@ -99,7 +99,9 @@ class ObuManager: IMogoObuManager {
*/
override fun showCarLocationInfo(info: CarLocationInfo?) {
Logger.d(TAG, "thread: ${Thread.currentThread()} showCarLocationInfo: ${info?.carId}")
dataChangedListener?.showCarLocationInfo(info)
handler.post{
dataChangedListener?.showCarLocationInfo(info)
}
}
/**
@@ -107,7 +109,9 @@ class ObuManager: IMogoObuManager {
*/
override fun showOtherInfo(info: String?) {
Logger.d(TAG, "thread: ${Thread.currentThread()} showOtherInfo: $info")
dataChangedListener?.showOtherInfo(info)
handler.post{
dataChangedListener?.showOtherInfo(info)
}
}
/**
@@ -115,7 +119,9 @@ class ObuManager: IMogoObuManager {
*/
override fun showTrafficLightInfo(info: TrafficLightInfo?) {
Logger.d(TAG, "thread: ${Thread.currentThread()} showTrafficLightInfo: ${info?.id}")
dataChangedListener?.showTrafficLightInfo(info)
handler.post{
dataChangedListener?.showTrafficLightInfo(info)
}
}
/**
@@ -123,6 +129,8 @@ class ObuManager: IMogoObuManager {
*/
override fun showCarEventInfo(info: CarEventInfo?) {
Logger.d(TAG, "thread: ${Thread.currentThread()} showCarEventInfo: ${info?.type}")
dataChangedListener?.showCarEventInfo(info)
handler.post {
dataChangedListener?.showCarEventInfo(info)
}
}
}