diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 8116b81..e98503b 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -15,6 +15,7 @@
+
diff --git a/foudations/mogo-location/.gitignore b/foudations/mogo-location/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/foudations/mogo-location/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/foudations/mogo-location/build.gradle b/foudations/mogo-location/build.gradle
new file mode 100644
index 0000000..affc8f0
--- /dev/null
+++ b/foudations/mogo-location/build.gradle
@@ -0,0 +1,41 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+
+ defaultConfig {
+ minSdkVersion rootProject.ext.android.minSdkVersion
+ targetSdkVersion rootProject.ext.android.targetSdkVersion
+
+ versionCode 1
+ versionName "${MOGO_LOCATION_VERSION}"
+
+ consumerProguardFiles "consumer-rules.pro"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+ // 上报位置
+ implementation 'com.zhidao.locupload:loc-upload-sdk:1.1.7'
+ api rootProject.ext.dependencies.spi
+
+ if (Boolean.valueOf(RELEASE)) {
+ implementation "com.mogo.cloud:passport:${MOGO_PASSPORT_VERSION}"
+ } else {
+ implementation project(path: ':foudations:mogo-passport')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
\ No newline at end of file
diff --git a/foudations/mogo-location/consumer-rules.pro b/foudations/mogo-location/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
diff --git a/foudations/mogo-location/gradle.properties b/foudations/mogo-location/gradle.properties
new file mode 100644
index 0000000..0da4515
--- /dev/null
+++ b/foudations/mogo-location/gradle.properties
@@ -0,0 +1,4 @@
+GROUP=com.mogo.cloud
+POM_ARTIFACT_ID=location
+VERSION_CODE=1
+VERSION_NAME=1.0.0-SNAPSHOT
\ No newline at end of file
diff --git a/foudations/mogo-location/proguard-rules.pro b/foudations/mogo-location/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/foudations/mogo-location/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/foudations/mogo-location/src/main/AndroidManifest.xml b/foudations/mogo-location/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..ef42342
--- /dev/null
+++ b/foudations/mogo-location/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/foudations/mogo-location/src/main/java/com/mogo/cloud/location/IMogoLocationInfoService.java b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/IMogoLocationInfoService.java
new file mode 100644
index 0000000..710b23e
--- /dev/null
+++ b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/IMogoLocationInfoService.java
@@ -0,0 +1,20 @@
+package com.mogo.cloud.location;
+
+import android.content.Context;
+
+/**
+ * 位置服务:上报位置信息和车机状态
+ */
+public interface IMogoLocationInfoService {
+
+ /**
+ * 初始化
+ *
+ * @param context 上下文
+ */
+ void init(Context context);
+
+ void start();
+
+ void stop();
+}
diff --git a/foudations/mogo-location/src/main/java/com/mogo/cloud/location/LocationManager.java b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/LocationManager.java
new file mode 100644
index 0000000..d47e8ed
--- /dev/null
+++ b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/LocationManager.java
@@ -0,0 +1,56 @@
+package com.mogo.cloud.location;
+
+import android.content.Context;
+
+import com.mogo.cloud.location.internal.InternalLocationManager;
+import com.mogo.cloud.location.third.ThirdLocationManager;
+import com.mogo.cloud.passport.MoGoAiCloudClient;
+import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
+
+public class LocationManager implements IMogoLocationInfoService {
+
+ private static volatile LocationManager mInstance;
+ private MoGoAiCloudClientConfig cloudClientConfig;
+
+ private LocationManager() {
+ cloudClientConfig = MoGoAiCloudClient.getInstance().getAiCloudClientConfig();
+ }
+
+ public static LocationManager getInstance() {
+ if (mInstance == null) {
+ synchronized (LocationManager.class) {
+ if (mInstance == null) {
+ mInstance = new LocationManager();
+ }
+ }
+ }
+ return mInstance;
+ }
+
+ @Override
+ public void init(Context context) {
+ if (cloudClientConfig.isThirdLogin()) {
+ ThirdLocationManager.getInstance().init(context);
+ } else {
+ InternalLocationManager.getInstance().init(context);
+ }
+ }
+
+ @Override
+ public void start() {
+ if (cloudClientConfig.isThirdLogin()) {
+ ThirdLocationManager.getInstance().start();
+ } else {
+ InternalLocationManager.getInstance().start();
+ }
+ }
+
+ @Override
+ public void stop() {
+ if (cloudClientConfig.isThirdLogin()) {
+ ThirdLocationManager.getInstance().stop();
+ } else {
+ InternalLocationManager.getInstance().stop();
+ }
+ }
+}
diff --git a/foudations/mogo-location/src/main/java/com/mogo/cloud/location/internal/InternalLocationManager.java b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/internal/InternalLocationManager.java
new file mode 100644
index 0000000..038be56
--- /dev/null
+++ b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/internal/InternalLocationManager.java
@@ -0,0 +1,31 @@
+package com.mogo.cloud.location.internal;
+
+import android.content.Context;
+
+public class InternalLocationManager {
+
+ private static volatile InternalLocationManager mInstance;
+
+ public static InternalLocationManager getInstance() {
+ if (mInstance == null) {
+ synchronized (InternalLocationManager.class) {
+ if (mInstance == null) {
+ mInstance = new InternalLocationManager();
+ }
+ }
+ }
+ return mInstance;
+ }
+
+ public void init(Context context) {
+
+ }
+
+ public void start() {
+
+ }
+
+ public void stop() {
+
+ }
+}
diff --git a/foudations/mogo-location/src/main/java/com/mogo/cloud/location/third/ThirdLocationManager.java b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/third/ThirdLocationManager.java
new file mode 100644
index 0000000..914cb87
--- /dev/null
+++ b/foudations/mogo-location/src/main/java/com/mogo/cloud/location/third/ThirdLocationManager.java
@@ -0,0 +1,50 @@
+package com.mogo.cloud.location.third;
+
+import android.content.Context;
+
+import com.mogo.cloud.passport.MoGoAiCloudClient;
+import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
+import com.mogo.cloud.utils.logger.Logger;
+import com.zhidao.locupload.LocUploadConfig;
+import com.zhidao.locupload.LocUploadManager;
+
+public class ThirdLocationManager {
+
+ private static final String TAG = "ThirdLocationManager";
+ private static volatile ThirdLocationManager mInstance;
+ private MoGoAiCloudClientConfig cloudClientConfig;
+
+ private ThirdLocationManager() {
+ cloudClientConfig = MoGoAiCloudClient.getInstance().getAiCloudClientConfig();
+ }
+
+ public static ThirdLocationManager getInstance() {
+ if (mInstance == null) {
+ synchronized (ThirdLocationManager.class) {
+ if (mInstance == null) {
+ mInstance = new ThirdLocationManager();
+ }
+ }
+ }
+ return mInstance;
+ }
+
+ public void init(Context context) {
+ LocUploadConfig.instance().
+ setAppId(cloudClientConfig.getServiceAppId()).
+ setContext(context.getApplicationContext()).
+ setLoggable(cloudClientConfig.isShowDebugLog()).
+ setLocInterval(2000L);
+ Logger.d(TAG, "location sdk - init");
+ }
+
+ public void start() {
+ LocUploadManager.getInstance().startUpload();
+ Logger.d( TAG, "sdk - start" );
+ }
+
+ public void stop() {
+ LocUploadManager.getInstance().stopUpload();
+ Logger.d( TAG, "sdk - stop" );
+ }
+}
diff --git a/foudations/mogo-socket/build.gradle b/foudations/mogo-socket/build.gradle
index 19d8e84..08dd6a5 100644
--- a/foudations/mogo-socket/build.gradle
+++ b/foudations/mogo-socket/build.gradle
@@ -41,7 +41,6 @@ dependencies {
implementation project(path: ':foudations:mogo-passport')
}
-
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
\ No newline at end of file
diff --git a/foudations/mogo-utils/build.gradle b/foudations/mogo-utils/build.gradle
index a25cae5..7f0b55a 100644
--- a/foudations/mogo-utils/build.gradle
+++ b/foudations/mogo-utils/build.gradle
@@ -8,7 +8,7 @@ android {
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode 1
- versionName "${MOGO_LIVE_VERSION}"
+ versionName "${MOGO_UTILS_VERSION}"
consumerProguardFiles "consumer-rules.pro"
}
diff --git a/gradle.properties b/gradle.properties
index 612ba37..c33eb7f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -30,20 +30,22 @@ PASSWORD=xintai2018
RELEASE=true
# AI CLOUD 云平台
# 工具类
-MOGO_UTILS_VERSION=1.1.18
+MOGO_UTILS_VERSION=1.1.21
# 网络请求
-MOGO_NETWORK_VERSION=1.1.18
+MOGO_NETWORK_VERSION=1.1.21
# 网络DNS
-MOGO_HTTPDNS_VERSION=1.1.18
+MOGO_HTTPDNS_VERSION=1.1.21
# 鉴权
-MOGO_PASSPORT_VERSION=1.1.18
+MOGO_PASSPORT_VERSION=1.1.21
# 常链接
-MOGO_SOCKET_VERSION=1.1.18
+MOGO_SOCKET_VERSION=1.1.21
# 数据采集
-MOGO_REALTIME_VERSION=1.1.18
+MOGO_REALTIME_VERSION=1.1.21
# 探路,道路事件发布,获取
-MOGO_TANLU_VERSION=1.1.18
+MOGO_TANLU_VERSION=1.1.21
# 直播推流
-MOGO_LIVE_VERSION=1.1.18
+MOGO_LIVE_VERSION=1.1.21
# 直播拉流
-MOGO_TRAFFICLIVE_VERSION=1.1.18
+MOGO_TRAFFICLIVE_VERSION=1.1.21
+# 定位服务
+MOGO_LOCATION_VERSION=1.1.21
diff --git a/modules/mogo-realtime/build.gradle b/modules/mogo-realtime/build.gradle
index 8c3f0ed..64e3611 100644
--- a/modules/mogo-realtime/build.gradle
+++ b/modules/mogo-realtime/build.gradle
@@ -8,7 +8,7 @@ android {
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode 1
- versionName "${MOGO_SOCKET_VERSION}"
+ versionName "${MOGO_REALTIME_VERSION}"
consumerProguardFiles "consumer-rules.pro"
}
diff --git a/settings.gradle b/settings.gradle
index fe16c67..6252a8a 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,4 @@
+include ':foudations:mogo-location'
include ':modules:mogo-trafficlive'
include ':foudations:mogo-utils'
include ':foudations:mogo-live'