diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 1f8e3ef..5674e0c 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -26,6 +26,7 @@
+
diff --git a/foudations/mogo-live/consumer-rules.pro b/foudations/mogo-live/consumer-rules.pro
index e69de29..0c5f89c 100644
--- a/foudations/mogo-live/consumer-rules.pro
+++ b/foudations/mogo-live/consumer-rules.pro
@@ -0,0 +1 @@
+-keep class com.zhidao.ptech.shadow.server.protocol.DeviceInfo{*;}
\ No newline at end of file
diff --git a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/network/LiveApiServer.java b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/network/LiveApiServer.java
index ab2c03c..4528823 100644
--- a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/network/LiveApiServer.java
+++ b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/network/LiveApiServer.java
@@ -4,8 +4,12 @@ import com.mogo.cloud.live.model.BaseData;
import com.mogo.cloud.live.model.LiveStatusInfo;
import com.mogo.cloud.live.model.StartCarAlarmInfo;
+import java.util.Map;
+
import okhttp3.RequestBody;
import retrofit2.http.Body;
+import retrofit2.http.FieldMap;
+import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import rx.Observable;
@@ -31,4 +35,21 @@ public interface LiveApiServer {
@POST("/alarm/car/video/reportCameraStatus")
Observable uploadCamStatus(@Body RequestBody body);
+ /**
+ * 获取车辆前方直播Url
+ * @param vehicleHeadLiveMap 请求数据
+ * @return {@link BaseData}
+ */
+ @FormUrlEncoded
+ @POST("")
+ Observable getVehicleHeadLive(@FieldMap Map vehicleHeadLiveMap);
+
+ /**
+ * 获取前方路口直播Url
+ * @param intersectionLiveMap 请求数据
+ * @return {@link BaseData}
+ */
+ @FormUrlEncoded
+ @POST("")
+ Observable getIntersectionLive(@FieldMap Map intersectionLiveMap);
}
diff --git a/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketManager.java b/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketManager.java
index 3541a4b..e3d0133 100644
--- a/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketManager.java
+++ b/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketManager.java
@@ -30,16 +30,16 @@ import static com.mogo.cloud.httpdns.MogoHttpDnsConfig.HTTP_DNS_ENV_DEMO;
import static com.mogo.cloud.httpdns.MogoHttpDnsConfig.HTTP_DNS_ENV_DEV;
import static com.mogo.cloud.httpdns.MogoHttpDnsConfig.HTTP_DNS_ENV_QA;
import static com.mogo.cloud.httpdns.MogoHttpDnsConfig.HTTP_DNS_ENV_RELEASE;
+import static com.mogo.cloud.socket.SocketServicesConstants.TAG;
+
/**
* Socket 长链核心服务
*/
public class SocketManager implements IMogoCloudSocketManager, Callback {
- private static final String TAG = "SocketManager";
private static volatile SocketManager mInstance;
private MoGoAiCloudClientConfig cloudClientConfig;
- private String mAppId;
private SocketManager() {
CallbackManager.getInstance().register(this);
diff --git a/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketServicesConstants.java b/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketServicesConstants.java
index cfb4a91..24c9271 100644
--- a/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketServicesConstants.java
+++ b/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/SocketServicesConstants.java
@@ -4,6 +4,8 @@ import androidx.annotation.Keep;
public class SocketServicesConstants {
+ public static final String TAG = "MoGoAiCloud_Socket";
+
/**
* 建立长链的通道ID
*/
diff --git a/modules/mogo-realtime/src/main/java/com/mogo/realtime/constant/RealTimeConstant.java b/modules/mogo-realtime/src/main/java/com/mogo/realtime/constant/RealTimeConstant.java
index 9774f41..6002303 100644
--- a/modules/mogo-realtime/src/main/java/com/mogo/realtime/constant/RealTimeConstant.java
+++ b/modules/mogo-realtime/src/main/java/com/mogo/realtime/constant/RealTimeConstant.java
@@ -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";
}
diff --git a/modules/mogo-realtime/src/main/java/com/mogo/realtime/location/MogoRTKLocation.java b/modules/mogo-realtime/src/main/java/com/mogo/realtime/location/MogoRTKLocation.java
index f7c50c6..5f3c7e3 100644
--- a/modules/mogo-realtime/src/main/java/com/mogo/realtime/location/MogoRTKLocation.java
+++ b/modules/mogo-realtime/src/main/java/com/mogo/realtime/location/MogoRTKLocation.java
@@ -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");
}
}
diff --git a/modules/mogo-realtime/src/main/java/com/mogo/realtime/socket/SocketHandler.java b/modules/mogo-realtime/src/main/java/com/mogo/realtime/socket/SocketHandler.java
index 8ecbae0..8e60e8f 100644
--- a/modules/mogo-realtime/src/main/java/com/mogo/realtime/socket/SocketHandler.java
+++ b/modules/mogo-realtime/src/main/java/com/mogo/realtime/socket/SocketHandler.java
@@ -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) {
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;
}
@@ -181,15 +175,13 @@ public class SocketHandler {
webSocketData.setSeq(computeSendMsgTime());
webSocketData.setSn(MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn());
webSocketData.setData(GsonUtil.jsonFromObject(content));
- String msg = GsonUtil.jsonFromObject(webSocketData);
-
int msgType = LOW_FREQUENCY_CHANNEL_ID;
if (cloudLocationInfo.size() > 2) {
msgType = HIGH_FREQUENCY_CHANNEL_ID;
}
MsgBody msgBody = new MsgBody();
msgBody.msgType(msgType);
- msgBody.content(msg);
+ msgBody.content(webSocketData);
SocketManager.getInstance().sendMsg(mAppId, HEADER_TYPE, msgBody, msgId -> {
for (IMogoCloudOnMsgListener listener : onMsgListenerList) {
if (listener != null) {
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java
index 36b1423..b6dbed7 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java
@@ -22,8 +22,6 @@ import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
-import static android.content.ContentValues.TAG;
-
/**
* @author lixiaopeng
* @description 道路搜索
@@ -81,7 +79,7 @@ public class MogoRoadSearchManager {
@Override
public void onNext(@NonNull BaseData roadInfos) {
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.d(HttpConstant.TANLU, "queryRoadInfos onNext roadInfos = " + roadInfos.getResult().getData());
+ Log.d(HttpConstant.TAG, "queryRoadInfos onNext roadInfos = " + roadInfos.getResult().getData());
}
callback.onSuccess(roadInfos);
}
@@ -94,7 +92,7 @@ public class MogoRoadSearchManager {
@Override
public void onComplete() {
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.d(HttpConstant.TANLU, "queryRoadInfos onComplete ");
+ Log.d(HttpConstant.TAG, "queryRoadInfos onComplete ");
}
}
});
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/constant/HttpConstant.java b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/constant/HttpConstant.java
index 3e0a788..d604b7b 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/constant/HttpConstant.java
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/constant/HttpConstant.java
@@ -6,5 +6,5 @@ package com.mogo.cloud.tanlu.constant;
* @since 2021/1/20
*/
public class HttpConstant {
- public static final String TANLU = "TANLU_MODULE";
+ public static final String TAG = "MoGoAiCloud_TanLu";
}
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java
index d8b2d19..a4e39ec 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java
@@ -72,7 +72,7 @@ public class CosUpload implements CosStatusCallback {
videoCoverImage = getVideoPicPath();
boolean isSuccess = getVideoThumbnail(info.getFilePath(), videoCoverImage);
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.d(HttpConstant.TANLU, "isSuccess = " + isSuccess + "--videoCoverImage = " + videoCoverImage);
+ Log.d(HttpConstant.TAG, "isSuccess = " + isSuccess + "--videoCoverImage = " + videoCoverImage);
}
filePath.add(info.getFilePath());
filePath.add(videoCoverImage);
@@ -81,7 +81,7 @@ public class CosUpload implements CosStatusCallback {
filePath.add(info.getFilePath());
}
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.d(HttpConstant.TANLU, "filePath.size() = " + filePath.size());
+ Log.d(HttpConstant.TAG, "filePath.size() = " + filePath.size());
}
CosUploadManagerImpl.getInstance(mContext.getApplicationContext())
.upload(filePath, mPicEventId, DbPriorityConfig.PRIORITY_HIGH);
@@ -99,8 +99,8 @@ public class CosUpload implements CosStatusCallback {
@Override
public void uploadCosCompleted(String cosPath, String eventId, String downloadUrl, String localPath) {
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.d(HttpConstant.TANLU, "uploadCosCompleted ----> cosPath =" + cosPath + "--eventId =" + eventId);
- Log.d(HttpConstant.TANLU, "uploadCosCompleted ----> downloadUrl =" + downloadUrl + "--localPath =" + localPath);
+ Log.d(HttpConstant.TAG, "uploadCosCompleted ----> cosPath =" + cosPath + "--eventId =" + eventId);
+ Log.d(HttpConstant.TAG, "uploadCosCompleted ----> downloadUrl =" + downloadUrl + "--localPath =" + localPath);
}
if (filePath.size() == 2) {
if (isVideo(localPath)) { //如果是视频 localPath
@@ -109,7 +109,7 @@ public class CosUpload implements CosStatusCallback {
mCosPicUrl = downloadUrl;
}
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.d(HttpConstant.TANLU, "mCosVideoUrl = " + mCosVideoUrl + " >>>mCosPicUrl = " + mCosPicUrl);
+ Log.d(HttpConstant.TAG, "mCosVideoUrl = " + mCosVideoUrl + " >>>mCosPicUrl = " + mCosPicUrl);
}
if (mCosPicUrl != null && mCosVideoUrl != null) {
sendInformation();
@@ -123,7 +123,7 @@ public class CosUpload implements CosStatusCallback {
@Override
public void uploadCosFailed(String cosPath, String eventId, String localPath) {
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.e(HttpConstant.TANLU, "uploadCosFailed ----> cosPath = " + cosPath + "--eventId =" + eventId + "--localPath =" + localPath);
+ Log.e(HttpConstant.TAG, "uploadCosFailed ----> cosPath = " + cosPath + "--eventId =" + eventId + "--localPath =" + localPath);
}
sendInformation();
}
@@ -149,7 +149,7 @@ public class CosUpload implements CosStatusCallback {
public void onSuccess(BaseData result) {
if (result != null && result.getResult() != null) {
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isShowDebugLog()) {
- Log.d(HttpConstant.TANLU, "uploadRoadInfo result.id = " + result.getResult().id);
+ Log.d(HttpConstant.TAG, "uploadRoadInfo result.id = " + result.getResult().id);
}
}
mCallback.onSuccess(result);
diff --git a/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/api/MoGoAiCloudTrafficLive.java b/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/api/MoGoAiCloudTrafficLive.java
index 49e9f14..4dbba3c 100644
--- a/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/api/MoGoAiCloudTrafficLive.java
+++ b/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/api/MoGoAiCloudTrafficLive.java
@@ -5,14 +5,14 @@ public class MoGoAiCloudTrafficLive {
/**
* 查看前方车辆直播
*/
- public static void getVehicleHeadLiveUrl(ITrafficLiveCallBack callBack) {
+ public static void viewVehicleHeadLive(ITrafficLiveCallBack callBack) {
}
/**
* 查看前方路口直播
*/
- public static void getIntersectionLiveUrl(ITrafficLiveCallBack callBack) {
+ public static void viewIntersectionLive(ITrafficLiveCallBack callBack) {
}
}
diff --git a/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/constant/TrafficLiveConstant.java b/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/constant/TrafficLiveConstant.java
index bd2471d..779761e 100644
--- a/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/constant/TrafficLiveConstant.java
+++ b/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/constant/TrafficLiveConstant.java
@@ -2,5 +2,5 @@ package com.mogo.cloud.trafficlive.constant;
public class TrafficLiveConstant {
- public static final String TAG = "TrafficLiveConstant";
+ public static final String TAG = "MoGoAiCloud_TrafficLive";
}
diff --git a/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/core/TrafficLiveManager.java b/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/core/TrafficLiveManager.java
index 5f9a182..8746ca9 100644
--- a/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/core/TrafficLiveManager.java
+++ b/modules/mogo-trafficlive/src/main/java/com/mogo/cloud/trafficlive/core/TrafficLiveManager.java
@@ -23,4 +23,8 @@ public class TrafficLiveManager {
public void getVehicleHeadLiveUrl(ITrafficLiveCallBack callBack){
}
+
+ public void getIntersectionLiveUrl(ITrafficLiveCallBack callBack){
+
+ }
}