From aeadd92db04368738568981f13283d13b8050843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Sat, 8 May 2021 16:38:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=8F=AF=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=8D=95=E7=8B=AC=E7=9A=84=E4=BD=8D=E7=BD=AE=E6=A8=A1?= =?UTF-8?q?=E6=8B=9FAPP=E6=9D=A5=E5=AE=9E=E7=8E=B0=EF=BC=8C=E6=95=88?= =?UTF-8?q?=E7=8E=87=E6=9B=B4=E9=AB=98=EF=BC=8C=E4=B8=94=E6=9B=B4=E7=AC=A6?= =?UTF-8?q?=E5=90=88=E5=AE=9E=E9=99=85=E9=A9=BE=E9=A9=B6=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 1 - app/functions/gpssimulator.gradle | 11 -- .../.gitignore | 1 - .../mogo-module-gps-simulator-debug/README.md | 1 - .../build.gradle | 55 ------ .../consumer-rules.pro | 2 - .../gradle.properties | 3 - .../proguard-rules.pro | 24 --- .../src/main/AndroidManifest.xml | 2 - .../mogo/module/gps/simulator/CationVo.java | 134 -------------- .../gps/simulator/JWebSocketClient.java | 46 ----- .../MogoGpsSimulatorManagerDebug.java | 37 ---- .../com/mogo/module/gps/simulator/Utils.java | 50 ------ .../gps/simulator/WebSocketManager.java | 166 ------------------ .../src/main/res/values/strings.xml | 3 - .../mogo-module-gps-simulator-noop/.gitignore | 1 - .../mogo-module-gps-simulator-noop/README.md | 1 - .../build.gradle | 50 ------ .../consumer-rules.pro | 0 .../gradle.properties | 3 - .../proguard-rules.pro | 21 --- .../src/main/AndroidManifest.xml | 2 - .../MogoGpsSimulatorManagerNoop.java | 32 ---- .../src/main/res/values/strings.xml | 3 - modules/mogo-module-gps-simulator/.gitignore | 1 - modules/mogo-module-gps-simulator/README.md | 5 - .../mogo-module-gps-simulator/build.gradle | 36 ---- .../consumer-rules.pro | 0 .../gradle.properties | 3 - .../proguard-rules.pro | 24 --- .../src/main/AndroidManifest.xml | 2 - .../gps/simulator/GpsSimulatorConstants.java | 12 -- .../simulator/IMogoGpsSimulatorManager.java | 22 --- .../src/main/res/values/strings.xml | 3 - modules/mogo-module-search/build.gradle | 2 - .../navi/constants/SearchApisHolder.java | 8 - .../navi/ui/setting/NaviSettingFragment.kt | 5 - modules/mogo-module-service/build.gradle | 2 - .../module/service/MarkerServiceHandler.java | 4 - .../service/intent/MockIntentHandler.java | 11 +- settings.gradle | 3 - 41 files changed, 3 insertions(+), 789 deletions(-) delete mode 100644 app/functions/gpssimulator.gradle delete mode 100644 modules/mogo-module-gps-simulator-debug/.gitignore delete mode 100644 modules/mogo-module-gps-simulator-debug/README.md delete mode 100644 modules/mogo-module-gps-simulator-debug/build.gradle delete mode 100644 modules/mogo-module-gps-simulator-debug/consumer-rules.pro delete mode 100644 modules/mogo-module-gps-simulator-debug/gradle.properties delete mode 100644 modules/mogo-module-gps-simulator-debug/proguard-rules.pro delete mode 100644 modules/mogo-module-gps-simulator-debug/src/main/AndroidManifest.xml delete mode 100644 modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/CationVo.java delete mode 100644 modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/JWebSocketClient.java delete mode 100644 modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerDebug.java delete mode 100644 modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/Utils.java delete mode 100644 modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java delete mode 100644 modules/mogo-module-gps-simulator-debug/src/main/res/values/strings.xml delete mode 100644 modules/mogo-module-gps-simulator-noop/.gitignore delete mode 100644 modules/mogo-module-gps-simulator-noop/README.md delete mode 100644 modules/mogo-module-gps-simulator-noop/build.gradle delete mode 100644 modules/mogo-module-gps-simulator-noop/consumer-rules.pro delete mode 100644 modules/mogo-module-gps-simulator-noop/gradle.properties delete mode 100644 modules/mogo-module-gps-simulator-noop/proguard-rules.pro delete mode 100644 modules/mogo-module-gps-simulator-noop/src/main/AndroidManifest.xml delete mode 100644 modules/mogo-module-gps-simulator-noop/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerNoop.java delete mode 100644 modules/mogo-module-gps-simulator-noop/src/main/res/values/strings.xml delete mode 100644 modules/mogo-module-gps-simulator/.gitignore delete mode 100644 modules/mogo-module-gps-simulator/README.md delete mode 100644 modules/mogo-module-gps-simulator/build.gradle delete mode 100644 modules/mogo-module-gps-simulator/consumer-rules.pro delete mode 100644 modules/mogo-module-gps-simulator/gradle.properties delete mode 100644 modules/mogo-module-gps-simulator/proguard-rules.pro delete mode 100644 modules/mogo-module-gps-simulator/src/main/AndroidManifest.xml delete mode 100644 modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/GpsSimulatorConstants.java delete mode 100644 modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/IMogoGpsSimulatorManager.java delete mode 100644 modules/mogo-module-gps-simulator/src/main/res/values/strings.xml diff --git a/app/build.gradle b/app/build.gradle index a38e3c40c6..a5d0225232 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" diff --git a/app/functions/gpssimulator.gradle b/app/functions/gpssimulator.gradle deleted file mode 100644 index c957d2300b..0000000000 --- a/app/functions/gpssimulator.gradle +++ /dev/null @@ -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') - } -} \ No newline at end of file diff --git a/modules/mogo-module-gps-simulator-debug/.gitignore b/modules/mogo-module-gps-simulator-debug/.gitignore deleted file mode 100644 index 796b96d1c4..0000000000 --- a/modules/mogo-module-gps-simulator-debug/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/modules/mogo-module-gps-simulator-debug/README.md b/modules/mogo-module-gps-simulator-debug/README.md deleted file mode 100644 index 3266bdbaae..0000000000 --- a/modules/mogo-module-gps-simulator-debug/README.md +++ /dev/null @@ -1 +0,0 @@ -# GPS 轨迹模拟接口 Debug 实现 diff --git a/modules/mogo-module-gps-simulator-debug/build.gradle b/modules/mogo-module-gps-simulator-debug/build.gradle deleted file mode 100644 index 12fbf4774d..0000000000 --- a/modules/mogo-module-gps-simulator-debug/build.gradle +++ /dev/null @@ -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() diff --git a/modules/mogo-module-gps-simulator-debug/consumer-rules.pro b/modules/mogo-module-gps-simulator-debug/consumer-rules.pro deleted file mode 100644 index b5cb3815dd..0000000000 --- a/modules/mogo-module-gps-simulator-debug/consumer-rules.pro +++ /dev/null @@ -1,2 +0,0 @@ -#-----GPS-DEBUG-SIMULATOR----- --keep class com.mogo.module.gps.simulator.CationVo.*{*;} \ No newline at end of file diff --git a/modules/mogo-module-gps-simulator-debug/gradle.properties b/modules/mogo-module-gps-simulator-debug/gradle.properties deleted file mode 100644 index cbfd2771ac..0000000000 --- a/modules/mogo-module-gps-simulator-debug/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.module -POM_ARTIFACT_ID=module-gps-simulator-debug -VERSION_CODE=1 diff --git a/modules/mogo-module-gps-simulator-debug/proguard-rules.pro b/modules/mogo-module-gps-simulator-debug/proguard-rules.pro deleted file mode 100644 index a49a405e6a..0000000000 --- a/modules/mogo-module-gps-simulator-debug/proguard-rules.pro +++ /dev/null @@ -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.*{*;} diff --git a/modules/mogo-module-gps-simulator-debug/src/main/AndroidManifest.xml b/modules/mogo-module-gps-simulator-debug/src/main/AndroidManifest.xml deleted file mode 100644 index 6c73c51a7e..0000000000 --- a/modules/mogo-module-gps-simulator-debug/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/CationVo.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/CationVo.java deleted file mode 100644 index b30af88de6..0000000000 --- a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/CationVo.java +++ /dev/null @@ -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; - } - -} diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/JWebSocketClient.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/JWebSocketClient.java deleted file mode 100644 index 178452e093..0000000000 --- a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/JWebSocketClient.java +++ /dev/null @@ -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()" ); - } -} diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerDebug.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerDebug.java deleted file mode 100644 index 04c6096eca..0000000000 --- a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerDebug.java +++ /dev/null @@ -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 - *

