From 28dcc167f06f0f462a37ee327992f628e6770cb9 Mon Sep 17 00:00:00 2001 From: lanhaoyu Date: Fri, 12 Sep 2025 09:45:05 +0800 Subject: [PATCH] clone_code Signed-off-by: lanhaoyu --- .../bundlemgr/src/bundle_installer_host.cpp | 3 +-- .../bms_bundle_installer_test.cpp | 19 ------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/services/bundlemgr/src/bundle_installer_host.cpp b/services/bundlemgr/src/bundle_installer_host.cpp index 7d8f7c7379..18dd3c9bb2 100644 --- a/services/bundlemgr/src/bundle_installer_host.cpp +++ b/services/bundlemgr/src/bundle_installer_host.cpp @@ -954,8 +954,7 @@ size_t BundleInstallerHost::GetCurTaskNum() ErrCode BundleInstallerHost::InstallCloneApp(const std::string &bundleName, int32_t userId, int32_t& appIndex) { - if (OHOS::system::GetBoolParameter(ServiceConstants::IS_ENTERPRISE_DEVICE, false) && - OHOS::system::GetBoolParameter(ServiceConstants::IS_APP_CLONE_DISABLE, false)) { + if (OHOS::system::GetBoolParameter(ServiceConstants::IS_APP_CLONE_DISABLE, false)) { LOG_E(BMS_TAG_INSTALLER, "the enterprise device does not support the creation of an appClone instance."); return ERR_APPEXECFWK_CLONE_INSTALL_APP_NOT_SUPPORTED_MULTI_TYPE; } diff --git a/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp b/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp index a5e3a0edd8..da5452b277 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp +++ b/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp @@ -8614,28 +8614,9 @@ HWTEST_F(BmsBundleInstallerTest, InstallCloneApp_0200, Function | SmallTest | Le { int32_t index = 0; BundleInstallerHost bundleInstallerHost; - OHOS::system::SetParameter(ServiceConstants::IS_ENTERPRISE_DEVICE, "true"); OHOS::system::SetParameter(ServiceConstants::IS_APP_CLONE_DISABLE, "true"); ErrCode result = bundleInstallerHost.InstallCloneApp(BUNDLE_NAME, USERID, index); EXPECT_EQ(result, ERR_APPEXECFWK_CLONE_INSTALL_APP_NOT_SUPPORTED_MULTI_TYPE); - OHOS::system::SetParameter(ServiceConstants::IS_ENTERPRISE_DEVICE, "false"); - OHOS::system::SetParameter(ServiceConstants::IS_APP_CLONE_DISABLE, "false"); -} - -/** - * @tc.number: InstallCloneApp_0300 - * @tc.name: test Install - * @tc.desc: 1.Test the InstallCloneApp of BundleInstallerHost -*/ -HWTEST_F(BmsBundleInstallerTest, InstallCloneApp_0300, Function | SmallTest | Level0) -{ - int32_t index = 0; - BundleInstallerHost bundleInstallerHost; - OHOS::system::SetParameter(ServiceConstants::IS_ENTERPRISE_DEVICE, "true"); - OHOS::system::SetParameter(ServiceConstants::IS_APP_CLONE_DISABLE, "false"); - ErrCode result = bundleInstallerHost.InstallCloneApp(BUNDLE_NAME, USERID, index); - EXPECT_EQ(result, ERR_APPEXECFWK_CLONE_INSTALL_APP_NOT_EXISTED); - OHOS::system::SetParameter(ServiceConstants::IS_ENTERPRISE_DEVICE, "false"); OHOS::system::SetParameter(ServiceConstants::IS_APP_CLONE_DISABLE, "false"); } -- Gitee