From 686766fd2b5b88b53ef5d957f297632690195416 Mon Sep 17 00:00:00 2001 From: oh_ci Date: Tue, 5 Aug 2025 01:12:16 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!9725=20?= =?UTF-8?q?:=20mdm=E7=AE=A1=E6=8E=A7=E6=89=93=E7=82=B9=E8=A1=A5=E5=85=85'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inner_api/appexecfwk_base/include/appexecfwk_errors.h | 2 -- .../inner_api/appexecfwk_base/include/bundle_constants.h | 1 - .../src/bundlemgr/bundle_status_callback_proxy.cpp | 1 - services/bundlemgr/src/base_bundle_installer.cpp | 8 ++++---- services/bundlemgr/src/event_report.cpp | 1 - services/bundlemgr/src/status_receiver_proxy.cpp | 2 -- .../bms_bundle_data_group_test.cpp | 4 ++-- 7 files changed, 6 insertions(+), 13 deletions(-) diff --git a/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h b/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h index ba718e67f9..dfac06139e 100644 --- a/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h +++ b/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h @@ -613,8 +613,6 @@ enum { // Only used for hisysevent report ERR_APPEXECFWK_UNINSTALL_AND_INSTALL = 8522540, - ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW = 8522541, - // only allow install in u1 when set u1enable ERR_APPEXECFWK_INSTALL_U1ENABLE_CAN_ONLY_INSTALL_IN_U1_WITH_NOT_SINGLETON = 8522550, ERR_APPEXECFWK_INSTALL_U1_ENABLE_NOT_SUPPORT_APP_SERVICE_AND_SHARED_BUNDLE = 8522551, diff --git a/interfaces/inner_api/appexecfwk_base/include/bundle_constants.h b/interfaces/inner_api/appexecfwk_base/include/bundle_constants.h index 32d0b3181c..19d746653b 100644 --- a/interfaces/inner_api/appexecfwk_base/include/bundle_constants.h +++ b/interfaces/inner_api/appexecfwk_base/include/bundle_constants.h @@ -71,7 +71,6 @@ const std::set EXPECTED_ERROR = { ERR_APPEXECFWK_CLONE_INSTALL_APP_INDEX_EXISTED, ERR_APPEXECFWK_CLONE_INSTALL_APP_NOT_EXISTED, ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL, - ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW, ERR_APPEXECFWK_UNINSTALL_CONTROLLED }; diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_status_callback_proxy.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_status_callback_proxy.cpp index d45a0f9e24..009a803c7a 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_status_callback_proxy.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_status_callback_proxy.cpp @@ -146,7 +146,6 @@ void BundleStatusCallbackProxy::InitResultMap() {ERR_APPEXECFWK_INSTALL_SINGLETON_INCOMPATIBLE, "ERR_APPEXECFWK_INSTALL_SINGLETON_INCOMPATIBLE"}, {ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_INSTALL, "ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_INSTALL"}, {ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL, "ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL"}, - {ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW, "ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL"}, {ERR_APPEXECFWK_INSTALL_DEVICE_TYPE_NOT_SUPPORTED, "ERR_APPEXECFWK_INSTALL_DEVICE_TYPE_NOT_SUPPORTED"}, {ERR_APPEXECFWK_INSTALL_SYSCAP_FAILED_AND_DEVICE_TYPE_ERROR, "ERR_APPEXECFWK_INSTALL_SYSCAP_FAILED_AND_DEVICE_TYPE_ERROR"}, diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index 5eebb1f147..50d6014469 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -345,7 +345,7 @@ ErrCode BaseBundleInstaller::UninstallBundle(const std::string &bundleName, cons int32_t uid = Constants::INVALID_UID; bool isUninstalledFromBmsExtension = false; ErrCode result = ProcessBundleUninstall(bundleName, installParam, uid); - if (result == ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW) { + if (result == ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL) { CheckBundleNameAndStratAbility(bundleName, appIdentifier_); } if (result == ERR_APPEXECFWK_UNINSTALL_MISSING_INSTALLED_BUNDLE) { @@ -413,7 +413,7 @@ ErrCode BaseBundleInstaller::CheckUninstallInnerBundleInfo(const InnerBundleInfo if (!info.GetUninstallState()) { LOG_E(BMS_TAG_INSTALLER, "bundle : %{public}s can not be uninstalled, uninstallState : %{public}d", bundleName.c_str(), info.GetUninstallState()); - return ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW; + return ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL; } if (info.GetApplicationBundleType() != BundleType::SHARED) { LOG_E(BMS_TAG_INSTALLER, "uninstall bundle is not shared library"); @@ -1750,7 +1750,7 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall( if (!isForcedUninstall) { LOG_E(BMS_TAG_INSTALLER, "bundle : %{public}s can not be uninstalled, uninstallState : %{public}d", bundleName.c_str(), oldInfo.GetUninstallState()); - return ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW; + return ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL; } } @@ -2028,7 +2028,7 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall( !oldInfo.GetUninstallState() && installParam.GetKillProcess() && !installParam.GetIsUninstallAndRecover()) { LOG_E(BMS_TAG_INSTALLER, "bundle : %{public}s can not be uninstalled, uninstallState : %{public}d", bundleName.c_str(), oldInfo.GetUninstallState()); - return ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW; + return ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL; } bool isModuleExist = oldInfo.FindModule(modulePackage); diff --git a/services/bundlemgr/src/event_report.cpp b/services/bundlemgr/src/event_report.cpp index 8e064721b0..2e48383db4 100644 --- a/services/bundlemgr/src/event_report.cpp +++ b/services/bundlemgr/src/event_report.cpp @@ -51,7 +51,6 @@ const std::set INTERCEPTED_ERROR_CODE_SET = { ERR_APPEXECFWK_INSTALL_ENTERPRISE_BUNDLE_NOT_ALLOWED, ERR_BUNDLE_MANAGER_CODE_SIGNATURE_DELIVERY_FILE_FAILED, ERR_APPEXECFWK_INSTALL_PERMISSION_DENIED, - ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL, ERR_APPEXECFWK_INSTALL_EXISTED_ENTERPRISE_BUNDLE_NOT_ALLOWED }; constexpr const char* PARTITION_NAME = "/data"; diff --git a/services/bundlemgr/src/status_receiver_proxy.cpp b/services/bundlemgr/src/status_receiver_proxy.cpp index 6da781dcfe..dd058edcce 100644 --- a/services/bundlemgr/src/status_receiver_proxy.cpp +++ b/services/bundlemgr/src/status_receiver_proxy.cpp @@ -533,8 +533,6 @@ const std::unordered_map MAP_RECEIVED_RESULTS { {IStatusReceiver::ERR_INSTALL_DISALLOWED, MSG_ERR_INSTALL_DISALLOWED}}, {ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL, {IStatusReceiver::ERR_UNINSTALL_DISALLOWED, MSG_ERR_UNINSTALL_DISALLOWED}}, - {ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW, - {IStatusReceiver::ERR_UNINSTALL_DISALLOWED, MSG_ERR_UNINSTALL_DISALLOWED}}, {ERR_APPEXECFWK_UNINSTALL_SHARE_APP_LIBRARY_IS_NOT_EXIST, {IStatusReceiver::ERR_APPEXECFWK_UNINSTALL_SHARE_APP_LIBRARY_IS_NOT_EXIST, MSG_ERR_UNINSTALL_SHARE_APP_LIBRARY_NOT_EXIST}}, diff --git a/services/bundlemgr/test/unittest/bms_bundle_data_group_test/bms_bundle_data_group_test.cpp b/services/bundlemgr/test/unittest/bms_bundle_data_group_test/bms_bundle_data_group_test.cpp index c33d91db99..206561122a 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_data_group_test/bms_bundle_data_group_test.cpp +++ b/services/bundlemgr/test/unittest/bms_bundle_data_group_test/bms_bundle_data_group_test.cpp @@ -1547,7 +1547,7 @@ HWTEST_F(BmsBundleDataGroupTest, BaseBundleInstaller_0004, Function | SmallTest installParam.concentrateSendEvent = true; auto result = installer.UninstallBundle(bundleName, installParam); - EXPECT_EQ(result, ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW); + EXPECT_EQ(result, ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL); dataMgr->bundleInfos_.erase(bundleName); } @@ -1600,7 +1600,7 @@ HWTEST_F(BmsBundleDataGroupTest, BaseBundleInstaller_0007, Function | SmallTest info.uninstallState_ = false; std::string bundleName; auto ret = installer.CheckUninstallInnerBundleInfo(info, bundleName); - EXPECT_EQ(ret, ERR_APPEXECFWK_UNINSTALL_STATE_NOT_ALLOW); + EXPECT_EQ(ret, ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL); } /** -- Gitee