refix name
This commit is contained in:
@@ -2,5 +2,5 @@ package com.mogo.realtime.constant;
|
||||
|
||||
public class RealTimeConstant {
|
||||
|
||||
public static final String TAG = "MoGoAiCloudRealTime";
|
||||
public static final String TAG = "MoGoAiCloud_RealTime";
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MogoRTKLocation {
|
||||
Logger.e(TAG, "暂无定位数据");
|
||||
return list;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
cacheList.clear();
|
||||
}
|
||||
return list;
|
||||
@@ -58,28 +58,20 @@ public class MogoRTKLocation {
|
||||
public void init() {
|
||||
locationManager = (LocationManager) MoGoAiCloudClient.getInstance().getContext().getSystemService(Context.LOCATION_SERVICE);
|
||||
String provider = locationManager.getBestProvider(getCriteria(), true);
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "init provider : " + provider);
|
||||
}
|
||||
Logger.d(TAG, "init provider : " + provider);
|
||||
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
|
||||
try {
|
||||
locationManager.requestLocationUpdates(provider, 0, 0, locationListener);
|
||||
Location location = locationManager.getLastKnownLocation(provider);
|
||||
if (location != null) {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.i(TAG, "location : " + location.toString());
|
||||
}
|
||||
Logger.i(TAG, "location : " + location.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "RTK LocationManager requestLocationUpdates has Exception : " + e.getMessage());
|
||||
}
|
||||
Logger.d(TAG, "RTK LocationManager requestLocationUpdates has Exception : " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "RTK LocationManager Provider GPS_PROVIDER unable");
|
||||
}
|
||||
Logger.d(TAG, "RTK LocationManager Provider GPS_PROVIDER unable");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -110,31 +102,23 @@ public class MogoRTKLocation {
|
||||
locInfo = cloudLocationInfo;
|
||||
cacheList.add(cloudLocationInfo);
|
||||
} else {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.e(TAG, "location == null");
|
||||
}
|
||||
Logger.e(TAG, "location == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "onStatusChanged status: " + status);
|
||||
}
|
||||
Logger.d(TAG, "onStatusChanged status: " + status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderEnabled(String provider) {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "onProviderEnabled");
|
||||
}
|
||||
Logger.d(TAG, "onProviderEnabled");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderDisabled(String provider) {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "onProviderEnabled");
|
||||
}
|
||||
Logger.d(TAG, "onProviderEnabled");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -142,15 +126,11 @@ public class MogoRTKLocation {
|
||||
* 关闭定位服务
|
||||
*/
|
||||
public void stop() {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "stop RTK Location");
|
||||
}
|
||||
Logger.d(TAG, "stop RTK Location");
|
||||
if (locationManager != null && locationListener != null) {
|
||||
locationManager.removeUpdates(locationListener);
|
||||
} else {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Logger.d(TAG, "stop failed , reason : loc" + locationManager + " , or loc listener: " + locationListener + " is null");
|
||||
}
|
||||
Logger.d(TAG, "stop failed , reason : loc" + locationManager + " , or loc listener: " + locationListener + " is null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.realtime.socket;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener;
|
||||
@@ -17,6 +16,7 @@ import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.entity.OnePerSecondSendContent;
|
||||
import com.mogo.realtime.spi.RealTimeProviderImp;
|
||||
import com.mogo.realtime.util.MortonCode;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.ptech.connsvr.protocol.MogoConnsvr;
|
||||
|
||||
@@ -115,9 +115,7 @@ public class SocketHandler {
|
||||
if (msgType == MSG_TYPE_DOWNLINK_CAR_DATA.getMsgType()) {
|
||||
MogoSnapshotSetData data = GsonUtil.objectFromJson(webSocketData.getData(), MogoSnapshotSetData.class);
|
||||
if (data == null) {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Log.e(TAG, "onMsgReceived MogoSnapshotSetData == null ");
|
||||
}
|
||||
Logger.e(TAG, "onMsgReceived MogoSnapshotSetData == null ");
|
||||
return;
|
||||
}
|
||||
for (IMogoCloudOnMsgListener listener : onMsgListenerList) {
|
||||
@@ -136,9 +134,7 @@ public class SocketHandler {
|
||||
*/
|
||||
public void sendMsg(List<CloudLocationInfo> cloudLocationInfo) {
|
||||
if (cloudLocationInfo == null) {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Log.e(TAG, "请检查传入数组对象为Null");
|
||||
}
|
||||
Logger.e(TAG, "请检查传入数组对象为Null");
|
||||
return;
|
||||
}
|
||||
CloudLocationInfo lastInfo = null;
|
||||
@@ -170,9 +166,7 @@ public class SocketHandler {
|
||||
|
||||
if (content.self == null &&
|
||||
(content.adas == null || content.adas.isEmpty())) {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
|
||||
Log.d(TAG, "no information to sent");
|
||||
}
|
||||
Logger.d(TAG, "no information to sent");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user