[Fix]解决ALocationClien定位信息因为使用实时上传的时候当接入工控机位置回调信息会丢失

移除日志
This commit is contained in:
renwenjie
2021-11-05 10:27:34 +08:00
parent 250d9596f5
commit 0a7ed0387e
9 changed files with 111 additions and 1 deletions

View File

@@ -50,8 +50,8 @@ dependencies {
implementation rootProject.ext.dependencies.rxandroid
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.adasHigh
implementation project(':modules:mogo-module-common')
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogo_core_data

View File

@@ -0,0 +1,34 @@
package com.mogo.eagle.core.function.impl.map
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.map.location.IMoGoLocationUpdater4AutoPilot
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.module.common.MogoApisHandler
import com.mogo.service.IMogoServiceApis
@Route(path = MogoServicePaths.PATH_MAP_LOCATION_UPDATE_4_AUTO_PILOT)
class MoGoLocationUpdater4AutoPilot: IMoGoLocationUpdater4AutoPilot {
private val TAG = "MoGoLocationUpdater4AutoPilot"
override val functionName = TAG;
private val api: IMogoServiceApis? by lazy {
MogoApisHandler.getInstance().apis
}
override fun updateLocation(location: Any?) {
api?.mapServiceApi?.getSingletonLocationClient(Utils.getApp())?.updateLocation(location);
}
override fun init(context: Context?) {
//DO NOTING
}
override fun onDestroy() {
//DO NOTHING
}
}

View File

@@ -375,4 +375,12 @@ public class MogoServicePaths {
@Keep
@Deprecated
public static final String PATH_AI_MONITORING = "/monitoring/api";
/**
* 自动驾驶时,定位信息改变要同步更新
*/
@Keep
@Deprecated
public static final String PATH_MAP_LOCATION_UPDATE_4_AUTO_PILOT = "/map_x/location_update";
}

View File

@@ -0,0 +1,13 @@
package com.mogo.eagle.core.function.api.map.location
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
/**
* @author renwj
* @date 2021/11/04 16:10 下午
* 此类主要用来同步自动驾驶定位信息给各业务方
*/
interface IMoGoLocationUpdater4AutoPilot : IMoGoFunctionServerProvider {
fun updateLocation(location: Any?)
}

View File

@@ -0,0 +1,18 @@
package com.mogo.eagle.core.function.call.map
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.map.location.IMoGoLocationUpdater4AutoPilot
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerLocationUpdaterManager {
private val updater : IMoGoLocationUpdater4AutoPilot? by lazy {
CallerBase.getApiInstance(
IMoGoLocationUpdater4AutoPilot::class.java,
MogoServicePaths.PATH_MAP_LOCATION_UPDATE_4_AUTO_PILOT)
}
fun updateLocation(location: Any?) {
updater?.updateLocation(location);
}
}