opt cityCode

This commit is contained in:
tongchenfei
2020-12-20 12:00:39 +08:00
parent 760e9ff4c3
commit 6e551a0203

View File

@@ -142,8 +142,10 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
webSocketData.setSn(Utils.getSn());
webSocketData.setData(GsonUtil.jsonFromObject(body));
MogoLocation lastKnown = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
if (lastKnown != null) {
if (lastKnown != null&&!lastKnown.getCityCode().isEmpty()) {
webSocketData.setCityCode(lastKnown.getCityCode());
}else{
webSocketData.setCityCode(null);
}
String msg = GsonUtil.jsonFromObject(webSocketData);
Logger.d(TAG,"sendMsg : " + msg);