- * 描述 - */ -@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 ) { - - } -} diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/Utils.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/Utils.java deleted file mode 100644 index 660015b14a..0000000000 --- a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/Utils.java +++ /dev/null @@ -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; - } -} diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java deleted file mode 100644 index cafbf5b56d..0000000000 --- a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java +++ /dev/null @@ -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; - } -} diff --git a/modules/mogo-module-gps-simulator-debug/src/main/res/values/strings.xml b/modules/mogo-module-gps-simulator-debug/src/main/res/values/strings.xml deleted file mode 100644 index 9d884d77ea..0000000000 --- a/modules/mogo-module-gps-simulator-debug/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - mogo-module-gps-simulator - diff --git a/modules/mogo-module-gps-simulator-noop/.gitignore b/modules/mogo-module-gps-simulator-noop/.gitignore deleted file mode 100644 index 796b96d1c4..0000000000 --- a/modules/mogo-module-gps-simulator-noop/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/modules/mogo-module-gps-simulator-noop/README.md b/modules/mogo-module-gps-simulator-noop/README.md deleted file mode 100644 index 6478f3ac12..0000000000 --- a/modules/mogo-module-gps-simulator-noop/README.md +++ /dev/null @@ -1 +0,0 @@ -# GPS 轨迹模拟接口 Release 实现 diff --git a/modules/mogo-module-gps-simulator-noop/build.gradle b/modules/mogo-module-gps-simulator-noop/build.gradle deleted file mode 100644 index 4e4194af0d..0000000000 --- a/modules/mogo-module-gps-simulator-noop/build.gradle +++ /dev/null @@ -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() diff --git a/modules/mogo-module-gps-simulator-noop/consumer-rules.pro b/modules/mogo-module-gps-simulator-noop/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/mogo-module-gps-simulator-noop/gradle.properties b/modules/mogo-module-gps-simulator-noop/gradle.properties deleted file mode 100644 index 20578a681b..0000000000 --- a/modules/mogo-module-gps-simulator-noop/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.module -POM_ARTIFACT_ID=module-gps-simulator-noop -VERSION_CODE=1 diff --git a/modules/mogo-module-gps-simulator-noop/proguard-rules.pro b/modules/mogo-module-gps-simulator-noop/proguard-rules.pro deleted file mode 100644 index f1b424510d..0000000000 --- a/modules/mogo-module-gps-simulator-noop/proguard-rules.pro +++ /dev/null @@ -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 diff --git a/modules/mogo-module-gps-simulator-noop/src/main/AndroidManifest.xml b/modules/mogo-module-gps-simulator-noop/src/main/AndroidManifest.xml deleted file mode 100644 index 3cea50c50c..0000000000 --- a/modules/mogo-module-gps-simulator-noop/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/modules/mogo-module-gps-simulator-noop/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerNoop.java b/modules/mogo-module-gps-simulator-noop/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerNoop.java deleted file mode 100644 index 9a2478f9c4..0000000000 --- a/modules/mogo-module-gps-simulator-noop/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerNoop.java +++ /dev/null @@ -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 - *

