From 5c056cf0af4e1386fcb2f93be44f5a64bc4f9838 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Mon, 21 Aug 2023 17:51:55 +0800 Subject: [PATCH] =?UTF-8?q?[5.0.0]=20[debugview=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9D=80=E6=AD=BBAPP]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/setting/DebugSettingView.kt | 15 +++++++++++++++ .../src/main/res/layout/view_debug_setting.xml | 10 ++++++++++ 2 files changed, 25 insertions(+) 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 45b4c2e80b..0122f7417c 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 @@ -89,6 +89,7 @@ import kotlin.collections.component3 import kotlin.collections.component4 import kotlin.collections.set import kotlin.math.abs +import kotlin.system.exitProcess /** @@ -745,6 +746,9 @@ internal class DebugSettingView @JvmOverloads constructor( CallerAutoPilotControlManager.sendIpcReboot() ToastUtils.showLong("重启命令已发送") } + btnAppReboot.onClick { + killApp() + } //只在司机端设置工控机节点重启功能 if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { btnIpcReboot.visibility = View.GONE @@ -2035,6 +2039,17 @@ internal class DebugSettingView @JvmOverloads constructor( } } + private fun killApp() { + Intent(Intent.ACTION_MAIN).apply { + addCategory(Intent.CATEGORY_HOME) + flags = Intent.FLAG_ACTIVITY_NEW_TASK + context.startActivity(this) + Process.killProcess(Process.myPid()) + exitProcess(0) + } + } + + /** * 初始化上报 */ 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 f5cefbfa4e..c377837ecb 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,6 +333,16 @@ android:padding="@dimen/dp_20" android:textSize="@dimen/dp_24" /> +