删除了位置模拟模块,可使用单独的位置模拟APP来实现,效率更高,且更符合实际驾驶场景
This commit is contained in:
@@ -620,7 +620,6 @@ dependencies {
|
||||
apply from: "./functions/perform.gradle"
|
||||
// apply from: "./functions/baseservices.gradle"
|
||||
apply from: "./functions/socketpush.gradle"
|
||||
// apply from: "./functions/gpssimulator.gradle"
|
||||
apply from: "./functions/leftpanel.gradle"
|
||||
apply from: "./functions/skin.gradle"
|
||||
apply from: "./functions/crashreport.gradle"
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// 基于后台轨迹模拟的gps模拟服务
|
||||
|
||||
project.dependencies {
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
debugImplementation rootProject.ext.dependencies.gpssimulatornoop
|
||||
releaseImplementation rootProject.ext.dependencies.gpssimulatornoop
|
||||
} else {
|
||||
debugImplementation project(':modules:mogo-module-gps-simulator-noop')
|
||||
releaseImplementation project(':modules:mogo-module-gps-simulator-noop')
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1 +0,0 @@
|
||||
# GPS 轨迹模拟接口 Debug 实现
|
||||
@@ -1,55 +0,0 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
targetCompatibility 1.8
|
||||
sourceCompatibility 1.8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
implementation "org.java-websocket:Java-WebSocket:1.4.0"
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.gpssimulator
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
} else {
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':modules:mogo-module-gps-simulator')
|
||||
implementation project(':services:mogo-service-api')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,2 +0,0 @@
|
||||
#-----GPS-DEBUG-SIMULATOR-----
|
||||
-keep class com.mogo.module.gps.simulator.CationVo.*{*;}
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-gps-simulator-debug
|
||||
VERSION_CODE=1
|
||||
@@ -1,24 +0,0 @@
|
||||
# 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
|
||||
|
||||
#-----GPS-DEBUG-SIMULATOR-----
|
||||
-keep class com.mogo.module.gps.simulator.CationVo.*{*;}
|
||||
@@ -1,2 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.gps.simulator.debug" />
|
||||
@@ -1,134 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-04-08.
|
||||
*/
|
||||
public class CationVo {
|
||||
|
||||
/**
|
||||
* vehicleSpeed : 1.0
|
||||
* instantSpeed : 1.0
|
||||
* lon : 116.401615
|
||||
* lat : 39.968812
|
||||
* carStatus : 1
|
||||
* direction : 267
|
||||
* sn : ZD801C1928L00371
|
||||
* locationTime : 1586339911534
|
||||
* distance : 0.0
|
||||
* adCode : 2
|
||||
* cityCode : 3
|
||||
* vehicleType : 0
|
||||
*/
|
||||
|
||||
private float vehicleSpeed;
|
||||
private double instantSpeed;
|
||||
private double lon;
|
||||
private double lat;
|
||||
private int carStatus;
|
||||
private int direction;
|
||||
private String sn;
|
||||
private long locationTime;
|
||||
private double distance;
|
||||
private String adCode;
|
||||
private String cityCode;
|
||||
private int vehicleType;
|
||||
|
||||
public float getVehicleSpeed() {
|
||||
return vehicleSpeed;
|
||||
}
|
||||
|
||||
public void setVehicleSpeed( float vehicleSpeed ) {
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
|
||||
public double getInstantSpeed() {
|
||||
return instantSpeed;
|
||||
}
|
||||
|
||||
public void setInstantSpeed( double instantSpeed ) {
|
||||
this.instantSpeed = instantSpeed;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon( double lon ) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat( double lat ) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public int getCarStatus() {
|
||||
return carStatus;
|
||||
}
|
||||
|
||||
public void setCarStatus( int carStatus ) {
|
||||
this.carStatus = carStatus;
|
||||
}
|
||||
|
||||
public int getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection( int direction ) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn( String sn ) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public long getLocationTime() {
|
||||
return locationTime;
|
||||
}
|
||||
|
||||
public void setLocationTime( long locationTime ) {
|
||||
this.locationTime = locationTime;
|
||||
}
|
||||
|
||||
public double getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance( double distance ) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getAdCode() {
|
||||
return adCode;
|
||||
}
|
||||
|
||||
public void setAdCode( String adCode ) {
|
||||
this.adCode = adCode;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode( String cityCode ) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public int getVehicleType() {
|
||||
return vehicleType;
|
||||
}
|
||||
|
||||
public void setVehicleType( int vehicleType ) {
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.drafts.Draft_6455;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-04-07.
|
||||
*/
|
||||
public class JWebSocketClient extends WebSocketClient {
|
||||
|
||||
public JWebSocketClient( URI serverUri ) {
|
||||
super( serverUri, new Draft_6455() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen( ServerHandshake handshakedata ) {
|
||||
Logger.d( "JWebSocketClient", "onOpen()" );
|
||||
bindSN();
|
||||
}
|
||||
|
||||
private void bindSN() {
|
||||
String data = String.format( "{ \"sn\": \"%s\", \"bind\": true }", Utils.getSn() );
|
||||
send( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage( String message ) {
|
||||
Logger.e( "JWebSocketClient", "onMessage()" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose( int code, String reason, boolean remote ) {
|
||||
Logger.d( "JWebSocketClient", "onClose()" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( Exception ex ) {
|
||||
Logger.d( "JWebSocketClient", "onError()" );
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-13
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = GpsSimulatorConstants.API_PATH )
|
||||
public class MogoGpsSimulatorManagerDebug implements IMogoGpsSimulatorManager {
|
||||
|
||||
private static final String TAG = "MogoGpsSimulatorManagerDebug";
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
WebSocketManager.getInstance().connect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
WebSocketManager.getInstance().disConnect();
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
WebSocketManager.destroy();
|
||||
}, 1_000L );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* Created by congtaowang on 2018/3/29.
|
||||
*/
|
||||
|
||||
class Utils {
|
||||
|
||||
public static final String GET = "get";
|
||||
public static final String GSM_SERIAL = "gsm.serial";
|
||||
public static final String FOTA_VERSION = "ro.fota.version";
|
||||
public static final String PROPERTIES = "android.os.SystemProperties";
|
||||
|
||||
public static String getSn() {
|
||||
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
|
||||
return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "allocated_sn" );
|
||||
}
|
||||
return getSystemProperties( GSM_SERIAL );
|
||||
}
|
||||
|
||||
public static String getFotaVersion() {
|
||||
return getSystemProperties( FOTA_VERSION );
|
||||
}
|
||||
|
||||
public static String getSystemProperties( String name ) {
|
||||
String value = "";
|
||||
|
||||
try {
|
||||
Class< ? > c = Class.forName( PROPERTIES );
|
||||
Method get = c.getMethod( GET, String.class );
|
||||
value = ( String ) get.invoke( c, name );
|
||||
} catch ( ClassNotFoundException var3 ) {
|
||||
var3.printStackTrace();
|
||||
} catch ( NoSuchMethodException var4 ) {
|
||||
var4.printStackTrace();
|
||||
} catch ( InvocationTargetException var5 ) {
|
||||
var5.printStackTrace();
|
||||
} catch ( IllegalAccessException var6 ) {
|
||||
var6.printStackTrace();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-04-07.
|
||||
*/
|
||||
public class WebSocketManager {
|
||||
|
||||
private static final String TAG = "WebSocketManager";
|
||||
|
||||
private static Object sLock = new Object();
|
||||
private static WebSocketManager sWebSocketManager;
|
||||
|
||||
private IMogoNavi mNavi;
|
||||
private JWebSocketClient mClient;
|
||||
private URI mUri;
|
||||
private IMogoServiceApis mServiceApis;
|
||||
|
||||
private ExecutorService mService;
|
||||
|
||||
public static WebSocketManager getInstance() {
|
||||
if ( sWebSocketManager == null ) {
|
||||
synchronized ( sLock ) {
|
||||
if ( sWebSocketManager == null ) {
|
||||
sWebSocketManager = new WebSocketManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sWebSocketManager;
|
||||
}
|
||||
|
||||
private WebSocketManager() {
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
mNavi = mServiceApis.getMapServiceApi().getNavi( AbsMogoApplication.getApp() );
|
||||
mUri = URI.create( "ws://152.136.10.223:4001/realtimeLocations-ws" );
|
||||
mClient = new JWebSocketClient( mUri ) {
|
||||
@Override
|
||||
public void onMessage( String message ) {
|
||||
try {
|
||||
parseMessage( message );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen( ServerHandshake handshakedata ) {
|
||||
super.onOpen( handshakedata );
|
||||
UiThreadHandler.post( () -> {
|
||||
TipToast.shortTip( "模拟GPS开启成功" );
|
||||
mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() ).stop();
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose( int code, String reason, boolean remote ) {
|
||||
super.onClose( code, reason, remote );
|
||||
UiThreadHandler.post( () -> {
|
||||
TipToast.shortTip( "模拟GPS关闭成功" );
|
||||
mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() ).start();
|
||||
} );
|
||||
shutdownServiceQuietly();
|
||||
}
|
||||
};
|
||||
initThreadService();
|
||||
}
|
||||
|
||||
private void parseMessage( String jsonStr ) throws Exception {
|
||||
//message就是接收到的消息
|
||||
Logger.d( TAG, jsonStr );
|
||||
JSONObject jsonObject = new JSONObject( jsonStr );
|
||||
if ( jsonObject.has( "detailMsg" ) ) {
|
||||
Logger.d( TAG, "绑定成功" );
|
||||
} else if ( jsonObject.has( "realTimeLocationVo" ) ) {
|
||||
Logger.d( TAG, "收到定位消息" );
|
||||
CationVo realTimeLocationVo = GsonUtil.objectFromJson( jsonObject.getString( "realTimeLocationVo" ), CationVo.class );
|
||||
UiThreadHandler.post( () -> {
|
||||
mNavi.setExtraGPSData(
|
||||
realTimeLocationVo.getLon(),
|
||||
realTimeLocationVo.getLat(),
|
||||
realTimeLocationVo.getVehicleSpeed(),
|
||||
1,
|
||||
realTimeLocationVo.getDirection(),
|
||||
realTimeLocationVo.getLocationTime()
|
||||
);
|
||||
Iterator< IMogoLocationListener > listeners = mServiceApis.getRegisterCenterApi().getLocationListeners();
|
||||
MogoLocation location = new MogoLocation();
|
||||
location.setLatitude( realTimeLocationVo.getLat() );
|
||||
location.setLongitude( realTimeLocationVo.getLon() );
|
||||
location.setSpeed( realTimeLocationVo.getVehicleSpeed() );
|
||||
location.setAccuracy( 1 );
|
||||
location.setTime( realTimeLocationVo.getLocationTime() );
|
||||
|
||||
if ( listeners != null ) {
|
||||
while ( listeners.hasNext() ) {
|
||||
listeners.next().onLocationChanged( location );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
public void connect() {
|
||||
if ( mClient == null ) {
|
||||
return;
|
||||
}
|
||||
mNavi.setUseExtraGPSData( true );
|
||||
mService.execute( () -> {
|
||||
try {
|
||||
mClient.connectBlocking();
|
||||
Logger.d( TAG, "connectBlocking done." );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
private void initThreadService() {
|
||||
if ( mService == null || mService.isShutdown() ) {
|
||||
mService = Executors.newSingleThreadExecutor();
|
||||
}
|
||||
}
|
||||
|
||||
public void disConnect() {
|
||||
mNavi.setUseExtraGPSData( false );
|
||||
mService.execute( () -> {
|
||||
try {
|
||||
mClient.closeBlocking();
|
||||
Logger.d( TAG, "close done." );
|
||||
} catch ( InterruptedException e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
sWebSocketManager = null;
|
||||
}
|
||||
|
||||
private void shutdownServiceQuietly() {
|
||||
if ( mService != null && !mService.isShutdown() ) {
|
||||
mService.shutdown();
|
||||
}
|
||||
mService = null;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-gps-simulator</string>
|
||||
</resources>
|
||||
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1 +0,0 @@
|
||||
# GPS 轨迹模拟接口 Release 实现
|
||||
@@ -1,50 +0,0 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
targetCompatibility 1.8
|
||||
sourceCompatibility 1.8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.gpssimulator
|
||||
} else {
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(':modules:mogo-module-gps-simulator')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-gps-simulator-noop
|
||||
VERSION_CODE=1
|
||||
@@ -1,21 +0,0 @@
|
||||
# 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
|
||||
@@ -1,2 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.gps.simulator.noop" />
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-13
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = GpsSimulatorConstants.API_PATH )
|
||||
public class MogoGpsSimulatorManagerNoop implements IMogoGpsSimulatorManager {
|
||||
|
||||
private static final String TAG = "MogoGpsSimulatorManagerNoop";
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
Logger.e( TAG, "no operation when release." );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Logger.e( TAG, "no operation when release." );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-gps-simulator</string>
|
||||
</resources>
|
||||
1
modules/mogo-module-gps-simulator/.gitignore
vendored
1
modules/mogo-module-gps-simulator/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,5 +0,0 @@
|
||||
# GPS 轨迹模拟接口抽象
|
||||
|
||||
## 常量定义
|
||||
|
||||
## 接口
|
||||
@@ -1,36 +0,0 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
targetCompatibility 1.8
|
||||
sourceCompatibility 1.8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-gps-simulator
|
||||
VERSION_CODE=1
|
||||
@@ -1,24 +0,0 @@
|
||||
# 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
|
||||
|
||||
#-----MogoGSPSimulator-----
|
||||
-keep class com.mogo.module.gps.simulator.GpsSimulatorConstants
|
||||
@@ -1,2 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.gps.simulator" />
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-13
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class GpsSimulatorConstants {
|
||||
|
||||
public static final String API_PATH = "/gpssimulator/api";
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-13
|
||||
* <p>
|
||||
* gps 模拟控制开关
|
||||
*/
|
||||
public interface IMogoGpsSimulatorManager extends IProvider {
|
||||
|
||||
/**
|
||||
* 打开 gps 模拟
|
||||
*/
|
||||
void open();
|
||||
|
||||
/**
|
||||
* 关闭 gps 模拟
|
||||
*/
|
||||
void close();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-gps-simulator</string>
|
||||
</resources>
|
||||
@@ -58,14 +58,12 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
// implementation rootProject.ext.dependencies.gpssimulator
|
||||
} else {
|
||||
implementation project(":libraries:mogo-map-api")
|
||||
implementation project(":foudations:mogo-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
// implementation project(':modules:mogo-module-gps-simulator')
|
||||
}
|
||||
implementation 'com.zhidaoauto.voice.controller:api:1.0.2'
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ public class SearchApisHolder {
|
||||
private static final String TAG = "SearchApisHolder";
|
||||
|
||||
private static IMogoServiceApis sApis;
|
||||
// private static IMogoGpsSimulatorManager sGpsSimulatorManager;
|
||||
|
||||
private static PersonalInfoManagerImpl mPersonalInfoManager;
|
||||
|
||||
@@ -84,13 +83,6 @@ public class SearchApisHolder {
|
||||
return getApis().getSettingManagerApi();
|
||||
}
|
||||
|
||||
// public static IMogoGpsSimulatorManager getGpsSimulatorManager() {
|
||||
// if ( sGpsSimulatorManager == null ) {
|
||||
// sGpsSimulatorManager = ARouter.getInstance().navigation( IMogoGpsSimulatorManager.class );
|
||||
// }
|
||||
// return sGpsSimulatorManager;
|
||||
// }
|
||||
|
||||
public static IMogoSearchManager getSearchManager() {
|
||||
return getApis().getSearchManagerApi();
|
||||
}
|
||||
|
||||
@@ -223,11 +223,6 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
|
||||
SettingManager.setGpsSimulator(isChecked)
|
||||
|
||||
// if (isChecked) {
|
||||
// SearchApisHolder.getGpsSimulatorManager().open()
|
||||
// } else {
|
||||
// SearchApisHolder.getGpsSimulatorManager().close()
|
||||
// }
|
||||
}
|
||||
tb_custom_map.isChecked = DebugConfig.isUseCustomMap()
|
||||
tb_custom_map.setOnCheckedChangeListener{ _, isChecked ->
|
||||
|
||||
@@ -60,7 +60,6 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
// implementation rootProject.ext.dependencies.gpssimulator
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
@@ -68,7 +67,6 @@ dependencies {
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
// implementation project(':modules:mogo-module-gps-simulator')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,10 +182,6 @@ public class MarkerServiceHandler {
|
||||
MarkerServiceHandler.sIMogoOverlayManager = sIMogoOverlayManager;
|
||||
}
|
||||
|
||||
// public static IMogoGpsSimulatorManager getGpsSimulatorManager() {
|
||||
// return sGpsSimulatorManager;
|
||||
// }
|
||||
|
||||
//TODO -------------以下方法是临时过度使用的,后面统一使用,getMapMarkerManager进行调用
|
||||
|
||||
/**
|
||||
|
||||
@@ -169,8 +169,8 @@ public class MockIntentHandler implements IntentHandler {
|
||||
} else {
|
||||
MarkerServiceHandler.getADASController().closeADAS();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 13: {// 唤起高德地图
|
||||
double lat = intent.getFloatExtra("lat", 0.0f);
|
||||
double lon = intent.getFloatExtra("lon", 0.0f);
|
||||
@@ -218,6 +218,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
});
|
||||
MarkerServiceHandler.getNavi().naviTo(new MogoLatLng(lat, lon));
|
||||
break;
|
||||
}
|
||||
case 14: {//测试点的动画移动,模拟周边车辆移动
|
||||
List<MogoLatLng> mogoLatLngs = new ArrayList<>();
|
||||
@@ -339,14 +340,8 @@ public class MockIntentHandler implements IntentHandler {
|
||||
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus(TAG, true, false);
|
||||
MarkerServiceHandler.getMapUIController().moveToCenter(mogoLatLngs.get(0));
|
||||
WorkThreadHandler.getInstance().post(() -> marker.startSmooth(mogoLatLngs, duration));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
// case 15:
|
||||
// MarkerServiceHandler.getGpsSimulatorManager().open();
|
||||
// break;
|
||||
// case 16:
|
||||
// MarkerServiceHandler.getGpsSimulatorManager().close();
|
||||
// break;
|
||||
case 17:// 查询在线车辆数据
|
||||
DebugConfig.setRequestOnlineCarData(intent.getBooleanExtra("status", true));
|
||||
break;
|
||||
|
||||
@@ -52,9 +52,6 @@ include ':libraries:map-custom'
|
||||
include ':libraries:mogo-map-api'
|
||||
include ':modules:mogo-module-apps'
|
||||
include ':modules:mogo-module-extensions'
|
||||
//include ':modules:mogo-module-gps-simulator'
|
||||
//include ':modules:mogo-module-gps-simulator-debug'
|
||||
//include ':modules:mogo-module-gps-simulator-noop'
|
||||
include ':libraries:map-autonavi'
|
||||
include ':modules:mogo-module-media'
|
||||
include ':modules:mogo-module-v2x'
|
||||
|
||||
Reference in New Issue
Block a user