- * 描述 - */ -@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 ) { - } -} diff --git a/modules/mogo-module-gps-simulator-noop/src/main/res/values/strings.xml b/modules/mogo-module-gps-simulator-noop/src/main/res/values/strings.xml deleted file mode 100644 index 9d884d77ea..0000000000 --- a/modules/mogo-module-gps-simulator-noop/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - mogo-module-gps-simulator - diff --git a/modules/mogo-module-gps-simulator/.gitignore b/modules/mogo-module-gps-simulator/.gitignore deleted file mode 100644 index 796b96d1c4..0000000000 --- a/modules/mogo-module-gps-simulator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/modules/mogo-module-gps-simulator/README.md b/modules/mogo-module-gps-simulator/README.md deleted file mode 100644 index d396740f2b..0000000000 --- a/modules/mogo-module-gps-simulator/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# GPS 轨迹模拟接口抽象 - -## 常量定义 - -## 接口 diff --git a/modules/mogo-module-gps-simulator/build.gradle b/modules/mogo-module-gps-simulator/build.gradle deleted file mode 100644 index 73ea023119..0000000000 --- a/modules/mogo-module-gps-simulator/build.gradle +++ /dev/null @@ -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() diff --git a/modules/mogo-module-gps-simulator/consumer-rules.pro b/modules/mogo-module-gps-simulator/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/mogo-module-gps-simulator/gradle.properties b/modules/mogo-module-gps-simulator/gradle.properties deleted file mode 100644 index 44f440bc58..0000000000 --- a/modules/mogo-module-gps-simulator/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.module -POM_ARTIFACT_ID=module-gps-simulator -VERSION_CODE=1 diff --git a/modules/mogo-module-gps-simulator/proguard-rules.pro b/modules/mogo-module-gps-simulator/proguard-rules.pro deleted file mode 100644 index 5ee323b27c..0000000000 --- a/modules/mogo-module-gps-simulator/proguard-rules.pro +++ /dev/null @@ -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 diff --git a/modules/mogo-module-gps-simulator/src/main/AndroidManifest.xml b/modules/mogo-module-gps-simulator/src/main/AndroidManifest.xml deleted file mode 100644 index dc9013c712..0000000000 --- a/modules/mogo-module-gps-simulator/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/GpsSimulatorConstants.java b/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/GpsSimulatorConstants.java deleted file mode 100644 index dc87986716..0000000000 --- a/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/GpsSimulatorConstants.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.mogo.module.gps.simulator; - -/** - * @author congtaowang - * @since 2020-04-13 - *

