From 0ae46e85ecf053557e09810f8868d3264835da68 Mon Sep 17 00:00:00 2001 From: daiyujia Date: Sat, 9 Aug 2025 14:59:43 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo:#ICS6E3=20Description:[Bug]:=20enable?= =?UTF-8?q?=E5=92=8Cdisable=E5=8F=AA=E5=9C=A8root=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E4=BD=BF=E7=94=A8=20Sig:bundleManager=20Feature=20or?= =?UTF-8?q?=20Bugfix:Bugfix=20Binary=20Source:No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: daiyujia Change-Id: I0aade6820fa4a23df5c26802d369a9de5a0bb71a --- frameworks/src/bundle_command.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frameworks/src/bundle_command.cpp b/frameworks/src/bundle_command.cpp index 609b7fe..a43dc9a 100644 --- a/frameworks/src/bundle_command.cpp +++ b/frameworks/src/bundle_command.cpp @@ -259,8 +259,6 @@ ErrCode BundleManagerShellCommand::CreateCommandMap() {"uninstall-plugin", [this] { return this->RunAsUninstallPluginCommand(); } }, {"dump", [this] { return this->RunAsDumpCommand(); } }, {"clean", [this] { return this->RunAsCleanCommand(); } }, - {"enable", [this] { return this->RunAsEnableCommand(); } }, - {"disable", [this] { return this->RunAsDisableCommand(); } }, {"get", [this] { return this->RunAsGetCommand(); } }, {"quickfix", [this] { return this->RunAsQuickFixCommand(); } }, {"compile", [this] { return this->RunAsCompileCommand(); } }, @@ -271,6 +269,12 @@ ErrCode BundleManagerShellCommand::CreateCommandMap() {"dump-shared", [this] { return this->RunAsDumpSharedCommand(); } }, }; + int32_t mode = GetIntParameter(IS_ROOT_MODE_PARAM, USER_MODE); + if (mode == ROOT_MODE) { + commandMap_.emplace("enable", [this] { return this->RunAsEnableCommand(); }); + commandMap_.emplace("disable", [this] { return this->RunAsDisableCommand(); }); + } + return OHOS::ERR_OK; } -- Gitee