reset the mock upload location service code
This commit is contained in:
@@ -108,11 +108,10 @@ public class SocketManager implements IMogoCloudSocketManager {
|
||||
@Override
|
||||
public void sendMsg(String appId, int headerType, MsgBody body, IMogoCloudSocketMsgAckListener listener) {
|
||||
Logger.d(TAG, "sendMsg msgId : " + body.getMsgId());
|
||||
final byte[] pb = convertToPBBytes(body.getMsgType(), body.getContent());
|
||||
if (cloudClientConfig.isThirdLogin()) {
|
||||
ThirdSocketManager.getInstance().sendMsg(appId, pb, headerType, true, body.getMsgId());
|
||||
ThirdSocketManager.getInstance().sendMsg(appId, body.getContent(), headerType, true, body.getMsgId());
|
||||
} else {
|
||||
InternalSocketManager.getInstance().sendMsg(pb, headerType, true, body.getMsgId());
|
||||
InternalSocketManager.getInstance().sendMsg(body.getContent(), headerType, true, body.getMsgId());
|
||||
}
|
||||
mAckListeners.put(body.getMsgId(), listener);
|
||||
}
|
||||
@@ -138,7 +137,7 @@ public class SocketManager implements IMogoCloudSocketManager {
|
||||
Class clz = listener.target(msgType);
|
||||
if ("SocketDownDataProto".equals(clz.getSimpleName())) {
|
||||
obj = SocketDownData.SocketDownDataProto.parseFrom(payload.getPayload());
|
||||
}else{
|
||||
} else {
|
||||
obj = GsonUtil.objectFromJson(payload.getPayload().toStringUtf8(), listener.target(msgType));
|
||||
}
|
||||
}
|
||||
@@ -180,6 +179,13 @@ public class SocketManager implements IMogoCloudSocketManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将byte数组转换成PB数据
|
||||
*
|
||||
* @param msgType 消息类型
|
||||
* @param payloadBytes 原始数据
|
||||
* @return PB数据
|
||||
*/
|
||||
private byte[] convertToPBBytes(int msgType, byte[] payloadBytes) {
|
||||
MogoConnsvr.Payload payloadData = MogoConnsvr.Payload.newBuilder()
|
||||
.setMsgType(msgType)
|
||||
|
||||
Reference in New Issue
Block a user