- * 描述 - */ -public class GpsSimulatorConstants { - - public static final String API_PATH = "/gpssimulator/api"; -} diff --git a/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/IMogoGpsSimulatorManager.java b/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/IMogoGpsSimulatorManager.java deleted file mode 100644 index aa3bdfff17..0000000000 --- a/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/IMogoGpsSimulatorManager.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.mogo.module.gps.simulator; - -import com.alibaba.android.arouter.facade.template.IProvider; - -/** - * @author congtaowang - * @since 2020-04-13 - *

- * gps 模拟控制开关 - */ -public interface IMogoGpsSimulatorManager extends IProvider { - - /** - * 打开 gps 模拟 - */ - void open(); - - /** - * 关闭 gps 模拟 - */ - void close(); -} diff --git a/modules/mogo-module-gps-simulator/src/main/res/values/strings.xml b/modules/mogo-module-gps-simulator/src/main/res/values/strings.xml deleted file mode 100644 index 9d884d77ea..0000000000 --- a/modules/mogo-module-gps-simulator/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - mogo-module-gps-simulator - diff --git a/modules/mogo-module-search/build.gradle b/modules/mogo-module-search/build.gradle index f67cde7b6e..2c7b1b2b44 100644 --- a/modules/mogo-module-search/build.gradle +++ b/modules/mogo-module-search/build.gradle @@ -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' diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java index 138f55905e..3695ce0ae3 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java @@ -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(); } diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt index c21f0c5524..19d25522a7 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt @@ -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 -> diff --git a/modules/mogo-module-service/build.gradle b/modules/mogo-module-service/build.gradle index 870061162d..c506efd292 100644 --- a/modules/mogo-module-service/build.gradle +++ b/modules/mogo-module-service/build.gradle @@ -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') } } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java index c2046944b6..ba6ba35958 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java @@ -182,10 +182,6 @@ public class MarkerServiceHandler { MarkerServiceHandler.sIMogoOverlayManager = sIMogoOverlayManager; } - // public static IMogoGpsSimulatorManager getGpsSimulatorManager() { -// return sGpsSimulatorManager; -// } - //TODO -------------以下方法是临时过度使用的,后面统一使用,getMapMarkerManager进行调用 /** diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java index b366848ece..ed640f042e 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java @@ -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 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; diff --git a/settings.gradle b/settings.gradle index 15dea58ada..de69d216f6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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'