diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 4f32108c9a..89ad10bff2 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -38,6 +38,7 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 49e15fd186..36f516089d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -273,6 +273,7 @@ dependencies {
implementation rootProject.ext.dependencies.moduleservice
implementation rootProject.ext.dependencies.modulesplash
implementation rootProject.ext.dependencies.moduleV2x
+ implementation rootProject.ext.dependencies.mogomonitor
} else {
launcherImplementation project(':main-extensions:mogo-module-main-launcher')
independentImplementation project(':main-extensions:mogo-module-main-independent')
@@ -284,6 +285,7 @@ dependencies {
implementation project(':modules:mogo-module-service')
implementation project(':modules:mogo-module-splash')
implementation project(':modules:mogo-module-v2x')
+ implementation project(':modules:mogo-module-monitor')
}
apply from: "./functions/baseservices.gradle"
diff --git a/config.gradle b/config.gradle
index 8cbaaddd98..1327d89a58 100644
--- a/config.gradle
+++ b/config.gradle
@@ -176,6 +176,8 @@ targetSdkVersion : 22,
mogobaseserviceapk : "com.mogo.base:services-apk:${MOGO_BASE_SERVICES_APK_VERSION}",
// loglib
mogologlib : "com.mogo.module:module-loglib:${LOGLIB_VERSION}",
+ // monitor
+ mogomonitor : "com.mogo.module:module-monitor:${MOGO_MODULE_MONITOR_VERSION}",
// google
googlezxing : "com.google.zxing:core:3.3.3",
diff --git a/gradle.properties b/gradle.properties
index 2d01adc565..2fd887a5c9 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -101,7 +101,9 @@ MOGO_MODULE_SPLASH_VERSION = 1.0.0-SNAPSHOT
MOGO_MODULE_SPLASH_NOOP_VERSION = 1.0.0-SNAPSHOT
# loglib
-LOGLIB_VERSION = 1.0.0-SNAPSHOT
+LOGLIB_VERSION = 1.0.1-SNAPSHOT
+# monitor
+MOGO_MODULE_MONITOR_VERSION = 1.0.0-SNAPSHOT
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
applicationId=com.mogo.launcer
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
index 4821f6b0a2..f9b34a59be 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
@@ -13,10 +13,12 @@ import com.mogo.utils.WindowUtils;
* 采用windowManager实现接口
*/
class WindowManagerImpl implements IWindowManagerView {
+
private WindowManager mWindowManager;
private WindowManager.LayoutParams mLayoutParams;
private WindowManagerView.WMViewParams mParams;
private boolean isShowing;
+
@Override
public void init(WindowManagerView.WMViewParams params) {
mParams = params;
@@ -31,16 +33,11 @@ class WindowManagerImpl implements IWindowManagerView {
mLayoutParams.gravity = Gravity.CENTER;
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
- if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
- mLayoutParams.width = 1920;
- mLayoutParams.height = 1080;
- } else {
- mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
- mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
- }
+ mLayoutParams.width = mParams.mWidth;
+ mLayoutParams.height = mParams.mHeight;
+ mLayoutParams.x = mParams.mX;
+ mLayoutParams.y = mParams.mY;
mLayoutParams.dimAmount = 0.5f;
- mLayoutParams.x = 0;
- mLayoutParams.y = 0;
}
@Override
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
index d3c054a2ca..d0d2cfa4d4 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
@@ -1,20 +1,12 @@
package com.mogo.module.common.wm;
import android.content.Context;
-import android.graphics.PixelFormat;
-import android.os.Build;
-import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.WindowManager;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
-import com.mogo.commons.debug.DebugConfig;
-import com.mogo.module.common.utils.CarSeries;
-import com.mogo.utils.WindowUtils;
-
/**
* @author congtaowang
* @since 2020-05-21
@@ -25,56 +17,82 @@ public class WindowManagerView {
private WMViewParams mParams;
- private IWindowManagerView managerView;
+ private IWindowManagerView mManagerView;
- private WindowManagerView(WMViewParams params) {
+ private WindowManagerView( WMViewParams params, IWindowManagerView view ) {
this.mParams = params;
- managerView = new DialogImpl();
- managerView.init(params);
-// init();
+ mManagerView = view;
+ view.init( params );
}
public boolean isShowing() {
- return managerView.isShowing();
+ return mManagerView.isShowing();
}
- public T findViewById(@IdRes int id) {
- return mParams.mContentView.findViewById(id);
+ public < T extends View > T findViewById( @IdRes int id ) {
+ return mParams.mContentView.findViewById( id );
}
public void show() {
- managerView.show();
+ mManagerView.show();
}
public void dismiss() {
- managerView.hide();
+ mManagerView.hide();
}
public static class Builder {
private WMViewParams mParams = null;
- public Builder(Context context) {
+ public Builder( Context context ) {
mParams = new WMViewParams();
mParams.mContext = context;
}
- public Builder contentView(View contentView) {
+ public Builder contentView( View contentView ) {
mParams.mContentView = contentView;
return this;
}
- public Builder contentView(@LayoutRes int contentViewId) {
- mParams.mContentView = LayoutInflater.from(mParams.mContext).inflate(contentViewId,
- null);
+ public Builder contentView( @LayoutRes int contentViewId ) {
+ mParams.mContentView = LayoutInflater.from( mParams.mContext ).inflate( contentViewId, null );
return this;
}
+ public Builder size( int width, int height ) {
+ mParams.mWidth = width;
+ mParams.mHeight = height;
+ return this;
+ }
+
+ public Builder position( int x, int y ) {
+ mParams.mX = x;
+ mParams.mY = y;
+ return this;
+ }
+
+ /**
+ * 默认dialog实现
+ *
+ * @return
+ */
public WindowManagerView build() {
- if (mParams.mContentView == null) {
- throw new NullPointerException("WMViewParams#mContentView must not be null.");
+ return showInDialog();
+ }
+
+ public WindowManagerView showInDialog() {
+ if ( mParams.mContentView == null ) {
+ throw new NullPointerException( "WMViewParams#mContentView must not be null." );
}
- return new WindowManagerView(mParams);
+ return new WindowManagerView( mParams, new DialogImpl() );
+ }
+
+ public WindowManagerView showInWindowManager() {
+ if ( mParams.mContentView == null ) {
+ throw new NullPointerException( "WMViewParams#mContentView must not be null." );
+ }
+ return new WindowManagerView( mParams, new WindowManagerImpl() );
}
}
@@ -83,5 +101,9 @@ public class WindowManagerView {
public View mContentView;
public Context mContext;
+ public int mWidth;
+ public int mHeight;
+ public int mX;
+ public int mY;
}
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
index bfb66cffe1..768006b117 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
@@ -204,6 +204,11 @@ public class EntranceFragment extends MvpFragment{
+ mApis.getMogoMonitorApi().showLogDebugDialog();
+ return true;
+ });
}
ConstraintLayout rootView = findViewById(R.id.module_entrance_id_top_motion_layout);
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
index 1ee636cab7..0400c22f90 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
@@ -31,6 +31,7 @@ import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoModuleProvider;
+import com.mogo.service.monitor.IMogoMonitorProvider;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
@@ -170,6 +171,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
hideLayout();
}
} );
+
+ // 初始化MonitorModule
+ IMogoMonitorProvider monitorProvider = (IMogoMonitorProvider) ARouter.getInstance().build(MogoServicePaths.PATH_MOGO_MONITOR).navigation(this);
+ monitorProvider.resetActivityContext(this);
+
}
private void startBaseService() {
@@ -257,7 +263,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// f 系列加上上滑返回桌面后会走 mIsHomeKeyDown = true,但是不会造成页面pause
// 独立 app 任何情况下都需要隐藏 adas
return !mIsHomeKeyDown
- || CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X
|| !DebugConfig.isLauncher();
}
diff --git a/modules/mogo-module-monitor/.gitignore b/modules/mogo-module-monitor/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-monitor/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-monitor/build.gradle b/modules/mogo-module-monitor/build.gradle
new file mode 100644
index 0000000000..d91c74e164
--- /dev/null
+++ b/modules/mogo-module-monitor/build.gradle
@@ -0,0 +1,48 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.alibaba.arouter'
+
+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'
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments = [AROUTER_MODULE_NAME: project.getName()]
+ }
+ }
+ }
+
+ 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 rootProject.ext.dependencies.mogologlib
+ implementation rootProject.ext.dependencies.arouter
+ annotationProcessor rootProject.ext.dependencies.aroutercompiler
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-monitor/consumer-rules.pro b/modules/mogo-module-monitor/consumer-rules.pro
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/modules/mogo-module-monitor/gradle.properties b/modules/mogo-module-monitor/gradle.properties
new file mode 100644
index 0000000000..db3ee2befd
--- /dev/null
+++ b/modules/mogo-module-monitor/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-monitor
+VERSION_CODE=1
diff --git a/modules/mogo-module-monitor/proguard-rules.pro b/modules/mogo-module-monitor/proguard-rules.pro
new file mode 100644
index 0000000000..481bb43481
--- /dev/null
+++ b/modules/mogo-module-monitor/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/modules/mogo-module-monitor/src/main/AndroidManifest.xml b/modules/mogo-module-monitor/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..9fdb2a839e
--- /dev/null
+++ b/modules/mogo-module-monitor/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorConst.java b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorConst.java
new file mode 100644
index 0000000000..41e54354ae
--- /dev/null
+++ b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorConst.java
@@ -0,0 +1,11 @@
+package com.zhidao.mogo.module.monitor;
+
+class MogoMonitorConst {
+ public static final String MODULE_NAME = "MogoMonitor";
+ public static final String MODULE_PATH = "/monitor/api";
+
+ public static final int LOG_PUSH_TYPE = 500000;
+
+ public static final int START_CATCH_LOG = 1;
+ public static final int STOP_CATCH_LOG = 2;
+}
diff --git a/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorProvider.java b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorProvider.java
new file mode 100644
index 0000000000..08bf4df033
--- /dev/null
+++ b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorProvider.java
@@ -0,0 +1,118 @@
+package com.zhidao.mogo.module.monitor;
+
+import android.content.Context;
+import android.util.ArrayMap;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.service.monitor.IMogoMonitorProvider;
+import com.mogo.utils.logger.LogLevel;
+import com.mogo.utils.logger.Logger;
+import com.zhidao.loglib.LogInfoManager;
+import com.zhidao.loglib.bean.RemoteLogPushContent;
+import com.zhidao.loglib.dialog.ILogDialogListener;
+import com.zhidao.loglib.upload.UploadManager;
+import com.zhidao.loglib.util.LogInfoManagerFactory;
+import com.zhidao.loglib.util.LoggingNotice;
+
+import java.util.Map;
+
+/**
+ * 应用监控模块provider
+ * @author tongchenfei
+ */
+@Route(path = MogoMonitorConst.MODULE_PATH)
+public class MogoMonitorProvider implements IMogoMonitorProvider, IMogoOnMessageListener, ILogDialogListener {
+ private static final String TAG = MogoMonitorConst.MODULE_NAME;
+ private LogInfoManager manualCatchLog = null;
+ private Map managerCache = new ArrayMap<>();
+ private Context context;
+
+ @Override
+ public void showLogDebugDialog() {
+ if (manualCatchLog == null) {
+ manualCatchLog = LogInfoManagerFactory.createManualLogInfoManager(context);
+ }
+ manualCatchLog.showDebugWindow().setDialogListener(this);
+ }
+
+ @Override
+ public void init(Context context) {
+ IMogoServiceApis apis =
+ (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
+ apis.getSocketManagerApi(context).registerOnMessageListener(MogoMonitorConst.LOG_PUSH_TYPE,this);
+ }
+
+ @Override
+ public void resetActivityContext(Context context) {
+ this.context = context;
+ UploadManager.getInstance().init(context);
+ LoggingNotice.getInstance().init(context);
+ }
+
+ @Override
+ public Class target() {
+ return RemoteLogPushContent.class;
+ }
+
+ @Override
+ public void onMsgReceived(RemoteLogPushContent obj) {
+ Logger.d(TAG, "收到push消息: " + obj);
+ switch (obj.getType()){
+ case MogoMonitorConst.START_CATCH_LOG:
+ if (managerCache.containsKey(obj.getPkgName())) {
+ Logger.d(TAG, "这个包名的日志正在抓了: " + obj);
+ return;
+ }
+ openLoggerLevel();
+ LogInfoManager infoManager =
+ LogInfoManagerFactory.createPushLogInfoManager(context, obj);
+ infoManager.start();
+ managerCache.put(obj.getPkgName(), infoManager);
+ break;
+ case MogoMonitorConst.STOP_CATCH_LOG:
+ LogInfoManager stopManager = managerCache.remove(obj.getPkgName());
+ if (stopManager != null) {
+ stopManager.stop();
+ }
+ closeLoggerLevel();
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ public void onLogStart() {
+ // 这个是通过对话框点击开始的回调
+ isInManualCatchLog = true;
+ openLoggerLevel();
+ }
+
+ @Override
+ public void onLogStop() {
+ // 这个是通过对话框点击结束的回调
+ isInManualCatchLog = false;
+ closeLoggerLevel();
+ }
+ private boolean isInManualCatchLog = false;
+
+ /**
+ * 放开Logger的限制
+ */
+ private void openLoggerLevel(){
+ Logger.init(LogLevel.DEBUG);
+ }
+
+ /**
+ * 根据状态收紧Logger的限制
+ */
+ private void closeLoggerLevel(){
+ if (!isInManualCatchLog && managerCache.size() == 0) {
+ Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
+ }
+ }
+}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
index 1d0189338f..12d74cddc5 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
@@ -364,7 +364,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
int size = getAppropriateSize( maxAmount, exploreWayList );
Map< String, IMogoMarker > existCarMap = purgeMarkerData( exploreWayList, ModuleNames.CARD_TYPE_ROAD_CONDITION );
- Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );for ( int i = 0; i < size; i++ ) {
+ Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );
+ for ( int i = 0; i < size; i++ ) {
MarkerExploreWay markerExploreWay = exploreWayList.get( i );
if ( !markerExploreWay.getCanLive() ) {
MarkerLocation markerLocation = markerExploreWay.getLocation();
@@ -402,7 +403,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
return;
}
IMogoMarker marker = drawMapMarker( entity, ServiceConst.MARKER_Z_INDEX_HIGH );
- marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f,300, new LinearInterpolator(), new OnMarkerAnimationListener() {
+ if ( marker == null ) {
+ return;
+ }
+ marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() {
@Override
public void onAnimStart() {
Logger.d( TAG, " onAnimStart ---1----> " );
@@ -410,7 +414,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
@Override
public void onAnimEnd() {
- if ( marker.isDestroyed() ) {
+ if ( marker == null || marker.isDestroyed() ) {
return;
}
marker.startScaleAnimation( 1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null );
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java
index 33d1fd0cc1..d87bec74a3 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java
@@ -67,11 +67,7 @@ public class RefreshModel {
refreshBody.limit = limit;
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
refreshBody.radius = radius;
- refreshBody.dataType.add( ServiceConst.CARD_TYPE_CARS_CHATTING );
refreshBody.dataType.add( ServiceConst.CARD_TYPE_ROAD_CONDITION );
- refreshBody.dataType.add( ServiceConst.CARD_TYPE_SHARE_MUSIC );
-// refreshBody.dataType.add(ServiceConst.CARD_TYPE_USER_DATA);
- refreshBody.dataType.add( ServiceConst.CARD_TYPE_NOVELTY );
String data = GsonUtil.jsonFromObject( refreshBody );
query.put( "data", data );
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java
index bd14999026..bef7d59ab0 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java
@@ -59,7 +59,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
@Override
public void drawableLastAllPOI() {
- //Logger.w(MODULE_NAME, "V2X---绘制上一次的POI,回调给Launcher底层逻辑让其进行绘制");
+ Logger.w(MODULE_NAME, "V2X---绘制上一次的POI,回调给Launcher底层逻辑让其进行绘制");
// 清除连接线
V2XServiceManager.getMoGoV2XPolylineManager().clearLine();
clearAlarmPOI();
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerRoadEventView.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerRoadEventView.kt
index 3059bcd6a7..2efee0e7e2 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerRoadEventView.kt
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerRoadEventView.kt
@@ -6,10 +6,10 @@ import android.graphics.Bitmap
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
-import com.mogo.module.service.utils.ViewUtils
-import com.mogo.module.v2x.R
import com.mogo.module.common.entity.V2XPoiTypeEnum
import com.mogo.module.common.entity.V2XRoadEventEntity
+import com.mogo.module.service.utils.ViewUtils
+import com.mogo.module.v2x.R
import kotlinx.android.synthetic.main.view_marker_event_car.view.*
/**
@@ -23,7 +23,7 @@ import kotlinx.android.synthetic.main.view_marker_event_car.view.*
* version: 1.0
*/
class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
- ConstraintLayout(context) {
+ ConstraintLayout(context) {
val TAG = "V2XMarkerRoadEventView"
init {
@@ -32,13 +32,13 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
fun initView(context: Context, alarmInfo: V2XRoadEventEntity) {
if (alarmInfo.poiType == V2XPoiTypeEnum.ALERT_FRONT_CAR ||
- alarmInfo.poiType == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString()
+ alarmInfo.poiType == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString()
) {
LayoutInflater.from(context)
- .inflate(R.layout.view_marker_event_car, this)
+ .inflate(R.layout.view_marker_event_car, this)
} else {
LayoutInflater.from(context)
- .inflate(R.layout.view_marker_event_road, this)
+ .inflate(R.layout.view_marker_event_road, this)
}
updateIcon(alarmInfo)
}
@@ -82,6 +82,10 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
V2XPoiTypeEnum.FOURS_ACCIDENT -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_7)
}
+ //事故
+ V2XPoiTypeEnum.FOURS_LIVING -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_1)
+ }
//红绿灯数据
V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_3)
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java
index 801ee51a9f..f44fd5ff4b 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java
@@ -95,6 +95,8 @@ public class V2XIllegalParkMarker implements IV2XMarker>
V2XServiceManager.getMoGoV2XPolylineManager().clearLine();
// 移除事件POI
V2XServiceManager.getMoGoV2XMarkerManager().clearAlarmPOI();
+ // 绘制上次的数据
+ V2XServiceManager.getMoGoV2XMarkerManager().drawableLastAllPOI();
}
/**
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java
index 9ba13d8dd1..a13c6142c3 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java
@@ -127,8 +127,6 @@ public class EventTypeUtils {
case V2XPoiTypeEnum.FOURS_FOG://浓雾
case V2XPoiTypeEnum.FOURS_ICE://结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
- case V2XPoiTypeEnum.FOURS_NEALY://身边
- case V2XPoiTypeEnum.FOURS_LIVING://实时路况
isRoadEvent = true;
break;
}
diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java b/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java
index b43d44aa72..cd801a0ea1 100644
--- a/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java
+++ b/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java
@@ -23,6 +23,7 @@ import com.mogo.service.module.IMogoMarkerService;
import com.mogo.service.module.IMogoRegisterCenter;
import com.mogo.service.module.IMogoSearchManager;
import com.mogo.service.module.IMogoSettingManager;
+import com.mogo.service.monitor.IMogoMonitorProvider;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.service.obu.IMogoObuManager;
import com.mogo.service.passport.IMogoPassportManager;
@@ -243,4 +244,10 @@ public interface IMogoServiceApis extends IProvider {
* @return
*/
IMogoAuthManager getAuthManagerApi();
+
+ /**
+ * 获取Monitor相关api
+ * @return
+ */
+ IMogoMonitorProvider getMogoMonitorApi();
}
diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java b/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
index 3d0c6ad1fc..1e5b00fa72 100644
--- a/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
+++ b/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
@@ -231,5 +231,5 @@ public class MogoServicePaths {
* 日志上传
*/
@Deprecated
- public static final String PATH_LOG_LIB = "/loglib/api";
+ public static final String PATH_MOGO_MONITOR = "/monitor/api";
}
diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/monitor/IMogoMonitorProvider.java b/services/mogo-service-api/src/main/java/com/mogo/service/monitor/IMogoMonitorProvider.java
new file mode 100644
index 0000000000..e7b0f6d0b0
--- /dev/null
+++ b/services/mogo-service-api/src/main/java/com/mogo/service/monitor/IMogoMonitorProvider.java
@@ -0,0 +1,22 @@
+package com.mogo.service.monitor;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.facade.template.IProvider;
+
+/**
+ * monitor接口
+ * @author tongchenfei
+ */
+public interface IMogoMonitorProvider extends IProvider {
+ /**
+ * 显示日志抓取窗口
+ */
+ void showLogDebugDialog();
+
+ /**
+ * 重置context,设置成activity的context
+ * @param context activity的context
+ */
+ void resetActivityContext(Context context);
+}
diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java b/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java
index a623abbb69..bf6943ce4d 100644
--- a/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java
+++ b/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java
@@ -31,6 +31,7 @@ import com.mogo.service.module.IMogoMarkerService;
import com.mogo.service.module.IMogoRegisterCenter;
import com.mogo.service.module.IMogoSearchManager;
import com.mogo.service.module.IMogoSettingManager;
+import com.mogo.service.monitor.IMogoMonitorProvider;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.service.obu.IMogoObuManager;
import com.mogo.service.passport.IMogoPassportManager;
@@ -206,7 +207,12 @@ public class MogoServiceApis implements IMogoServiceApis {
return getApiInstance( IMogoAuthManager.class, MogoServicePaths.PATH_AGREEMENT );
}
- private static < T extends IProvider > T getApiInstance( Class< T > clazz, String path ) {
+ @Override
+ public IMogoMonitorProvider getMogoMonitorApi() {
+ return getApiInstance(IMogoMonitorProvider.class,MogoServicePaths.PATH_MOGO_MONITOR);
+ }
+
+ private static < T extends IProvider > T getApiInstance(Class< T > clazz, String path ) {
T inst = SingletonsHolder.get( clazz );
if ( inst == null ) {
synchronized ( sLock ) {
diff --git a/settings.gradle b/settings.gradle
index 6f334160e1..5bdd706544 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,4 @@
+include ':modules:mogo-module-monitor'
include ':foudations:mogo-base-services-apk'
include ':foudations:mogo-base-services-sdk'
include ':modules:mogo-module-splash-noop'