From f0511ac4eb06a0af279ad0c29db2873b86085404 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 30 Oct 2025 17:49:18 +0800 Subject: [PATCH] =?UTF-8?q?[8.2.6][]=20=E8=B0=83=E8=AF=95=E7=AA=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E5=90=AF=E4=B9=98=E5=AE=A2=E5=B1=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/telematic/TeleMsgHandler.kt | 13 ++++++- .../hmi/ui/setting/DebugSettingView.kt | 13 ++++++- .../main/res/layout/view_debug_setting.xml | 10 +++++- .../data/multidisplay/TelematicConstant.kt | 1 + .../eagle/core/utilcode/util/RebootUtils.java | 36 +++++++++++++++++++ 5 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/RebootUtils.java diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt index a8700ec064..70c0c9c2f9 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt @@ -38,6 +38,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.AppStateManager import com.mogo.eagle.core.utilcode.util.GsonUtils +import com.mogo.eagle.core.utilcode.util.RebootUtils import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.telematic.MogoProtocolMsg @@ -394,6 +395,14 @@ class TeleMsgHandler : IMsgHandler { } CallerTelematicListenerManager.dispatchB2DemoMode(value) } + TelematicConstant.PASSENGER_APP_REBOOT -> { + Log.i("xfk","乘客端收到司机端下发的重启命令") + CallerTelematicManager.sendMsgToServer( + TelematicConstant.PASSENGER_APP_REBOOT, + "".toByteArray() + ) + RebootUtils.restartApp() + } TelematicConstant.SHOW_TRAFFIC_LIGHT -> { val trafficLightJson = String(it.body) @@ -508,7 +517,9 @@ class TeleMsgHandler : IMsgHandler { // 来自客户端的响应 CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_RSP, it.body) } - + TelematicConstant.PASSENGER_APP_REBOOT -> { + ToastUtils.showLong("乘客屏已收到重启命令") + } else -> { } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 3e6ec15dfa..afc347be17 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -14,7 +14,6 @@ import android.os.Process import android.text.Html import android.text.TextUtils import android.util.AttributeSet -import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -123,6 +122,7 @@ import com.mogo.eagle.core.utilcode.util.DeviceUtils import com.mogo.eagle.core.utilcode.util.FileUtils import com.mogo.eagle.core.utilcode.util.KeyboardUtils import com.mogo.eagle.core.utilcode.util.NetworkUtils +import com.mogo.eagle.core.utilcode.util.RebootUtils import com.mogo.eagle.core.utilcode.util.SPUtils import com.mogo.eagle.core.utilcode.util.ScreenUtils import com.mogo.eagle.core.utilcode.util.StringUtils @@ -161,6 +161,7 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.btnEnsureMap import kotlinx.android.synthetic.main.view_debug_setting.view.btnFmd import kotlinx.android.synthetic.main.view_debug_setting.view.btnHdVisualAdjust import kotlinx.android.synthetic.main.view_debug_setting.view.btnIpcReboot +import kotlinx.android.synthetic.main.view_debug_setting.view.btnPassengerReboot import kotlinx.android.synthetic.main.view_debug_setting.view.btnPointCloudColor import kotlinx.android.synthetic.main.view_debug_setting.view.btnPointCloudSize import kotlinx.android.synthetic.main.view_debug_setting.view.btnRecordBag @@ -1133,6 +1134,16 @@ internal class DebugSettingView @JvmOverloads constructor( btnAppReboot.onClick { killApp() } + btnPassengerReboot.onClick { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + CallerTelematicManager.sendMsgToAllClients( + TelematicConstant.PASSENGER_APP_REBOOT, + "".toByteArray() + ) + } else { + RebootUtils.restartApp() + } + } //只在司机端设置工控机节点重启功能 if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { btnIpcReboot.visibility = View.GONE diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index e36c56739e..1957d74eb6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -333,7 +333,15 @@ android:text="杀死APP" android:padding="@dimen/dp_20" android:textSize="@dimen/dp_24" /> - +