替换主动获取自动驾驶状态的调用方式

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-02-07 17:12:29 +08:00
parent e787cba3be
commit 8233e69f99
11 changed files with 21 additions and 115 deletions

View File

@@ -6,9 +6,9 @@ import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.check.CallerCheckManager;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.service.adas.IMogoAdasOCHCallback;
/**
* @author liujing
@@ -25,14 +25,14 @@ public class VehicleMonitoring implements Handler.Callback {
//非自动驾驶测试数据 后期根据需求做修改
private static final long MANUAL_CHECK_STATUS_DELAY = 30 * 1000;
//自动驾驶状态
private static int AutopilotStatus = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus();
private static int AutopilotStatus = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
public VehicleMonitoring(Context context) {
mContext = context;
}
public void vehicleCheck() {
if (AutopilotStatus == IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING) {
if (AutopilotStatus == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
Log.d(TAG, "自动驾驶中...");
mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
} else {
@@ -44,14 +44,14 @@ public class VehicleMonitoring implements Handler.Callback {
@Override
public boolean handleMessage(Message msg) {
AutopilotStatus = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus();
AutopilotStatus = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
switch (msg.what) {
case IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING:
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
vehicleMonitor();
mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
return true;
case IMogoAdasOCHCallback.STATUS_AUTOPILOT_DISABLE:
case IMogoAdasOCHCallback.STATUS_AUTOPILOT_ENABLE:
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
vehicleMonitor();
mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
return true;