diff --git a/.idea/misc.xml b/.idea/misc.xml index 2db9aab721..47f1a4e1d4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/AdasNoticeHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/AdasNoticeHelper.java index aaeec71c8f..d5ec491f0e 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/AdasNoticeHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/AdasNoticeHelper.java @@ -59,6 +59,8 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca private Handler handler = new Handler(this); + private boolean isObuLightData = false; + private View selfCar; private boolean lightCenter = true; @@ -95,10 +97,6 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca if(!lightCenter) { handler.sendEmptyMessageDelayed(MSG_REFRESH_CAR_STRATEGY, STRATEGY_DELAY); } - // debug code -// tvSelfSpeed.setVisibility(View.VISIBLE); -// tvTrafficLight.setVisibility(View.VISIBLE); -// tvLimitSpeed.setVisibility(View.VISIBLE); } } @@ -209,11 +207,12 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca tvLimitSpeed.setVisibility(View.GONE); return true; case MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD: - if (!handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) { + if (!isObuLightData && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) { tvTrafficLight.setVisibility(View.GONE); } return true; case MSG_HIDE_TRAFFIC_LIGHT_BY_OBU: + isObuLightData = false; if (!handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD)) { tvTrafficLight.setVisibility(View.GONE); } @@ -237,8 +236,11 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca String action = intent.getAction(); if("com.mogo.launcher.adas".equals(action)){ // 收到限速信息 - limitSpeed = intent.getIntExtra("adas_speed_limit", -1); - drawLimitSpeed(); + int limit = intent.getIntExtra("adas_speed_limit", -1); + if(limit>0) { + limitSpeed = limit; + drawLimitSpeed(); + } }else { int type = intent.getIntExtra("type", -1); if (type == 2) { @@ -272,6 +274,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca } private void handleObuTrafficLightInfo(String lightStatus, String surplusTime) { + isObuLightData = true; if (tvTrafficLight != null) { handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU); handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); @@ -282,6 +285,10 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca } private void handleCloudTrafficLight(CloudRoadData roadData) { + if (isObuLightData) { + handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); + return; + } if (tvTrafficLight != null && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) { handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); // todo drawTrafficLight