From 785d5fec1171e296aa5ee19c5ac892dc08786240 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Mon, 21 Nov 2022 12:45:37 +0800 Subject: [PATCH 1/9] fix bug of status bar --- .../core/function/hmi/ui/MoGoHmiFragment.kt | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index a593620e3a..88520e219a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -136,7 +136,6 @@ class MoGoHmiFragment : MvpFragment(), private var mSOPSettingView: SOPSettingView? = null //StatusView - private var statusBarViewFloat: WarningFloat.Builder? = null private var statusBarView: StatusBarView? = null private var mNoticeFloat: WarningFloat.Builder? = null @@ -198,10 +197,10 @@ class MoGoHmiFragment : MvpFragment(), } override fun initViews() { - toggleStatusBarView() - initViewShowWithConfig() + val decorView = requireActivity().window.decorView as FrameLayout + statusBarView = decorView.findViewWithTag("status_bar") as StatusBarView? //设置StatusBar初始状态 if (FunctionBuildConfig.isDemoMode) { statusBarView?.updateRightView(true, "demoMode", DemoModeView(requireContext())) @@ -744,52 +743,6 @@ class MoGoHmiFragment : MvpFragment(), } } - private fun toggleStatusBarView() { - activity?.let{ - if(statusBarViewFloat!= null){ - WarningFloat.dismiss(statusBarViewFloat!!.config.floatTag, false) - statusBarViewFloat = null - statusBarView = null - }else{ - if (statusBarView == null){ - statusBarView = StatusBarView(it) - } - val side = TOP - val gravity = Gravity.TOP - statusBarViewFloat = WarningFloat.with(it) - .setTag("statusBarView") - .setLayout(statusBarView!!) - .setSidePattern(side) - .setWindowWidth(ScreenUtils.getScreenWidth()) - .setWindowHeight(BarUtils.getStatusBarHeight()) - .setGravity(gravity, 0) - .setImmersionStatusBar(true) - .setAnimator(object : DefaultAnimator() { - override fun enterAnim( - view: View, - params: LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.enterAnim(view, params, windowManager, sidePattern) - ?.apply { - interpolator = LinearInterpolator() - } - - override fun exitAnim( - view: View, - params: LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.exitAnim(view, params, windowManager, sidePattern) - ?.setDuration(200) - }) - .show() - } - } - } - /** * 展示VR下V2X预警 * From a464d8fa22025da8db922defa9b06cc138a964a0 Mon Sep 17 00:00:00 2001 From: pangfan Date: Mon, 21 Nov 2022 15:00:37 +0800 Subject: [PATCH 2/9] [2.12.2-hotfix]release v2.12.2,2120200 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 111c18c586..668478f0ad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=2120000 -versionName=2.12.0 +versionCode=2120200 +versionName=2.12.2 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_AUTOPILOT_VERSION=0.0.58.10 From 05c2710f06aea1255431fcdc8b48d71f5081ad14 Mon Sep 17 00:00:00 2001 From: lianglihui Date: Wed, 4 Jan 2023 15:14:00 +0800 Subject: [PATCH 3/9] =?UTF-8?q?2.13.0=20=E4=BF=AE=E5=A4=8D=E5=B0=8F?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=BD=A8=E8=BF=B9=E6=B6=88=E5=A4=B1=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/core/function/smp/SmallMapFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java index d6af80ab4d..b621f93dfc 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java @@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; import com.mogo.eagle.core.function.map.R; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -69,6 +70,7 @@ public class SmallMapFragment extends BaseFragment mSmallMapDirectionView = mRootView.findViewById(R.id.smallMapDirectionView); mSmallMapDirectionView.onCreateView(savedInstanceState); CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this); + CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,this); } @Override @@ -95,7 +97,6 @@ public class SmallMapFragment extends BaseFragment @Override public void clearPolyline() { - CallerLogger.INSTANCE.i(M_MAP + TAG, "clearPolyline"); if (mSmallMapDirectionView != null) { UiThreadHandler.post(() -> mSmallMapDirectionView.clearPolyline()); } @@ -137,6 +138,7 @@ public class SmallMapFragment extends BaseFragment int tempStatus = autoPilotStatusInfo.getPilotmode(); CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" autoPilotStatus:"+autoPilotStatus); if (tempStatus != 1) { + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" clearPolyline"); clearPolyline(); }else if (tempStatus == 1 && autoPilotStatus == 0){ CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath"); @@ -170,13 +172,17 @@ public class SmallMapFragment extends BaseFragment if (globalPathResp == null || globalPathResp.getWayPointsList().size() == 0) { return; } + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+globalPathResp.getWayPointsList().size()); + List latLngList = new ArrayList<>(); for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) { latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude())); } if (latLngList.size() > 0) { + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"drawablePolyline"); drawablePolyline(latLngList); } else { + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"clearPolyline"); clearPolyline(); } } From 5905bf9f0243ad55cf606ae378c1f08aed11e59a Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 4 Jan 2023 15:28:32 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[2.13.0]fix=E7=BA=A2=E8=B7=AF=E7=81=AFVIP?= =?UTF-8?q?=E5=90=8C=E8=A1=8C=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=92=8CBadCase=E5=BC=B9=E7=AA=97=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E9=94=99=E8=AF=AFBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../badcase/biz/AIDataCollectWindow.kt | 2 +- .../badcase/biz/InitiativeBadCaseWindow.kt | 2 +- .../eagle/core/data/enums/EventTypeEnum.kt | 62 ++++++++++++++++--- 3 files changed, 55 insertions(+), 11 deletions(-) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt index 499e30d784..47411823d8 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt @@ -323,7 +323,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener // 默认固定位置,靠屏幕右边缘的中间 mWindowManager!!.defaultDisplay.getMetrics(metrics) mWindowParams!!.x = metrics.widthPixels - mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()-350 + mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950 mWindowManager!!.addView(mFloatLayout, mWindowParams) } } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt index 8f2f8cdda3..50f692b8ba 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt @@ -338,7 +338,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList // 默认固定位置,靠屏幕右边缘的中间 mWindowManager!!.defaultDisplay.getMetrics(metrics) mWindowParams!!.x = metrics.widthPixels - mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()-950 + mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950 mWindowManager!!.addView(mFloatLayout, mWindowParams) //开启录包 if(recordCaseEntity!=null){ diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt index 66da21999d..604d540451 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt @@ -654,39 +654,59 @@ enum class EventTypeEnum( return when (poiType) { //交通检查 TRAFFIC_CHECK.poiType -> { - R.drawable.v_to_x_marker_2 + R.drawable.v2x_icon_jiaotongjiancha_vr } //封路 ROAD_CLOSED.poiType -> { - R.drawable.v_to_x_marker_16 + R.drawable.v2x_icon_fenglu_vr } //施工 FOURS_ROAD_WORK.poiType -> { - R.drawable.v_to_x_marker_11 + R.drawable.icon_warning_v2x_road_construction } //AI施工 AI_ROAD_WORK.poiType -> { - R.drawable.v_to_x_marker_11 + R.drawable.icon_warning_v2x_road_construction } //拥堵 FOURS_BLOCK_UP.poiType -> { - R.drawable.v_to_x_marker_5 + R.drawable.icon_warning_v2x_congestion } //积水 FOURS_PONDING.poiType -> { - R.drawable.v_to_x_marker_6 + R.drawable.v2x_icon_jishui_vr } //浓雾 FOURS_FOG.poiType -> { - R.drawable.v_to_x_marker_9 + R.drawable.v2x_icon_nongwu_vr } //结冰 FOURS_ICE.poiType -> { - R.drawable.v_to_x_marker_8 + R.drawable.v2x_icon_jiebing_vr } //事故 FOURS_ACCIDENT.poiType -> { - R.drawable.v_to_x_marker_7 + R.drawable.v2x_icon_jiaotongshigu_vr + } + //重大事故 + FOURS_ACCIDENT_01.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //特大事故 + FOURS_ACCIDENT_02.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //较大事故 + FOURS_ACCIDENT_03.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //一般事故 + FOURS_ACCIDENT_04.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //轻微事故 + FOURS_ACCIDENT_05.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr } //事故 FOURS_LIVING.poiType -> { @@ -708,6 +728,30 @@ enum class EventTypeEnum( ALERT_CAR_TROUBLE_WARNING.poiType -> { R.drawable.icon_car_red } + //VIP车辆优先通行,已为您变为绿灯 + TYPE_VIP_IDENTIFICATION_PASS.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //VIP车辆优先通行,已为您延长绿灯 + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //VIP变灯请求失败 + TYPE_VIP_ERROR_IDENTIFICATION.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //最优路线 + TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> { + R.drawable.icon_warning_v2x_optimal_route + } + //鬼探头类型 + GHOST_PROBE.poiType -> { + R.drawable.icon_warning_v2x_pedestrian_crossing + } + //接管 + TAKE_OVER_EVENT.poiType -> { + R.drawable.icon_warning_take_over + } else -> { R.drawable.icon_default } From 0de061b63c4419efa32ddbdfcc9933334748f903 Mon Sep 17 00:00:00 2001 From: lianglihui Date: Thu, 5 Jan 2023 15:10:30 +0800 Subject: [PATCH 5/9] =?UTF-8?q?2.13.0=20=E4=BF=AE=E5=A4=8D=E5=B0=8F?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=BD=A8=E8=BF=B9=E6=B6=88=E5=A4=B1=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/core/function/smp/SmallMapFragment.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java index b621f93dfc..129bf728c3 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java @@ -90,8 +90,13 @@ public class SmallMapFragment extends BaseFragment @Override public void drawablePolyline(List coordinates) { if (mSmallMapDirectionView != null) { - mSmallMapDirectionView.convert(coordinates); - UiThreadHandler.post(() -> mSmallMapDirectionView.drawablePolyline()); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mSmallMapDirectionView.convert(coordinates); + mSmallMapDirectionView.drawablePolyline(); + } + }); } } From 5180d3b6f93313ef85130a6bc16f7249b4e37b3e Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 10 Jan 2023 19:25:21 +0800 Subject: [PATCH 6/9] =?UTF-8?q?[v2.13.2][Fix]=E8=A7=A3=E5=86=B3Room?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/main/MainMoGoApplication.java | 16 +++++++++------- .../eagle/core/function/msgbox/DataManager.kt | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 889febb1a4..a080bc6d00 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -65,21 +65,23 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { } start = System.currentTimeMillis(); connectAmiIp(); - initOverviewDb(); // Crash 日志收集 initCrashConfig(); initLogConfig(); initTipToast(); initModules(); - if (DebugConfig.isDebug()) { - initKoom(); - } //查询是否有版本的更新 queryAppUpgrade(); - clearMessageBoxTable(); - checkMonitorDb(); + if (ProcessUtils.isMainProcess(this)) { + initOverviewDb(); + if (DebugConfig.isDebug()) { + initKoom(); + } + clearMessageBoxTable(); + checkMonitorDb(); + CallerMsgBoxManager.INSTANCE.queryAllMessages(this); + } upgradeProgressListener(); - CallerMsgBoxManager.INSTANCE.queryAllMessages(this); } @Override diff --git a/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt b/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt index ae02bbd2d8..1b614ace1f 100644 --- a/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt +++ b/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt @@ -12,6 +12,7 @@ import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.eagle.core.utilcode.util.Utils import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -156,6 +157,7 @@ object DataManager { } private suspend fun getCacheMessages(context: Context): List = withContext(Dispatchers.IO) { + delay(2000) return@withContext MsgBoxDb.getDb(context) .monitorDao() .getAllCachedMessages() From 3ecbad547292c75ec389420b19a466d8ad8090b6 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 11 Jan 2023 15:44:34 +0800 Subject: [PATCH 7/9] =?UTF-8?q?[2.13.2][fix]=E8=A7=A3=E5=86=B3=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/main/MainMoGoApplication.java | 43 ++++++++++++------- .../eagle/core/function/msgbox/DataManager.kt | 7 ++- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index a080bc6d00..569f02f2d8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -106,23 +106,27 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date currDate = new Date(System.currentTimeMillis()); String currTimeStr = format.format(currDate); - if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) { - boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr); - // 超过一天需要清除消息盒子中的数据,并把时间戳存入SP - if (!isSameDay) { + try { + if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) { + boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr); + // 超过一天需要清除消息盒子中的数据,并把时间戳存入SP + if (!isSameDay) { + File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME); + if (file != null && file.exists()) { + this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME); + } + SPUtils.getInstance().put("last_launch", currTimeStr); + } + } else { + // 首次使用App或中途仅删除sp文件 File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME); if (file != null && file.exists()) { this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME); } SPUtils.getInstance().put("last_launch", currTimeStr); } - } else { - // 首次使用App或中途仅删除sp文件 - File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME); - if (file != null && file.exists()) { - this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME); - } - SPUtils.getInstance().put("last_launch", currTimeStr); + } catch (Exception e) { + CallerLogger.INSTANCE.e(TAG, e.getMessage()); } }).start(); } @@ -130,11 +134,18 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { private void checkMonitorDb() { new Thread(() -> { long limitId = 50001; - List cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId); - List memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId); - // 大于5w条清除 - if (cpuList.size() > 0 || memList.size() > 0) { - this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME); + File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME); + try { + if (file != null && file.exists()) { + List cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId); + List memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId); + // 大于5w条清除 + if (cpuList.size() > 0 || memList.size() > 0) { + this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME); + } + } + } catch (Exception e) { + CallerLogger.INSTANCE.e(TAG, e.getMessage()); } }).start(); } diff --git a/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt b/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt index 1b614ace1f..c394ba105c 100644 --- a/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt +++ b/core/function-impl/mogo-core-function-msgbox/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt @@ -9,6 +9,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb import com.mogo.eagle.core.function.msgbox.db.MsgBoxInfo import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.eagle.core.utilcode.util.Utils import kotlinx.coroutines.Dispatchers @@ -140,7 +141,11 @@ object DataManager { fun queryAllMessages(context: Context) { scope.launch { initCache() - getCacheMessages(context) + try { + getCacheMessages(context) + } catch (e: Exception) { + CallerLogger.e("DataManager", e.message) + } } } From 6dde7380b8ea2b0d4e35ee6d406ed959c0de6189 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 11 Jan 2023 16:43:04 +0800 Subject: [PATCH 8/9] =?UTF-8?q?[2.13.2][Opt]=E6=9F=A5=E8=AF=A2=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E7=9B=91=E6=8E=A7=E7=9A=84=E6=97=B6=E6=9C=BA=E5=90=8E?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/main/MainActivity.java | 24 +++++++++++++++++++ .../function/main/MainMoGoApplication.java | 23 ------------------ 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java index bf1fc63be2..337e4aacf0 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java @@ -63,9 +63,13 @@ import com.mogo.map.uicontroller.IMogoMapUIController; import com.rousetime.android_startup.StartupManager; import com.rousetime.android_startup.model.LoggerLevel; import com.rousetime.android_startup.model.StartupConfig; +import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo; +import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo; +import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb; import com.zhjt.service.chain.ChainLog; import com.zhjt.service.chain.TracingConstants; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -271,6 +275,7 @@ public class MainActivity extends MvpActivity implement // 启动Native内存泄漏监测 startLeakMonitor(); } + checkMonitorDb(); } /** @@ -309,6 +314,25 @@ public class MainActivity extends MvpActivity implement LeakMonitor.INSTANCE.start(); } + private void checkMonitorDb() { + new Thread(() -> { + long limitId = 50001; + File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME); + try { + if (file != null && file.exists()) { + List cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId); + List memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId); + // 大于5w条清除 + if (cpuList.size() > 0 || memList.size() > 0) { + this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME); + } + } + } catch (Exception e) { + CallerLogger.INSTANCE.e(TAG, e.getMessage()); + } + }).start(); + } + @ChainLog( linkChainLog = CHAIN_LINK_LOG_NATIVE_LEAK, linkCode = CHAIN_LINK_LEAK, diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 569f02f2d8..ab789ac15b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -39,9 +39,6 @@ import com.mogo.eagle.core.utilcode.util.ProcessUtils; import com.mogo.eagle.core.utilcode.util.SPUtils; import com.mogo.map.MapApiPath; import com.zhidao.support.obu.ami.AmiClientManager; -import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo; -import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo; -import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb; import java.io.File; import java.lang.reflect.Field; @@ -78,7 +75,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { initKoom(); } clearMessageBoxTable(); - checkMonitorDb(); CallerMsgBoxManager.INSTANCE.queryAllMessages(this); } upgradeProgressListener(); @@ -131,25 +127,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { }).start(); } - private void checkMonitorDb() { - new Thread(() -> { - long limitId = 50001; - File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME); - try { - if (file != null && file.exists()) { - List cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId); - List memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId); - // 大于5w条清除 - if (cpuList.size() > 0 || memList.size() > 0) { - this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME); - } - } - } catch (Exception e) { - CallerLogger.INSTANCE.e(TAG, e.getMessage()); - } - }).start(); - } - private void upgradeProgressListener() { final NotificationCompat.Builder builder = new NotificationCompat.Builder(this); builder.setSmallIcon(R.mipmap.icon1001); From 8b80f5fbde76cc0d7a82c2e77f56dfcad73e871a Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 12 Jan 2023 19:54:45 +0800 Subject: [PATCH 9/9] =?UTF-8?q?[2.13.2][fix]=E8=A7=A3=E5=86=B3=E5=A4=9A?= =?UTF-8?q?=E6=9D=A1V2X=E4=BA=8B=E4=BB=B6=E5=8F=AA=E4=B8=80=E6=9D=A1?= =?UTF-8?q?=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt index 26a9e8e811..374c545563 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt @@ -2,4 +2,12 @@ package com.mogo.eagle.core.data.msgbox import java.io.Serializable -data class V2XMsg(var type: String = "", var content: String? = "", var tts: String? = ""): Serializable \ No newline at end of file +data class V2XMsg(var type: String = "", var content: String? = "", var tts: String? = ""): Serializable { + + // 临时解决该问题:V2XMsg->json作为主键,如果主键一样数据条目不会新增 + private var timeStamp: Long = 0 + + init { + timeStamp = System.currentTimeMillis() + } +} \ No newline at end of file