fix bug of delay and update map version
This commit is contained in:
@@ -28,9 +28,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation rootProject.ext.dependencies.mogoaicloudsocket
|
||||
|
||||
// 上报位置
|
||||
implementation 'com.zhidao.locupload:loc-upload-sdk:1.1.7'
|
||||
implementation rootProject.ext.dependencies.mogoaicloudlocation
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
|
||||
@@ -4,22 +4,13 @@ import android.content.Context;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.cloud.location.LocationManager;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.service.locationinfo.IMogoLocationInfoService;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.locupload.LocUploadConfig;
|
||||
import com.zhidao.locupload.LocUploadManager;
|
||||
|
||||
public
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/7/16
|
||||
*
|
||||
* 位置服务
|
||||
*/
|
||||
@Keep
|
||||
class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
public class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
|
||||
private static final String TAG = "MogoLocationInfoServices-sdk";
|
||||
|
||||
@@ -31,9 +22,9 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
|
||||
@Keep
|
||||
public static MogoLocationInfoServices getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoLocationInfoServices.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoLocationInfoServices.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoLocationInfoServices();
|
||||
}
|
||||
}
|
||||
@@ -46,9 +37,9 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideLocation( MogoLocation location ) {
|
||||
public void provideLocation(MogoLocation location) {
|
||||
mLocation = location;
|
||||
Logger.d( TAG, "sdk - provideLocation" );
|
||||
Logger.d(TAG, "sdk - provideLocation");
|
||||
}
|
||||
|
||||
public MogoLocation getLocation() {
|
||||
@@ -57,23 +48,19 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
LocUploadManager.getInstance().startUpload();
|
||||
Logger.d( TAG, "sdk - start" );
|
||||
LocationManager.getInstance().start();
|
||||
Logger.d(TAG, "sdk - start");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
LocUploadManager.getInstance().stopUpload();
|
||||
Logger.d( TAG, "sdk - stop" );
|
||||
LocationManager.getInstance().stop();
|
||||
Logger.d(TAG, "sdk - stop");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
LocUploadConfig.instance().
|
||||
setAppId( DebugConfig.getSocketAppId() ).
|
||||
setContext( context.getApplicationContext() ).
|
||||
setLoggable( DebugConfig.isDebug() ).
|
||||
setLocInterval( 2000L );
|
||||
Logger.d( TAG, "sdk - init" );
|
||||
public void init(Context context) {
|
||||
LocationManager.getInstance().init(context);
|
||||
Logger.d(TAG, "sdk - init");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,19 +3,12 @@ package com.mogo.aicloud.services.locationinfo;
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.zhidao.locupload.location.LocationServiceProvider;
|
||||
|
||||
public
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/7/16
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Service( value = LocationServiceProvider.class )
|
||||
class MogoLocationSource extends LocationServiceProvider {
|
||||
@Service(value = LocationServiceProvider.class)
|
||||
public class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public float getBearing() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getBearing();
|
||||
}
|
||||
return 0;
|
||||
@@ -23,7 +16,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public float getAccuracy() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getAccuracy();
|
||||
}
|
||||
return 0;
|
||||
@@ -31,7 +24,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public String getProvider() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getProvider();
|
||||
}
|
||||
return null;
|
||||
@@ -39,7 +32,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public float getSpeed() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getSpeed();
|
||||
}
|
||||
return 0;
|
||||
@@ -47,7 +40,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public double getAltitude() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getAltitude();
|
||||
}
|
||||
return 0;
|
||||
@@ -55,7 +48,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public String getAdCode() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getAdCode();
|
||||
}
|
||||
return null;
|
||||
@@ -63,7 +56,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public int getLocType() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getLocType();
|
||||
}
|
||||
return 0;
|
||||
@@ -71,7 +64,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public double getLatitude() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getLatitude();
|
||||
}
|
||||
return 0;
|
||||
@@ -79,7 +72,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public double getLongitude() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getLongitude();
|
||||
}
|
||||
return 0;
|
||||
@@ -87,7 +80,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public long getTime() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getTime();
|
||||
}
|
||||
return 0;
|
||||
@@ -95,7 +88,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public String getCityCode() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getCityCode();
|
||||
}
|
||||
return null;
|
||||
@@ -103,7 +96,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public String getCityName() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getCityName();
|
||||
}
|
||||
return null;
|
||||
@@ -111,7 +104,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public int getGpsAccuracyStatus() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getGpsAccuracyStatus();
|
||||
}
|
||||
return 0;
|
||||
@@ -119,7 +112,7 @@ class MogoLocationSource extends LocationServiceProvider {
|
||||
|
||||
@Override
|
||||
public int getSatellites() {
|
||||
if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
|
||||
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
|
||||
return MogoLocationInfoServices.getInstance().getLocation().getSatellite();
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user