[630][adas] 新增SSM超时检测功能
This commit is contained in:
@@ -28,7 +28,8 @@ public class UnableLaunchReason {
|
||||
GEAR,//档位
|
||||
PARKING_BRAKE,//制动系统,手刹,电子驻车制动系统
|
||||
SSM_OFFER,//SSM提供的原因
|
||||
FSM_OFFER//FSM提供的原因
|
||||
FSM_OFFER,//FSM提供的原因
|
||||
SSM_TIMEOUT//SSM超时
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,8 +12,6 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_INIT_STATU
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_SOCKET_AUTOPILOT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
|
||||
@@ -98,7 +96,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
private RawUnpack rawUnpack;//业务数据拆包
|
||||
private RawPack rawPack;//数据打包
|
||||
private DispatchHandler defaultDispatchHandler;//默认分发线程分发
|
||||
private DispatchHandler statusQueryRespDispatchHandler;//状态查询应答分发线程分发
|
||||
private final Map<MessagePad.MessageType, DispatchHandler> dispatchHandlers = new HashMap<>();//其他分发线程
|
||||
private Timer checkCompatibilityTimer;//检查版本兼容性定时器 连接成功后5秒内等待工控机发送配置信息
|
||||
private int seqSpecialVehicle = 0;//特种车辆命令发送次数
|
||||
@@ -239,12 +236,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
//启用线程分发
|
||||
defaultDispatchHandler = new DispatchHandler(MessagePad.MessageType.MsgTypeDefault, this);//默认分发线程 不要添加到Map中
|
||||
initOtherDispatchHandler();
|
||||
AutopilotAbilityManager.getInstance().setOnAutopilotAbilityListener(new AutopilotAbilityManager.OnAutopilotAbilityListener() {
|
||||
@Override
|
||||
public void onStatusQuery() {
|
||||
statusQueryRespDispatchHandler.start();
|
||||
}
|
||||
});
|
||||
receivedAckManager.setListener(new ReceivedAckManager.OnReceivedAckListener() {
|
||||
@Override
|
||||
public void onReceiveReceivedAck(@NonNull ReceivedAck receivedAck) {
|
||||
@@ -311,9 +302,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeWarn, new DispatchHandler(MessagePad.MessageType.MsgTypeWarn, this));
|
||||
//到站提醒
|
||||
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeArrivalNotification, new DispatchHandler(MessagePad.MessageType.MsgTypeArrivalNotification, this));
|
||||
//状态查询应答 TODO 此线程更新频率目前为3秒,但是由于会在此接口中做一些其他数据处理,所以单独开启线程
|
||||
statusQueryRespDispatchHandler = new DispatchHandler(MessagePad.MessageType.MsgTypeStatusQueryResp, this);
|
||||
dispatchHandlers.put(MessagePad.MessageType.MsgTypeStatusQueryResp, statusQueryRespDispatchHandler);
|
||||
//SSM状态查询应答和SSM定频推送 参见initSsmDispatch() TODO 此线程更新频率目前为3秒,但是由于会在此接口中做一些其他数据处理,所以单独开启线程
|
||||
//数据采集配置
|
||||
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeRecordDataConfigResp, new DispatchHandler(MessagePad.MessageType.MsgTypeRecordDataConfigResp, this));
|
||||
//Planning决策状态
|
||||
@@ -324,6 +313,24 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
dispatchHandlers.put(MessagePad.MessageType.MsgTypeM1StitchedVideo, new DispatchHandler(MessagePad.MessageType.MsgTypeM1StitchedVideo, this));
|
||||
}
|
||||
|
||||
private void initSsmDispatch(AdasConstants.SsmSource source) {
|
||||
stopDispatch(MessagePad.MessageType.MsgTypeSSMState);
|
||||
stopDispatch(MessagePad.MessageType.MsgTypeStatusQueryResp);
|
||||
if (source == AdasConstants.SsmSource.SSM_VER1) {
|
||||
dispatchHandlers.put(MessagePad.MessageType.MsgTypeStatusQueryResp, new DispatchHandler(MessagePad.MessageType.MsgTypeStatusQueryResp, this));
|
||||
} else if (source == AdasConstants.SsmSource.SSM_VER2) {
|
||||
dispatchHandlers.put(MessagePad.MessageType.MsgTypeSSMState, new DispatchHandler(MessagePad.MessageType.MsgTypeSSMState, this));
|
||||
}
|
||||
}
|
||||
|
||||
private void stopDispatch(MessagePad.MessageType type) {
|
||||
DispatchHandler old = dispatchHandlers.get(type);
|
||||
dispatchHandlers.remove(type);
|
||||
if (old != null) {
|
||||
old.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据固定IP查询可用IP
|
||||
*/
|
||||
@@ -486,6 +493,16 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
ReceiveTimeoutManager.getInstance().refreshLast(header.getTimestamp());
|
||||
// CupidLogUtils.w("--->websocket byte read header = " + messageType.toString());
|
||||
MessagePad.MessageType messageType = header.getMsgType();
|
||||
if (usedSsmSource == AdasConstants.SsmSource.SSM_UNKNOWN && (messageType == MessagePad.MessageType.MsgTypeStatusQueryResp || messageType == MessagePad.MessageType.MsgTypeSSMState)) {
|
||||
if (messageType == MessagePad.MessageType.MsgTypeStatusQueryResp) {
|
||||
//老SSM(查询方式)
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_VER1;
|
||||
} else {
|
||||
//新SSM(定频回调)
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_VER2;
|
||||
}
|
||||
initSsmDispatch(usedSsmSource);
|
||||
}
|
||||
DispatchHandler handler = dispatchHandlers.get(messageType);
|
||||
if (handler != null) {
|
||||
handler.sendRawMessage(raw);
|
||||
@@ -502,15 +519,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
usedChassisSource = AdasConstants.ChassisSource.CHASSIS_VER2;
|
||||
}
|
||||
}
|
||||
if (usedSsmSource == AdasConstants.SsmSource.SSM_UNKNOWN) {
|
||||
if (messageType == MessagePad.MessageType.MsgTypeStatusQueryResp) {
|
||||
//老SSM(查询方式)
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_VER1;
|
||||
} else if (messageType == MessagePad.MessageType.MsgTypeSSMState) {
|
||||
//新SSM(定频回调)
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_VER2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
callError(raw.getProtocolStatus(), byteString.toByteArray());
|
||||
}
|
||||
@@ -537,20 +545,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHandler(MessagePad.MessageType type, Handler handler) {
|
||||
if (type == MessagePad.MessageType.MsgTypeStatusQueryResp) {
|
||||
AutopilotAbilityManager.getInstance().setHandler(handler);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHandleMessage(MessagePad.MessageType type, Message msg) {
|
||||
if (type == MessagePad.MessageType.MsgTypeStatusQueryResp) {
|
||||
AutopilotAbilityManager.getInstance().onHandleMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 认证超时执行
|
||||
*/
|
||||
@@ -721,49 +715,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
|
||||
@Override
|
||||
public void onWebSocketConnectStatus(AdasConstants.IpcConnectionStatus status, Object... args) {
|
||||
if (status == AdasConstants.IpcConnectionStatus.CONNECTED) { //连接成功
|
||||
if (args != null && args.length > 1) {
|
||||
ipcConnectedIp = (String) args[0];
|
||||
ipcConnectedPort = (int) args[1];
|
||||
}
|
||||
seqSpecialVehicle = 0;
|
||||
AutopilotAbilityManager.getInstance().start();
|
||||
ParallelDrivingManager.getInstance().start();
|
||||
startCheckCompatibility();
|
||||
updateConnectStatus(status, null);
|
||||
//更新连接成功状态之后再根据是否认证进行认证检查
|
||||
if (adasOptions.isCertification()) {
|
||||
//启动认证超时
|
||||
if (defaultDispatchHandler != null) {
|
||||
defaultDispatchHandler.start();
|
||||
defaultDispatchHandler.postRunnableDelayed(certificationTimeoutRunnable, 5000L);
|
||||
}
|
||||
} else {
|
||||
//不启用认证的时候直接进行数据发送
|
||||
// initConfigure();//注释掉统一改成等待域控定频接口存储数据的时候调用
|
||||
}
|
||||
} else {
|
||||
AutopilotAbilityManager.getInstance().stop();
|
||||
ParallelDrivingManager.getInstance().stop();
|
||||
AdasManager.getInstance().setCarConfig(null);
|
||||
stopCheckCompatibility();
|
||||
stopDispatchHandler();
|
||||
stopCarConfigReq();
|
||||
ipcConnectedIp = null;
|
||||
ipcConnectedPort = Constants.DEFAULT_PORT;
|
||||
subscribeInterface = null;
|
||||
usedChassisSource = AdasConstants.ChassisSource.CHASSIS_UNKNOWN;
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_UNKNOWN;
|
||||
receivedAckManager.stop();
|
||||
if (connectFinish()) {
|
||||
stopPingAddress(false);
|
||||
}
|
||||
String reason = null;
|
||||
if (args != null && args.length > 0) {
|
||||
reason = String.valueOf(args[0]);
|
||||
}
|
||||
updateConnectStatus(status, reason);
|
||||
}
|
||||
callConnectStatus(status, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -863,17 +815,58 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
//此状态更新两个作用:1.更改FpgaSocket中的status状态;2.更新对外连接状态
|
||||
private void updateConnectStatus(AdasConstants.IpcConnectionStatus status) {
|
||||
setConnectStatus(status);
|
||||
updateConnectStatus(status, null);
|
||||
callConnectStatus(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机连接状态更新
|
||||
*
|
||||
* @param status 状态
|
||||
* @param reason 状态描述
|
||||
* 如果ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED && reason==null 表示主动断开连接
|
||||
* @param args 状态描述
|
||||
*/
|
||||
private void updateConnectStatus(AdasConstants.IpcConnectionStatus status, @Nullable String reason) {
|
||||
private void callConnectStatus(AdasConstants.IpcConnectionStatus status, @Nullable Object... args) {
|
||||
String reason = null;
|
||||
if (status == AdasConstants.IpcConnectionStatus.CONNECTED) { //连接成功
|
||||
if (args != null && args.length > 1) {
|
||||
ipcConnectedIp = (String) args[0];
|
||||
ipcConnectedPort = (int) args[1];
|
||||
}
|
||||
seqSpecialVehicle = 0;
|
||||
AutopilotAbilityManager.getInstance().start();
|
||||
ParallelDrivingManager.getInstance().start();
|
||||
startCheckCompatibility();
|
||||
//更新连接成功状态之后再根据是否认证进行认证检查
|
||||
if (adasOptions.isCertification()) {
|
||||
//启动认证超时
|
||||
if (defaultDispatchHandler != null) {
|
||||
defaultDispatchHandler.start();
|
||||
defaultDispatchHandler.postRunnableDelayed(certificationTimeoutRunnable, 5000L);
|
||||
}
|
||||
} else {
|
||||
//不启用认证的时候直接进行数据发送
|
||||
// initConfigure();//注释掉统一改成等待域控定频接口存储数据的时候调用
|
||||
}
|
||||
} else {
|
||||
AutopilotAbilityManager.getInstance().stop();
|
||||
ParallelDrivingManager.getInstance().stop();
|
||||
AdasManager.getInstance().setCarConfig(null);
|
||||
stopCheckCompatibility();
|
||||
stopDispatchHandler();
|
||||
isInitConfigure.set(false);
|
||||
stopCarConfigReq();
|
||||
ipcConnectedIp = null;
|
||||
ipcConnectedPort = Constants.DEFAULT_PORT;
|
||||
subscribeInterface = null;
|
||||
usedChassisSource = AdasConstants.ChassisSource.CHASSIS_UNKNOWN;
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_UNKNOWN;
|
||||
receivedAckManager.stop();
|
||||
if (connectFinish()) {
|
||||
stopPingAddress(false);
|
||||
}
|
||||
if (args != null && args.length > 0) {
|
||||
reason = String.valueOf(args[0]);
|
||||
}
|
||||
}
|
||||
if (adasConnectStatusListener != null) {
|
||||
adasConnectStatusListener.onConnectionIPCStatus(status, reason);
|
||||
}
|
||||
@@ -1026,7 +1019,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 10, 2000L);
|
||||
}, 10, 4000L);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -470,6 +470,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onM1StitchedVideo(@NonNull MessagePad.Header header, @NonNull byte[] data);
|
||||
|
||||
/**
|
||||
* 域控SSM接口接收超时
|
||||
* 状态变动时才会回调,默认SSM状态正常
|
||||
*
|
||||
* @param isTimeout true:SSM接口接收超时 false:SSM接口恢复正常
|
||||
*/
|
||||
void onSsmReceiveTimeout(boolean isTimeout);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
@@ -26,10 +23,6 @@ public class AutopilotAbility230 {
|
||||
private ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
}
|
||||
|
||||
protected AutopilotAbility230() {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
@@ -37,16 +34,6 @@ public class AutopilotAbility250 {
|
||||
private boolean isM1 = false;//是否是M1
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
|
||||
void onStatusQuery();
|
||||
|
||||
void onSendTimeoutMessages();
|
||||
|
||||
void onRemoveTimeoutMessages();
|
||||
}
|
||||
|
||||
protected AutopilotAbility250(int mapVersion, boolean isHQ, boolean isDF, boolean isM1) {
|
||||
this.mapVersion = mapVersion;
|
||||
this.isHQ = isHQ;
|
||||
@@ -57,9 +44,6 @@ public class AutopilotAbility250 {
|
||||
|
||||
|
||||
protected void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
if (listener != null) {
|
||||
listener.onRemoveTimeoutMessages();
|
||||
}
|
||||
onCallback(statusInfo);
|
||||
}
|
||||
|
||||
@@ -140,7 +124,7 @@ public class AutopilotAbility250 {
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_TIMEOUT, "SSM查询超时无响应");
|
||||
}
|
||||
//检测底盘相关
|
||||
if (chassisStates != null) {
|
||||
@@ -184,15 +168,9 @@ public class AutopilotAbility250 {
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (listener != null) {
|
||||
listener.onStatusQuery();
|
||||
}
|
||||
AdasManager.getInstance().sendStatusQueryReq();
|
||||
if (listener != null) {
|
||||
listener.onSendTimeoutMessages();
|
||||
}
|
||||
}
|
||||
}, 2000L, AutopilotAbilityManager.DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}, 1000L, AutopilotAbilityManager.DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
@@ -35,16 +32,6 @@ public class AutopilotAbility330 {
|
||||
private int masterVersion = -1;//Master版本
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
|
||||
void onStatusQuery();
|
||||
|
||||
void onSendTimeoutMessages();
|
||||
|
||||
void onRemoveTimeoutMessages();
|
||||
}
|
||||
|
||||
protected AutopilotAbility330(int mapVersion) {
|
||||
this.mapVersion = mapVersion;
|
||||
this.masterVersion = -1;
|
||||
@@ -55,9 +42,6 @@ public class AutopilotAbility330 {
|
||||
}
|
||||
|
||||
protected void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
if (listener != null) {
|
||||
listener.onRemoveTimeoutMessages();
|
||||
}
|
||||
onCallback(statusInfo);
|
||||
}
|
||||
|
||||
@@ -131,7 +115,7 @@ public class AutopilotAbility330 {
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_TIMEOUT, "SSM查询超时无响应");
|
||||
}
|
||||
if (fsmStatusReasonRespond != null) {
|
||||
int count = fsmStatusReasonRespond.getFsmStatusReasonRespondCount();
|
||||
@@ -149,8 +133,9 @@ public class AutopilotAbility330 {
|
||||
}
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), statusInfo, null, null), unableAutopilotReasons);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), statusInfo, null, fsmStatusReasonRespond), unableAutopilotReasons);
|
||||
}
|
||||
fsmStatusReasonRespond = null;
|
||||
}
|
||||
|
||||
protected synchronized void start(OnAutopilotAbilityListener listener) {
|
||||
@@ -160,13 +145,7 @@ public class AutopilotAbility330 {
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (listener != null) {
|
||||
listener.onStatusQuery();
|
||||
}
|
||||
AdasManager.getInstance().sendStatusQueryReq();
|
||||
if (listener != null) {
|
||||
listener.onSendTimeoutMessages();
|
||||
}
|
||||
}
|
||||
}, 2000L, AutopilotAbilityManager.DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
@@ -32,10 +29,6 @@ public class AutopilotAbility350And360 {
|
||||
private boolean isM1 = false;//是否是M1
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
|
||||
}
|
||||
|
||||
protected AutopilotAbility350And360(int mapVersion, boolean isHQ, boolean isDF, boolean isM1) {
|
||||
this.mapVersion = mapVersion;
|
||||
@@ -115,7 +108,7 @@ public class AutopilotAbility350And360 {
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_TIMEOUT, "SSM超时无响应");
|
||||
}
|
||||
//检测底盘相关
|
||||
if (chassisStates != null) {
|
||||
@@ -162,5 +155,8 @@ public class AutopilotAbility350And360 {
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
protected void onCallTimeout() {
|
||||
onCallback(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
@@ -28,12 +25,6 @@ public class AutopilotAbility360 {
|
||||
private int masterVersion = -1;//Master版本
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected AutopilotAbility360() {
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
@@ -103,7 +94,7 @@ public class AutopilotAbility360 {
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_TIMEOUT, "SSM超时无响应");
|
||||
}
|
||||
if (fsmStatusReasonRespond != null) {
|
||||
int count = fsmStatusReasonRespond.getFsmStatusReasonRespondCount();
|
||||
@@ -123,6 +114,7 @@ public class AutopilotAbility360 {
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), null, statusInfo, fsmStatusReasonRespond), unableAutopilotReasons);
|
||||
}
|
||||
fsmStatusReasonRespond = null;
|
||||
}
|
||||
|
||||
protected void start(OnAutopilotAbilityListener listener) {
|
||||
@@ -133,4 +125,8 @@ public class AutopilotAbility360 {
|
||||
this.masterVersion = -1;
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
protected void onCallTimeout() {
|
||||
onCallback(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -18,6 +15,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
@@ -34,10 +32,9 @@ import system_master.SystemStatusInfo;
|
||||
* <p>
|
||||
* 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态
|
||||
*/
|
||||
public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotAbilityListener, AutopilotAbility250.OnAutopilotAbilityListener, AutopilotAbility330.OnAutopilotAbilityListener, AutopilotAbility350And360.OnAutopilotAbilityListener, AutopilotAbility360.OnAutopilotAbilityListener {
|
||||
public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
private static final String TAG = AutopilotAbilityManager.class.getSimpleName();
|
||||
protected static final int WHAT_TIMEOUT = 0;
|
||||
protected static final int DEFAULT_TIMEOUT = 2500;
|
||||
protected static final long DEFAULT_SSM_TIMEOUT = 5000L;//SSM超时时间
|
||||
protected static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测周期
|
||||
protected static final String[] NODE_INFO_STATE = {"未知状态", "依赖未就绪", "启动中", "运行", "停止", "无法启动状态", "人为启动状态", "人为关闭状态"};
|
||||
protected static final String[] NODE_INFO_STATE_FIXED_FREQUENCY = {"未知状态", "依赖未就绪", "启动中", "运行", "停止", "无法启动状态", "非自动启动状态", "非自动关闭状态"};
|
||||
@@ -46,8 +43,6 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
protected static final String REASON_CHASSIS_PARKING_BRAKE = "请检查手刹";
|
||||
private static volatile AutopilotAbilityManager INSTANCE;
|
||||
private OnAdasListener listener;
|
||||
private Handler handler;
|
||||
private OnAutopilotAbilityListener onAutopilotAbilityListener;
|
||||
private int mapVersion = -1;//工控机版本
|
||||
private boolean isFutianSweeper = false;//是否是福田清扫车
|
||||
private boolean isJinlvM1 = false;//是否是M1
|
||||
@@ -60,15 +55,16 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
private AutopilotAbility350And360 autopilotAbility350And360;
|
||||
private AutopilotAbility360 autopilotAbility360;
|
||||
private Timer startTimer;
|
||||
private Timer ssmTimeoutTimer;//SSM超时计时器
|
||||
private long ssmReceiveTime;//SSM接收时间
|
||||
|
||||
private final AtomicBoolean isOldSsmTimeout = new AtomicBoolean(false);//SSM是否超时 老状态
|
||||
private final AtomicBoolean isInitCarConfig = new AtomicBoolean(false);//车辆信息是否初始化
|
||||
/**
|
||||
* 不能启动自动驾驶的档位
|
||||
*/
|
||||
private Set<Chassis.GearPosition> unableLaunchAutopilotGear;
|
||||
|
||||
public interface OnAutopilotAbilityListener {
|
||||
void onStatusQuery();//查询是被调用
|
||||
}
|
||||
|
||||
|
||||
private AutopilotAbilityManager() {
|
||||
}
|
||||
@@ -132,18 +128,20 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
}
|
||||
}
|
||||
|
||||
public void setCarConfig(MessagePad.CarConfigResp carConfig) {
|
||||
mapVersion = carConfig.getMapVersion();
|
||||
isFutianSweeper = carConfig.getIsFutianSweeper();
|
||||
isJinlvM1 = carConfig.getIsJinlvM1();
|
||||
isHQ = carConfig.getIsHQ();
|
||||
isDF = carConfig.getIsDF();
|
||||
isM1 = carConfig.getIsJinlvM1();
|
||||
taxiUnmanned();
|
||||
if (mapVersion != -1) {
|
||||
stopTimer();
|
||||
CupidLogUtils.i(TAG, "工控机版本=" + mapVersion);
|
||||
initAutopilotAbility();
|
||||
public void setCarConfig(@NonNull MessagePad.CarConfigResp carConfig) {
|
||||
if (!isInitCarConfig.get()) {
|
||||
int version = carConfig.getMapVersion();
|
||||
if (version != 0) {
|
||||
isInitCarConfig.set(true);
|
||||
mapVersion = version;
|
||||
isFutianSweeper = carConfig.getIsFutianSweeper();
|
||||
isJinlvM1 = carConfig.getIsJinlvM1();
|
||||
isHQ = carConfig.getIsHQ();
|
||||
isDF = carConfig.getIsDF();
|
||||
isM1 = carConfig.getIsJinlvM1();
|
||||
taxiUnmanned();
|
||||
initAutopilotAbility();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,38 +156,6 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusQuery() {
|
||||
if (onAutopilotAbilityListener != null) {
|
||||
onAutopilotAbilityListener.onStatusQuery();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendTimeoutMessages() {
|
||||
onRemoveTimeoutMessages();
|
||||
if (handler != null) {
|
||||
handler.sendEmptyMessageDelayed(WHAT_TIMEOUT, DEFAULT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoveTimeoutMessages() {
|
||||
if (handler != null) {
|
||||
if (handler.hasMessages(WHAT_TIMEOUT))
|
||||
handler.removeMessages(WHAT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHandler(Handler handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
|
||||
public void setOnAutopilotAbilityListener(OnAutopilotAbilityListener onAutopilotAbilityListener) {
|
||||
this.onAutopilotAbilityListener = onAutopilotAbilityListener;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* SSM状态更新
|
||||
@@ -197,6 +163,8 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
* @param statusInfo SSM
|
||||
*/
|
||||
public void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
ssmReceiveTime = System.currentTimeMillis();
|
||||
onCallSSMTimeout(false);
|
||||
if (autopilotAbility250 != null) {
|
||||
autopilotAbility250.setStatusInfo(statusInfo);
|
||||
}
|
||||
@@ -206,6 +174,8 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
}
|
||||
|
||||
public void setStatusInfo(SsmInfo.SsmStatusInf statusInfo) {
|
||||
ssmReceiveTime = System.currentTimeMillis();
|
||||
onCallSSMTimeout(false);
|
||||
if (autopilotAbility350And360 != null) {
|
||||
autopilotAbility350And360.setStatusInfo(statusInfo);
|
||||
}
|
||||
@@ -259,24 +229,11 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
}
|
||||
}
|
||||
|
||||
public void onHandleMessage(Message msg) {
|
||||
if (msg.what == WHAT_TIMEOUT) {
|
||||
if (autopilotAbility250 != null) {
|
||||
autopilotAbility250.onCallTimeout();
|
||||
}
|
||||
if (autopilotAbility330 != null) {
|
||||
autopilotAbility330.onCallTimeout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initAutopilotAbility() {
|
||||
stopAllTimer();
|
||||
if (mapVersion >= 30600 && isFutianSweeper) {
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:360清扫车专用");
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
stop350And360();
|
||||
if (autopilotAbility360 == null) {
|
||||
autopilotAbility360 = new AutopilotAbility360();
|
||||
autopilotAbility360.start(this);
|
||||
@@ -284,10 +241,6 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
|
||||
} else if ((mapVersion >= 30500 && (isJinlvM1 || isHQ)) || mapVersion >= 30600) {
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:350和360共用");
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
stop360();
|
||||
if (autopilotAbility350And360 == null) {
|
||||
autopilotAbility350And360 = new AutopilotAbility350And360(mapVersion, isHQ, isDF, isM1);
|
||||
autopilotAbility350And360.start(this);
|
||||
@@ -295,35 +248,25 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
|
||||
} else if (mapVersion >= 30300 && isFutianSweeper) {//目前只有MAP330的清扫车用的新的FSM状态原因查询
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:330清扫车专用");
|
||||
stop230();
|
||||
stop250();
|
||||
stop350And360();
|
||||
stop360();
|
||||
if (autopilotAbility330 == null) {
|
||||
autopilotAbility330 = new AutopilotAbility330(mapVersion);
|
||||
autopilotAbility330.start(this);
|
||||
}
|
||||
} else if (mapVersion >= 20500) {
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:250");
|
||||
stop230();
|
||||
stop330();
|
||||
stop350And360();
|
||||
stop360();
|
||||
if (autopilotAbility250 == null) {
|
||||
autopilotAbility250 = new AutopilotAbility250(mapVersion, isHQ, isDF, isM1);
|
||||
autopilotAbility250.start(this);
|
||||
}
|
||||
} else {
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:230");
|
||||
stop250();
|
||||
stop330();
|
||||
stop350And360();
|
||||
stop360();
|
||||
if (autopilotAbility230 == null) {
|
||||
autopilotAbility230 = new AutopilotAbility230();
|
||||
autopilotAbility230.start(this);
|
||||
}
|
||||
|
||||
}
|
||||
if (autopilotAbility230 == null) {
|
||||
startSsmTimeoutTimer();//MAP230及以下没有SSM所以不需要超时
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,24 +322,79 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
|
||||
startTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mapVersion == -1 && AdasManager.getInstance().getIpcConnectionStatus() == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
if (!isInitCarConfig.get() && AdasManager.getInstance().getIpcConnectionStatus() == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
mapVersion = 20300;
|
||||
initAutopilotAbility();
|
||||
}
|
||||
}
|
||||
}, 8000L);//8秒原因:需要后去CarConfig 对象,两个地方调用initAutopilotAbility(); 初始化 一个在这,另一个在setCarConfig(),如果setCarConfig() 证明获取版本还未成功,获取版本会重试3次每次间隔两秒
|
||||
}, 15000L);//15秒原因:需要后去CarConfig 对象,两个地方调用initAutopilotAbility(); 初始化 一个在这,另一个在setCarConfig(),如果setCarConfig() 证明获取版本还未成功,获取版本会重试3次每次间隔四秒
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
|
||||
private void stopSsmTimeoutTimer() {
|
||||
if (ssmTimeoutTimer != null) {
|
||||
isOldSsmTimeout.set(false);
|
||||
ssmReceiveTime = 0;
|
||||
ssmTimeoutTimer.cancel();
|
||||
ssmTimeoutTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接工控机成功调用此函数,如果dockerVersion还未获取到将启动最低版本的启动自动驾驶能力检测
|
||||
* 此函数为保险措施 以防无法获取工控机版本时 也能 正常执行逻辑
|
||||
*/
|
||||
public synchronized void startSsmTimeoutTimer() {
|
||||
if (ssmTimeoutTimer == null) {
|
||||
ssmReceiveTime = System.currentTimeMillis();
|
||||
ssmTimeoutTimer = new Timer();
|
||||
ssmTimeoutTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
long timeDifference = System.currentTimeMillis() - ssmReceiveTime;
|
||||
if (timeDifference >= DEFAULT_SSM_TIMEOUT) {
|
||||
onCallSSMTimeout(true);
|
||||
//超时
|
||||
if (autopilotAbility250 != null) {
|
||||
autopilotAbility250.onCallTimeout();
|
||||
}
|
||||
if (autopilotAbility330 != null) {
|
||||
autopilotAbility330.onCallTimeout();
|
||||
}
|
||||
if (autopilotAbility350And360 != null) {
|
||||
autopilotAbility350And360.onCallTimeout();
|
||||
}
|
||||
if (autopilotAbility360 != null) {
|
||||
autopilotAbility360.onCallTimeout();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1000L, DEFAULT_SSM_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void onCallSSMTimeout(boolean isTimeout) {
|
||||
if (isTimeout != isOldSsmTimeout.get()) {
|
||||
isOldSsmTimeout.set(isTimeout);
|
||||
listener.onSsmReceiveTimeout(isTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopAllTimer() {
|
||||
stopSsmTimeoutTimer();
|
||||
stopTimer();
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
stop350And360();
|
||||
stop360();
|
||||
handler = null;
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
stopAllTimer();
|
||||
isInitCarConfig.set(false);
|
||||
mapVersion = -1;
|
||||
isFutianSweeper = false;
|
||||
isHQ = false;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
}
|
||||
@@ -41,22 +41,19 @@ public class CarConfigRespMessage extends MyAbstractMessageHandler {
|
||||
* 添加私有参数
|
||||
*/
|
||||
private MessagePad.CarConfigResp addPersonalParameter(MessagePad.CarConfigResp carConfigResp) {
|
||||
if (carConfigResp != null) {
|
||||
String dockVersion = carConfigResp.getDockVersion();
|
||||
String carType = carConfigResp.getCarType().toLowerCase();
|
||||
String subCarType = carConfigResp.getSubCarType().toLowerCase();
|
||||
MessagePad.CarConfigResp.Builder builder = carConfigResp.toBuilder();
|
||||
builder.setMapVersion(AdasManager.getInstance().parseVersion(dockVersion));
|
||||
builder.setIsDF("df".equals(carType))//是否是东风
|
||||
.setIsHQ("hq".equals(carType))//是否是红旗
|
||||
.setIsJinlv("jinlv".equals(carType) && TextUtils.isEmpty(subCarType))//是否是金旅小巴
|
||||
.setIsJinlvM1("jinlv".equals(carType) && "m1".equals(subCarType))//是否是金旅M1
|
||||
.setIsJinlvM2("jinlv".equals(carType) && "m2".equals(subCarType))//是否是金旅M2
|
||||
.setIsFutianSweeper("sweeper".equals(carType))//是否是福田清扫车
|
||||
.setIsKaiwo("kaiwo".equals(carType));//是否是开沃
|
||||
return builder.build();
|
||||
}
|
||||
return null;
|
||||
String dockVersion = carConfigResp.getDockVersion();
|
||||
String carType = carConfigResp.getCarType().toLowerCase();
|
||||
String subCarType = carConfigResp.getSubCarType().toLowerCase();
|
||||
MessagePad.CarConfigResp.Builder builder = carConfigResp.toBuilder();
|
||||
builder.setMapVersion(AdasManager.getInstance().parseVersion(dockVersion));
|
||||
builder.setIsDF("df".equals(carType))//是否是东风
|
||||
.setIsHQ("hq".equals(carType))//是否是红旗
|
||||
.setIsJinlv("jinlv".equals(carType) && TextUtils.isEmpty(subCarType))//是否是金旅小巴
|
||||
.setIsJinlvM1("jinlv".equals(carType) && "m1".equals(subCarType))//是否是金旅M1
|
||||
.setIsJinlvM2("jinlv".equals(carType) && "m2".equals(subCarType))//是否是金旅M2
|
||||
.setIsFutianSweeper("sweeper".equals(carType))//是否是福田清扫车
|
||||
.setIsKaiwo("kaiwo".equals(carType));//是否是开沃
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import android.os.SystemClock;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
@@ -27,10 +27,6 @@ public class DispatchHandler {
|
||||
private BaseHandler mBaseHandler;
|
||||
|
||||
public interface OnDispatchHandlerListener {
|
||||
void onHandler(MessagePad.MessageType type, Handler handler);
|
||||
|
||||
void onHandleMessage(MessagePad.MessageType type, Message msg);
|
||||
|
||||
void onDispatchRaw(MessagePad.MessageType type, RawData raw);
|
||||
}
|
||||
|
||||
@@ -46,7 +42,6 @@ public class DispatchHandler {
|
||||
mThread = new HandlerThread(name);
|
||||
mThread.start();
|
||||
initHandler(mThread.getLooper());
|
||||
listener.onHandler(messageType, mBaseHandler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,8 +91,6 @@ public class DispatchHandler {
|
||||
}
|
||||
}
|
||||
listener.onDispatchRaw(messageType, (RawData) msg.obj);
|
||||
} else {
|
||||
listener.onHandleMessage(messageType, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user