diff --git a/README_shell.md b/README_shell.md index 3b344df103..7c590f74af 100644 --- a/README_shell.md +++ b/README_shell.md @@ -50,6 +50,8 @@ adb shell am broadcast -a com.obu.test_light_recognized --ei obuStates 1 --ei ob // (旧版本)使用命令行触发各种测试场景演示 adb shell am broadcast -a com.v2x.test_panel_control --ei sceneType 1 +adb shell am broadcast -a com.v2x.test_panel_control --ez TextPanelOpenStatus true --ei TextPanelOpenType 11 + // 调用应用内的模拟 adb shell am broadcast -a com.mogo.mock --ei oper 46 diff --git a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index 9f11607b0b..3b07e5274d 100644 --- a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -1,21 +1,11 @@ package com.mogo.eagle.core.function.main; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_BOTTOM; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_BOTTOM_LEFT; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_BOTTOM_RIGHT; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_LEFT; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_NON; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_RIGHT; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP; - import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Process; import android.text.TextUtils; import android.util.Log; -import android.view.View; -import android.widget.ImageView; import androidx.annotation.Nullable; @@ -24,10 +14,8 @@ import com.mogo.commons.debug.DebugConfig; import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider; import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.module.main.MainActivity; -import com.mogo.module.service.receiver.MogoReceiver; import com.mogo.service.intent.IMogoIntentListener; import com.mogo.service.statusmanager.StatusDescriptor; -import com.mogo.service.v2x.IV2XWarningListener; import com.mogo.utils.ActivityLifecycleManager; import com.mogo.utils.logger.Logger; @@ -36,21 +24,17 @@ import com.mogo.utils.logger.Logger; * * @author tongchenfei */ -public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IV2XWarningListener { +public class MainLauncherActivity extends MainActivity implements IMogoIntentListener { private static final String TAG = "MainLauncherActivity"; protected boolean mIsHomeKeyDown = false; private static Handler handlerV2XEvent = new Handler(); private static Runnable runnableV2XEvent; - private static final int COUNT_DOWN_TIMER = 1_000; - private static final int ALL_EXPIRE_TIMER = 3_000; - private static int EXPIRE_TIMER = ALL_EXPIRE_TIMER; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); DebugConfig.setNeedRequestUserInfo(true); Log.d(TAG, "onCreate"); - mServiceApis.getV2XListenerManager().registerIntentListener(MogoReceiver.ACTION_V2X_FRONT_WARNING, this); } @@ -116,7 +100,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis super.onDestroy(); mServiceApis.getStatusManagerApi().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, this); - mServiceApis.getV2XListenerManager().unregisterIntentListener(TAG, this); stopCountDown(); try { // acc off 之后会出现进程还在,但是页面被杀的情况,这个直接杀掉进程,然后让整个进程重启 @@ -141,92 +124,10 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis } - @Override - public void warningChangedWithDirection(int type) { - Log.d(TAG, "显示红色预警蒙层"); - Log.d("MogoObu", "显示红色预警蒙层 ------> type = " + type); - switch (type) { - case ALERT_THE_FRONT_CRASH_WARNING_NON: - mWarningTop.setVisibility(View.GONE); - mWarningLeft.setVisibility(View.GONE); - mWarningRight.setVisibility(View.GONE); - mWarningBottom.setVisibility(View.GONE); - break; - case ALERT_THE_FRONT_CRASH_WARNING_TOP: - mWarningTop.setVisibility(View.VISIBLE); - mWarningLeft.setVisibility(View.GONE); - mWarningRight.setVisibility(View.GONE); - mWarningBottom.setVisibility(View.GONE); - startCountDownWithView(mWarningTop); - break; - case ALERT_THE_FRONT_CRASH_WARNING_LEFT: - mWarningLeft.setVisibility(View.VISIBLE); - mWarningTop.setVisibility(View.GONE); - mWarningRight.setVisibility(View.GONE); - mWarningBottom.setVisibility(View.GONE); - startCountDownWithView(mWarningLeft); - break; - case ALERT_THE_FRONT_CRASH_WARNING_RIGHT: - mWarningRight.setVisibility(View.VISIBLE); - mWarningTop.setVisibility(View.GONE); - mWarningLeft.setVisibility(View.GONE); - mWarningBottom.setVisibility(View.GONE); - startCountDownWithView(mWarningRight); - break; - case ALERT_THE_FRONT_CRASH_WARNING_BOTTOM: - mWarningBottom.setVisibility(View.VISIBLE); - mWarningRight.setVisibility(View.GONE); - mWarningTop.setVisibility(View.GONE); - mWarningLeft.setVisibility(View.GONE); - startCountDownWithView(mWarningBottom); - break; - case ALERT_THE_FRONT_CRASH_WARNING_BOTTOM_LEFT: - mWarningBottom.setVisibility(View.VISIBLE); - mWarningRight.setVisibility(View.GONE); - mWarningTop.setVisibility(View.GONE); - mWarningLeft.setVisibility(View.VISIBLE); - startCountDownWithView(mWarningBottom); - startCountDownWithView(mWarningLeft); - break; - case ALERT_THE_FRONT_CRASH_WARNING_BOTTOM_RIGHT: - mWarningBottom.setVisibility(View.VISIBLE); - mWarningRight.setVisibility(View.VISIBLE); - mWarningTop.setVisibility(View.GONE); - mWarningLeft.setVisibility(View.GONE); - startCountDownWithView(mWarningBottom); - startCountDownWithView(mWarningRight); - break; - default: - break; - } - } - - /** - * 预警蒙层显示时间为3秒 - */ - private void startCountDownWithView(ImageView view) { - if (runnableV2XEvent == null) { - runnableV2XEvent = () -> { - EXPIRE_TIMER = EXPIRE_TIMER - COUNT_DOWN_TIMER; - Logger.d(TAG, "当前蒙层显示时间为 :" + EXPIRE_TIMER / COUNT_DOWN_TIMER + " 秒"); - if (EXPIRE_TIMER > 0) { - handlerV2XEvent.postDelayed(runnableV2XEvent, COUNT_DOWN_TIMER); - } else { - view.setVisibility(View.GONE); - stopCountDown(); - } - }; - } else { - handlerV2XEvent.removeCallbacks(runnableV2XEvent); - } - handlerV2XEvent.postDelayed(runnableV2XEvent, COUNT_DOWN_TIMER); - } - private void stopCountDown() { if (handlerV2XEvent != null && runnableV2XEvent != null) { handlerV2XEvent.removeCallbacks(runnableV2XEvent); runnableV2XEvent = null; - EXPIRE_TIMER = ALL_EXPIRE_TIMER; } } diff --git a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index ee499fdf90..efb87fe80e 100644 --- a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -1,7 +1,5 @@ package com.mogo.eagle.core.function.main; -import static com.mogo.commons.debug.DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE; - import android.content.Context; import android.content.Intent; import android.os.Process; @@ -320,8 +318,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING, "IMogoCrashWarnProvider")); // ADAS模块(旧,慢慢被 域控制器模块 替换掉) MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider")); - // 前方碰撞预警 - MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider")); // 全局语音唤醒 MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake")); // 云公告发布 diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java index 25d535a895..ddd9a60030 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java @@ -331,13 +331,6 @@ public class MogoServicePaths { @Keep public static final String PATH_TRAFFIC_LIGHT = "/v2x_api/api/trafficlight"; - /** - * 前方碰撞预警 未碰撞 - */ - @Keep - @Deprecated - public static final String PATH_V2X_FRONT_CRASH_WARNING = "/front/crashwarning"; - /** * obu-mogo 模块 */ diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index e12064c622..e97ca3ba2f 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -2,7 +2,6 @@ package com.mogo.module.extensions.entrance; import static com.mogo.module.common.utils.SPConst.getSPGuideRecord; import static com.mogo.module.extensions.ExtensionsModuleConst.TYPE_ENTRANCE; -import static com.mogo.module.service.receiver.MogoReceiver.ACTION_V2X_REMOVE_TIP_WINDOW; import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_BUTTON; import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_TIME; import static com.mogo.module.share.constant.ShareConstants.KEY_SERVER_SHOW_DAY_COUNT; @@ -387,7 +386,6 @@ public class EntranceFragment extends MvpFragment implement protected FrameLayout mFloatingLayout; protected View mCoverUpLayout; - protected ImageView mWarningTop; - protected ImageView mWarningLeft; - protected ImageView mWarningRight; - protected ImageView mWarningBottom; - protected ConstraintLayout clSpecialEffect; private boolean isFirst = false; @@ -108,11 +102,6 @@ public class MainActivity extends MvpActivity implement mCoverUpLayout = findViewById(R.id.module_main_id_cover_up); mHistoryMessagePanel = findViewById(R.id.module_main_id_message_history_fragment_container); - mWarningTop = findViewById(R.id.warning_top); - mWarningLeft = findViewById(R.id.warning_left); - mWarningRight = findViewById(R.id.warning_right); - mWarningBottom = findViewById(R.id.warning_bottom); - clSpecialEffect = findViewById(R.id.cl_special_effect); FloatingViewHandler.init(mFloatingLayout); diff --git a/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml b/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml index 1914ac1a8c..70c44a28e7 100644 --- a/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml +++ b/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml @@ -13,44 +13,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - - - - - - - - - - - - - - { private ImageView ivEventReportErr; private HeartLikeView ivEventZan; - private ViewGroup mViewGroup; private WindowManagerView mWindowManagerView; // 上传事件的用户信息 @@ -171,7 +169,6 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false) , v2XWindow); mContext = viewGroup.getContext(); - mViewGroup = viewGroup; init(itemView); // 设置视图状态监听 itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { @@ -280,9 +277,9 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { } ivEvent.setImageResource(EventTypeEnum.getPoiTypeSrcVr(mNoveltyInfo.getPoiType())); tvEvent.setText(EventTypeEnum.getPoiTypeStrVr(mNoveltyInfo.getPoiType())); - if (EventTypeEnum.FOURS_FOG.equals(mNoveltyInfo.getPoiType())) { + if (EventTypeEnum.FOURS_FOG.getPoiType().equals(mNoveltyInfo.getPoiType())) { V2XServiceManager.getDisplayEffectsManager().displayEffects(EventTypeEnum.FOURS_FOG.getPoiType()); - MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(ALERT_THE_FRONT_CRASH_WARNING_TOP, MogoReceiver.ACTION_V2X_FRONT_WARNING); + CallerHmiManager.INSTANCE.showWarning(WarningDirectionEnum.ALERT_WARNING_TOP); } tvEventAddress.setText(mNoveltyInfo.getAddr()); tvEventDistance.setText("距离 " + (int) mNoveltyInfo.getDistance() + "米"); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/V2XBasWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/V2XBasWindow.java index b79a0d9480..70009c7315 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/V2XBasWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/V2XBasWindow.java @@ -5,8 +5,6 @@ import android.util.AttributeSet; import android.util.Log; import android.widget.RelativeLayout; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.service.receiver.MogoReceiver; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.service.v2x.IV2XWindowManagerListener; import com.mogo.utils.logger.Logger; @@ -33,7 +31,6 @@ public class V2XBasWindow extends RelativeLayout implements IV2XWindowManagerLis @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); - MogoApisHandler.getInstance().getApis().getV2XListenerManager().registerIntentListener(MogoReceiver.ACTION_V2X_FRONT_WARNING, this); Logger.w(TAG, "onAttachedToWindow……"); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java index 167fe5531e..adce0436da 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java @@ -1,42 +1,39 @@ package com.mogo.module.v2x.scenario.scene.warning; -import android.location.Location; -import android.util.Log; - -import com.mogo.cloud.commons.utils.CoordinateUtils; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; -import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.drawer.V2XWarnDataDrawer; -import com.mogo.module.common.entity.V2XWarningEntity; -import com.mogo.module.common.utils.Trigonometric; -import com.mogo.module.service.MarkerServiceHandler; -import com.mogo.module.service.receiver.MogoReceiver; -import com.mogo.module.v2x.V2XConst; -import com.mogo.module.v2x.V2XServiceManager; -import com.mogo.module.v2x.entity.model.DrawLineInfo; -import com.mogo.module.v2x.listener.V2XLocationListener; -import com.mogo.module.v2x.scenario.view.IV2XMarker; -import com.mogo.utils.UiThreadHandler; -import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; import static com.mogo.module.v2x.V2XConst.V2X_FRONT_WARNING_MARKER; import static com.mogo.module.v2x.V2XServiceManager.getContext; +import android.util.Log; + +import com.mogo.cloud.commons.utils.CoordinateUtils; +import com.mogo.eagle.core.data.enums.WarningDirectionEnum; +import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; +import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler; +import com.mogo.map.overlay.IMogoPolyline; +import com.mogo.module.common.MogoApisHandler; +import com.mogo.module.common.drawer.V2XWarnDataDrawer; +import com.mogo.module.common.entity.V2XWarningEntity; +import com.mogo.module.common.utils.Trigonometric; +import com.mogo.module.v2x.V2XServiceManager; +import com.mogo.module.v2x.entity.model.DrawLineInfo; +import com.mogo.module.v2x.listener.V2XLocationListener; +import com.mogo.module.v2x.scenario.view.IV2XMarker; +import com.mogo.utils.UiThreadHandler; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + /** * @author liujing * @description 前方预警marker打点 绘制安全线和预警线 衡阳交付-取消划线需求,只渲染识别物红色模型移动过程,代码保留 * @since: 2021/3/30 */ -public class V2XWarningMarker implements IV2XMarker{ +public class V2XWarningMarker implements IV2XMarker { private static final String TAG = "V2XWarningMarker"; private static String WARNING_ARROWS = "WARNING_ARROWS"; private V2XWarningEntity mCloundWarningInfo; @@ -133,8 +130,26 @@ public class V2XWarningMarker implements IV2XMarker{ clearAllLine(); } //预警蒙层 - MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection - (mCloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING); + WarningDirectionEnum warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_ALL; + switch (mCloundWarningInfo.getDirection()) { + case 0: + warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_NON; + break; + case 1: + warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_TOP; + break; + case 2: + warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_BOTTOM; + break; + case 3: + warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_LEFT; + break; + case 4: + warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_RIGHT; + break; + } + CallerHmiManager.INSTANCE.showWarning(warningDirectionEnum); + } /* @@ -323,7 +338,7 @@ public class V2XWarningMarker implements IV2XMarker{ info.setLocations(locations); info.setHeading(bearing); info.setWidth(mCloundWarningInfo.getRoadwidth() * 14 + 5); - if (mCloundWarningInfo.getStopLines() != null){ + if (mCloundWarningInfo.getStopLines() != null) { info.setHasStopLines(mCloundWarningInfo.getStopLines().size() > 0); } V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info); diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java b/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java index c9678b489a..a1bee4a6e1 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java @@ -33,7 +33,6 @@ import com.mogo.service.statusmanager.IMogoStatusManager; import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider; import com.mogo.service.strategy.IMogoRefreshStrategyController; import com.mogo.service.v2x.DisplayEffectsInterface; -import com.mogo.service.v2x.IV2XProvider; import com.mogo.service.windowview.IMogoTopViewManager; import com.mogo.service.windowview.IMogoWindowManager; @@ -270,11 +269,4 @@ public interface IMogoServiceApis extends IProvider { */ IMogoMapFrameController getMapFrameControllerApi(); - - /** - * V2X - */ - IV2XProvider getV2XListenerManager(); - - } diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/v2x/IV2XProvider.java b/services/mogo-service-api/src/main/java/com/mogo/service/v2x/IV2XProvider.java deleted file mode 100644 index 32488475e2..0000000000 --- a/services/mogo-service-api/src/main/java/com/mogo/service/v2x/IV2XProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.mogo.service.v2x; - -import com.alibaba.android.arouter.facade.template.IProvider; - -/** - * @author liujing - * @description 描述 - * @since: 2021/3/24 - */ -public interface IV2XProvider extends IProvider { - public void registerIntentListener(String intent, Object listener); - - public void unregisterIntentListener(String intent, IV2XWarningListener listener); - - public void warningChangedForListenerWithDirection(int direction, String command); - - public void changeTipWindowStatusForListener(String command); -} diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/v2x/IV2XWarningListener.java b/services/mogo-service-api/src/main/java/com/mogo/service/v2x/IV2XWarningListener.java deleted file mode 100644 index c2cbae9850..0000000000 --- a/services/mogo-service-api/src/main/java/com/mogo/service/v2x/IV2XWarningListener.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.mogo.service.v2x; - -/** - * @author liujing - * @description 描述 - * @since: 2021/3/24 - */ -public interface IV2XWarningListener { - //车路云预警后红色蒙层根据方位进行展示 - void warningChangedWithDirection(int direction); -} diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java b/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java index 43abff4b9d..befd7bc7ce 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java @@ -41,7 +41,6 @@ import com.mogo.service.statusmanager.IMogoStatusManager; import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider; import com.mogo.service.strategy.IMogoRefreshStrategyController; import com.mogo.service.v2x.DisplayEffectsInterface; -import com.mogo.service.v2x.IV2XProvider; import com.mogo.service.windowview.IMogoTopViewManager; import com.mogo.service.windowview.IMogoWindowManager; import com.mogo.utils.logger.Logger; @@ -224,11 +223,6 @@ public class MogoServiceApis implements IMogoServiceApis { } - @Override - public IV2XProvider getV2XListenerManager() { - return getApiInstance(IV2XProvider.class, MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING); - } - @Override public IMogoTrafficUploadProvider getTrafficUploadApi() { return getApiInstance(IMogoTrafficUploadProvider.class, MogoServicePaths.PATH_TRAFFIC_UPLOAD); diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/singleton/SingletonsHolder.java b/services/mogo-service/src/main/java/com/mogo/service/impl/singleton/SingletonsHolder.java index c9a49021c7..456731ea58 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/singleton/SingletonsHolder.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/singleton/SingletonsHolder.java @@ -9,13 +9,11 @@ import com.mogo.service.impl.map.MogoMapService; import com.mogo.service.impl.network.MogoNetWorkService; import com.mogo.service.impl.statusmanager.MogoMsgCenter; import com.mogo.service.impl.statusmanager.MogoStatusManager; -import com.mogo.service.impl.v2x.V2XManager; import com.mogo.service.map.IMogoMapService; import com.mogo.service.network.IMogoNetwork; import com.mogo.service.statusmanager.IMogoMsgCenter; import com.mogo.service.statusmanager.IMogoStatusManager; import com.mogo.service.strategy.IMogoRefreshStrategyController; -import com.mogo.service.v2x.IV2XProvider; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -40,7 +38,6 @@ public class SingletonsHolder { sSingletons.put(IMogoStatusManager.class, new MogoStatusManager()); sSingletons.put(IMogoDataManager.class, ARouter.getInstance().navigation(IMogoDataManager.class)); sSingletons.put(IMogoRefreshStrategyController.class, ARouter.getInstance().navigation(IMogoRefreshStrategyController.class)); - sSingletons.put(IV2XProvider.class, new V2XManager()); } public static T get(Class clazz) { diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/v2x/V2XManager.java b/services/mogo-service/src/main/java/com/mogo/service/impl/v2x/V2XManager.java deleted file mode 100644 index 4858bbd9cb..0000000000 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/v2x/V2XManager.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.mogo.service.impl.v2x; - -import android.content.Context; -import android.util.Log; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.eagle.core.data.constants.MogoServicePaths; -import com.mogo.service.v2x.IV2XWarningListener; -import com.mogo.service.v2x.IV2XProvider; -import com.mogo.service.v2x.IV2XWindowManagerListener; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * @author liujing - * @description 描述 - * @since: 2021/3/24 - */ -@Route(path = MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING) -public class V2XManager implements IV2XProvider { - private final Map mListeners = new ConcurrentHashMap<>(); - - @Override - public void registerIntentListener(String intent, Object listener) { - if (listener == null || intent == null) { - Log.d("V2XManager", "listener == null || intent == null"); - return; - } - if (!mListeners.containsKey(intent)) { - Log.d("V2XManager", "intent==" + intent + "listener" + listener); - mListeners.put(intent, new CopyOnWriteArrayList<>()); - } - mListeners.get(intent).add(listener); - } - - @Override - public void unregisterIntentListener(String intent, IV2XWarningListener listener) { - if (mListeners.containsKey(intent)) { - mListeners.get(intent).remove(listener); - } - } - - @Override - public void warningChangedForListenerWithDirection(int direction, String command) { - List listeners = mListeners.get(command); - if (listeners != null && !listeners.isEmpty()) { - for (IV2XWarningListener listener : listeners) { - if (listener != null) { - listener.warningChangedWithDirection(direction); - } - } - } - } - - @Override - public void changeTipWindowStatusForListener(String command) { - List listeners = mListeners.get(command); - if (listeners != null && !listeners.isEmpty()) { - for (IV2XWindowManagerListener listener : listeners) { - if (listener != null) { - listener.removeTipWindowByListener(); - } - } - } - } - - @Override - public void init(Context context) { - - } -}