diff --git a/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml b/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml index 3365c3c4d6..f3d940ee26 100644 --- a/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml +++ b/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml @@ -109,9 +109,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="@dimen/dp_301" - android:layout_marginTop="@dimen/dp_110" + android:layout_marginTop="@dimen/dp_100" android:layout_marginRight="@dimen/dp_301" - android:layout_marginBottom="@dimen/dp_110" + android:layout_marginBottom="@dimen/dp_100" android:background="@drawable/module_authorize_selector_dark_corner" android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" @@ -149,7 +149,7 @@ { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java index bf22201dba..0bbc8473b1 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java @@ -2,6 +2,7 @@ package com.mogo.module.v2x.listener; import android.content.Context; +import com.mogo.commons.debug.DebugConfig; import com.mogo.map.MogoLatLng; import com.mogo.map.location.IMogoLocationListener; import com.mogo.map.location.MogoLocation; @@ -11,14 +12,14 @@ import com.mogo.map.search.geo.MogoGeocodeResult; import com.mogo.map.search.geo.MogoRegeocodeResult; import com.mogo.module.common.entity.MarkerExploreWay; import com.mogo.module.common.entity.MarkerResponse; -import com.mogo.module.service.Utils; -import com.mogo.module.v2x.V2XConst; -import com.mogo.module.v2x.V2XServiceManager; -import com.mogo.module.v2x.alarm.V2XAlarmServer; import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.common.entity.V2XPoiTypeEnum; import com.mogo.module.common.entity.V2XPushMessageEntity; import com.mogo.module.common.entity.V2XRoadEventEntity; +import com.mogo.module.service.Utils; +import com.mogo.module.v2x.V2XConst; +import com.mogo.module.v2x.V2XServiceManager; +import com.mogo.module.v2x.alarm.V2XAlarmServer; import com.mogo.module.v2x.network.V2XRefreshCallback; import com.mogo.module.v2x.scenario.impl.V2XScenarioManager; import com.mogo.module.v2x.utils.ADASUtils; @@ -126,21 +127,23 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList } } - // 疲劳驾驶检测 - V2XAlarmServer.getFatigueDrivingShow(location, drivingShowEntity -> { - Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity)); + // 只有自研车机才有疲劳驾驶检测 + if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) { + V2XAlarmServer.getFatigueDrivingShow(location, drivingShowEntity -> { + Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity)); - String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2"; - trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style); + String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2"; + trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style); - V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>(); - v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING); - v2XMessageEntity.setContent(drivingShowEntity); - v2XMessageEntity.setShowState(drivingShowEntity.isShowWindow()); - // 广播给ADAS Launcher - ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), drivingShowEntity); - V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity); - }); + V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>(); + v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING); + v2XMessageEntity.setContent(drivingShowEntity); + v2XMessageEntity.setShowState(drivingShowEntity.isShowWindow()); + // 广播给ADAS Launcher + ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), drivingShowEntity); + V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity); + }); + } // 巡航处理 V2XRoadEventEntity v2XRoadEventEntity = diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingWindow.java index 9ce5a57e2b..d1901c1fd4 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingWindow.java @@ -69,6 +69,7 @@ public class V2XFatigueDrivingWindow extends RelativeLayout mTvAddress = findViewById(R.id.tvAddress); mTvAddressDistance = findViewById(R.id.tvAddressDistance); mIvToNav = findViewById(R.id.ivToNav); + V2XServiceManager.getMogoRegisterCenter().registerMogoNaviListener( "test", this ); mIvToNav.setOnClickListener(v -> startNavi()); } @@ -118,6 +119,7 @@ public class V2XFatigueDrivingWindow extends RelativeLayout handlerV2XEvent.removeCallbacks(runnableV2XEvent); runnableV2XEvent = null; } + //移除窗体 V2XServiceManager .getMogoTopViewManager() @@ -155,6 +157,7 @@ public class V2XFatigueDrivingWindow extends RelativeLayout @Override public void onCalculateSuccess() { + V2XServiceManager.getMogoRegisterCenter().unregisterMogoNaviListener( "test"); V2XServiceManager.getNavi().startNavi(true); } diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json index afd2eec4c8..e547da75f3 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json @@ -14,9 +14,11 @@ "zoom": true, "zoomScale": 15, "location": { - "lat": 39.9554100000, - "lon": 116.4178276100 + "lat": 39.951326, + "lon": 116.343487 }, + "lat": 39.951326, + "lon": 116.343487, "userHead": "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/5.png", "msgImgUrl": "https://upload.jianshu.io/users/upload_avatars/7663825/7c28763e-002b-4e89-8dea-5b8da210ef2c.jpg" } \ No newline at end of file