From 7bdf83a2f9e794b5aaa3fe208507d57f6d2fc858 Mon Sep 17 00:00:00 2001 From: Zhou Shihui Date: Thu, 1 Aug 2024 19:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=BA=94=E7=94=A8=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E5=89=8D=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=8F=AF=E5=8D=B8?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhou Shihui --- services/bundlemgr/src/base_bundle_installer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index e2469d8ea8..db8e7ea6f7 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -1380,6 +1380,10 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall( return ERR_APPEXECFWK_USER_NOT_EXIST; } + if (!CheckWhetherCanBeUninstalled(bundleName)) { + return ERR_APPEXECFWK_UNINSTALL_CONTROLLED; + } + auto &mtx = dataMgr_->GetBundleMutex(bundleName); std::lock_guard lock {mtx}; InnerBundleInfo oldInfo; @@ -1426,10 +1430,6 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall( return ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL; } - if (!CheckWhetherCanBeUninstalled(bundleName)) { - return ERR_APPEXECFWK_UNINSTALL_CONTROLLED; - } - // reboot scan case will not kill the bundle if (installParam.noSkipsKill) { // kill the bundle process during uninstall. -- Gitee