diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index 7a584acfbb..e0775f569f 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -462,9 +462,9 @@ public abstract class BaseBusTabFragment * 展示【自动驾驶】按钮 */ public void showAutopilotBiz() { - getActivity().runOnUiThread(() -> { - ctvAutopilotStatus.setVisibility(View.VISIBLE); - }); +// getActivity().runOnUiThread(() -> { +// ctvAutopilotStatus.setVisibility(View.VISIBLE); +// }); } public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() { diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index c823b12043..5198e4dbca 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -50,7 +50,6 @@ public class BusPresenter extends Presenter private static final String TAG = "BusPresenter"; - private volatile int currentAutopilotStatus = -1; private final List mStationList = new ArrayList<>(); private int mCurrentStation = 0; @@ -97,16 +96,12 @@ public class BusPresenter extends Presenter } public void autoDriveToNextStation() { - currentAutopilotStatus = -1; OrderModel.getInstance().autoDriveToNextStation(); -// isRestartAutopilot = false; } public void restartAutopilot() { if (OrderModel.getInstance().isGoingToNextStation()){ - currentAutopilotStatus = -1; OrderModel.getInstance().restartAutopilot(); -// isRestartAutopilot = true; } } @@ -167,49 +162,7 @@ public class BusPresenter extends Presenter public void onAutopilotStatusResponse(int state) { switch (state) { case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE: - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) { - // 设置UI【自动驾驶】按钮是否展示 - runOnUIThread(() -> mView.onAutopilotEnableChange(true)); - } - if (FunctionBuildConfig.isDemoMode - && ( - (mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1) - && OrderModel.getInstance().isGoingToNextStation() - ) - ) { - CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); - return; - } - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE; - } - // 改变UI自动驾驶状态 - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); - break; - case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING: - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING; - OrderModel.getInstance().triggerStartServiceEvent( - OrderModel.getInstance().isRestartAutopilot(), true); - } - // 改变UI自动驾驶状态 - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); - break; case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE: - if (FunctionBuildConfig.isDemoMode - && ( - (mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1) - && OrderModel.getInstance().isGoingToNextStation() - ) - ) { - CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); - return; - } - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE; - } - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); - break; case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING: if (FunctionBuildConfig.isDemoMode && ( @@ -220,10 +173,14 @@ public class BusPresenter extends Presenter CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); return; } - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING; - } - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); + // 改变UI自动驾驶状态 + runOnUIThread(() -> mView.onAutopilotStatusChanged(state)); + break; + case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING: + OrderModel.getInstance().triggerStartServiceEvent( + OrderModel.getInstance().isRestartAutopilot(), true); + // 改变UI自动驾驶状态 + runOnUIThread(() -> mView.onAutopilotStatusChanged(state)); break; default: runOnUIThread(() -> mView.onAutopilotEnableChange(false));