500ms上报数据增加cityCode
This commit is contained in:
@@ -16,6 +16,8 @@ public class WebSocketData implements Serializable {
|
||||
|
||||
private long upUtcTime;
|
||||
|
||||
private String cityCode;
|
||||
|
||||
public long getSeq() {
|
||||
return seq;
|
||||
}
|
||||
@@ -63,4 +65,12 @@ public class WebSocketData implements Serializable {
|
||||
public void setUpUtcTime(long upUtcTime) {
|
||||
this.upUtcTime = upUtcTime;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode(String cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.annotation.Keep;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.connection.IMogoMsgAckListener;
|
||||
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
|
||||
@@ -140,15 +141,20 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
webSocketData.setMsgType(listener.getUpLinkType().getMsgType());
|
||||
webSocketData.setSn(Utils.getSn());
|
||||
webSocketData.setData(GsonUtil.jsonFromObject(body));
|
||||
MogoLocation lastKnown = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
|
||||
if (lastKnown != null) {
|
||||
webSocketData.setCityCode(lastKnown.getCityCode());
|
||||
}
|
||||
String msg = GsonUtil.jsonFromObject(webSocketData);
|
||||
Logger.d(TAG,"sendMsg : " + msg);
|
||||
handlerThread.sendMsg(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private Context context;
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user