From 50336b68f122244b91c8a1a71f2df27fc0b04054 Mon Sep 17 00:00:00 2001 From: Zhou Shihui Date: Thu, 8 May 2025 10:31:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=A3=80=E6=9F=A5=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E7=BA=A6=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhou Shihui --- .../include/appexecfwk_errors.h | 1 + services/bundlemgr/include/account_helper.h | 2 + .../include/bundle_service_constants.h | 2 + services/bundlemgr/src/account_helper.cpp | 16 ++ .../bundlemgr/src/base_bundle_installer.cpp | 8 + .../src/bundle_multiuser_installer.cpp | 6 + .../bundlemgr/src/status_receiver_proxy.cpp | 3 + services/bundlemgr/test/BUILD.gn | 1 + .../src/mock_account_helper_constraint.cpp | 143 ++++++++++++++ .../bms_account_constraint_test/BUILD.gn | 178 ++++++++++++++++++ .../bms_account_constraint_test.cpp | 140 ++++++++++++++ 11 files changed, 500 insertions(+) create mode 100644 services/bundlemgr/test/mock/src/mock_account_helper_constraint.cpp create mode 100644 services/bundlemgr/test/unittest/bms_account_constraint_test/BUILD.gn create mode 100644 services/bundlemgr/test/unittest/bms_account_constraint_test/bms_account_constraint_test.cpp diff --git a/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h b/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h index 769a845726..84a179d399 100644 --- a/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h +++ b/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h @@ -155,6 +155,7 @@ enum { ERR_APPEXECFWK_INSTALL_GWP_ASAN_ENABLED_NOT_SAME = 8519783, ERR_APPEXECFWK_INSTALL_DEBUG_BUNDLE_NOT_ALLOWED = 8519784, ERR_APPEXECFWK_INSTALL_FAILED_CONTROLLED = 8519785, + ERR_APPEXECFWK_INSTALL_FAILED_ACCOUNT_CONSTRAINT = 8519786, ERR_APPEXECFWK_INSTALL_APP_IN_BLOCKLIST = 8519787, ERR_APPEXECFWK_INSTALL_INTERNALTESTING_BUNDLE_NOT_ALLOWED = 8519788, diff --git a/services/bundlemgr/include/account_helper.h b/services/bundlemgr/include/account_helper.h index 2f57bfa207..865e0718ca 100644 --- a/services/bundlemgr/include/account_helper.h +++ b/services/bundlemgr/include/account_helper.h @@ -34,6 +34,8 @@ public: static int32_t GetCurrentActiveUserIdWithRetry(bool isOtaInstall = false); static void QueryAllCreatedOsAccounts(std::set &userIds); + + static bool CheckOsAccountConstraintEnabled(const int32_t userId, const std::string &constraint); }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/include/bundle_service_constants.h b/services/bundlemgr/include/bundle_service_constants.h index 55dc328ca9..91280cd76a 100644 --- a/services/bundlemgr/include/bundle_service_constants.h +++ b/services/bundlemgr/include/bundle_service_constants.h @@ -195,6 +195,8 @@ constexpr const char* NEW_CLOUD_SHADER_PATH = "/data/app/el1/public/shader_cache constexpr const char* API_RELEASE_TYPE_RELEASE = "Release"; constexpr const char* API_RELEASE_TYPE_BETA = "Beta"; constexpr const char* API_RELEASE_TYPE_CANARY = "Canary"; +// account constraint +constexpr const char* CONSTRAINT_APPS_INSTALL = "constraint.apps.install"; // allow multi icon bundle const std::set ALLOW_MULTI_ICON_BUNDLE = { "com.ohos.contacts" diff --git a/services/bundlemgr/src/account_helper.cpp b/services/bundlemgr/src/account_helper.cpp index cb4cf9a78d..dc5a6b66ea 100644 --- a/services/bundlemgr/src/account_helper.cpp +++ b/services/bundlemgr/src/account_helper.cpp @@ -134,5 +134,21 @@ int32_t AccountHelper::GetCurrentActiveUserIdWithRetry(bool isOtaInstall) return Constants::INVALID_USERID; #endif } + +bool AccountHelper::CheckOsAccountConstraintEnabled(const int32_t userId, const std::string &constraint) +{ +#ifdef ACCOUNT_ENABLE + bool isEnabled = false; + int32_t ret = AccountSA::OsAccountManager::CheckOsAccountConstraintEnabled(userId, constraint, isEnabled); + if (ret != 0) { + APP_LOGE("failed ret:%{public}d", ret); + return false; + } + return isEnabled; +#else + APP_LOGI("ACCOUNT_ENABLE is false"); + return false; +#endif +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index 2a161e1186..8012fad177 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -861,6 +861,10 @@ ErrCode BaseBundleInstaller::InnerProcessBundleInstall(std::unordered_map MAP_RECEIVED_RESULTS { {ERR_APPEXECFWK_INSTALL_FAILED_CONTROLLED, {IStatusReceiver::ERR_INSTALL_CODE_APP_CONTROLLED_FAILED, MSG_ERR_INSTALL_CODE_APP_CONTROLLED_FAILED}}, + {ERR_APPEXECFWK_INSTALL_FAILED_ACCOUNT_CONSTRAINT, + {IStatusReceiver::ERR_INSTALL_CODE_APP_CONTROLLED_FAILED, + MSG_ERR_INSTALL_CODE_APP_CONTROLLED_FAILED}}, {ERR_APPEXECFWK_INSTALL_APP_IN_BLOCKLIST, {IStatusReceiver::ERR_INSTALL_CODE_APP_CONTROLLED_FAILED, MSG_ERR_INSTALL_CODE_APP_CONTROLLED_FAILED}}, diff --git a/services/bundlemgr/test/BUILD.gn b/services/bundlemgr/test/BUILD.gn index 2421c430ca..ab74de7acc 100644 --- a/services/bundlemgr/test/BUILD.gn +++ b/services/bundlemgr/test/BUILD.gn @@ -50,6 +50,7 @@ group("unittest") { if (bundle_framework_graphics) { deps += [ "unittest/bms_ability_manager_helper_test:unittest", + "unittest/bms_account_constraint_test:unittest", "unittest/bms_app_control_proxy_test:unittest", "unittest/bms_bundle_accesstokenid_test:unittest", "unittest/bms_bundle_aot_test:unittest", diff --git a/services/bundlemgr/test/mock/src/mock_account_helper_constraint.cpp b/services/bundlemgr/test/mock/src/mock_account_helper_constraint.cpp new file mode 100644 index 0000000000..5a5e904547 --- /dev/null +++ b/services/bundlemgr/test/mock/src/mock_account_helper_constraint.cpp @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "account_helper.h" + +#include + +#include "app_log_wrapper.h" +#include "bundle_constants.h" + +#ifdef ACCOUNT_ENABLE +#include "os_account_manager.h" +#endif + +namespace OHOS { +namespace AppExecFwk { +namespace { + constexpr int32_t RETRY_TIMES = 20; + constexpr int32_t RETRY_INTERVAL = 50; // 50ms +} + +int32_t AccountHelper::IsOsAccountExists(const int32_t id, bool &isOsAccountExists) +{ +#ifdef ACCOUNT_ENABLE + return AccountSA::OsAccountManager::IsOsAccountCompleted(id, isOsAccountExists); +#else + APP_LOGI("ACCOUNT_ENABLE is false"); + // ACCOUNT_ENABLE is false, do nothing and return -1. + return -1; +#endif +} + +void AccountHelper::QueryAllCreatedOsAccounts(std::set &userIds) +{ +#ifdef ACCOUNT_ENABLE + std::vector osAccountInfos; + if (AccountSA::OsAccountManager::QueryAllCreatedOsAccounts(osAccountInfos) == 0) { + for (AccountSA::OsAccountInfo acct : osAccountInfos) { + userIds.insert(acct.GetLocalId()); + } + } +#else + APP_LOGI("ACCOUNT_ENABLE is false"); + // ACCOUNT_ENABLE is false, do nothing . +#endif +} + +int32_t AccountHelper::GetCurrentActiveUserId() +{ +#ifdef ACCOUNT_ENABLE + int32_t localId; + int32_t ret = AccountSA::OsAccountManager::GetForegroundOsAccountLocalId(localId); + if (ret != 0) { + APP_LOGE_NOFUNC("GetForegroundOsAccountLocalId failed ret:%{public}d", ret); + return Constants::INVALID_USERID; + } + return localId; +#else + APP_LOGI("ACCOUNT_ENABLE is false"); + return 0; +#endif +} + +bool AccountHelper::IsOsAccountVerified(const int32_t userId) +{ +#ifdef ACCOUNT_ENABLE + bool isOsAccountVerified = false; + int32_t ret = AccountSA::OsAccountManager::IsOsAccountVerified(userId, isOsAccountVerified); + if (ret != 0) { + APP_LOGE("IsOsAccountVerified failed ret:%{public}d", ret); + return false; + } + return isOsAccountVerified; +#else + APP_LOGI("ACCOUNT_ENABLE is false"); + return false; +#endif +} + +int32_t AccountHelper::GetOsAccountLocalIdFromUid(const int32_t callingUid) +{ + int32_t localId = callingUid < Constants::DEFAULT_USERID ? Constants::INVALID_USERID : + callingUid / Constants::BASE_USER_RANGE; +#ifdef ACCOUNT_ENABLE + if (localId <= Constants::DEFAULT_USERID) { + APP_LOGW_NOFUNC("GetOsAccountLocalIdFromUid fail uid:%{public}d req from active userid", callingUid); + return AccountHelper::GetCurrentActiveUserId(); + } + return localId; +#else + APP_LOGI("ACCOUNT_ENABLE is false"); + // ACCOUNT_ENABLE is false, do nothing and return -1. + return localId; +#endif +} + +int32_t AccountHelper::GetCurrentActiveUserIdWithRetry(bool isOtaInstall) +{ +#ifdef ACCOUNT_ENABLE + // Failed to obtain foreground Os Account when OTA. BMS SA is not registered. + int32_t localId = Constants::INVALID_USERID; + if (!isOtaInstall) { + localId = GetCurrentActiveUserId(); + if (localId != Constants::INVALID_USERID) { + return localId; + } + } + int32_t retryCnt = 0; + do { + int32_t ret = AccountSA::OsAccountManager::GetDefaultActivatedOsAccount(localId); + if (ret == 0) { + break; + } + ++retryCnt; + std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_INTERVAL)); + APP_LOGW("get foregroud osAccount failed, retry count: %{public}d, ret: %{public}d", retryCnt, ret); + } while (retryCnt < RETRY_TIMES); + + return localId; +#else + APP_LOGI("ACCOUNT_ENABLE is false"); + return Constants::INVALID_USERID; +#endif +} + +bool AccountHelper::CheckOsAccountConstraintEnabled(const int32_t userId, const std::string &constraint) +{ + return true; +} +} // namespace AppExecFwk +} // namespace OHOS diff --git a/services/bundlemgr/test/unittest/bms_account_constraint_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_account_constraint_test/BUILD.gn new file mode 100644 index 0000000000..fb8751b488 --- /dev/null +++ b/services/bundlemgr/test/unittest/bms_account_constraint_test/BUILD.gn @@ -0,0 +1,178 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/test.gni") +import("../../../../../appexecfwk.gni") +import("../../../../../services/bundlemgr/appexecfwk_bundlemgr.gni") + +config("private_config") { + include_dirs = [ "${services_path}/bundlemgr/test/mock/include" ] +} + +module_output_path = "bundle_framework/bundle_framework" + +ohos_unittest("BmsAccountConstraintTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + use_exceptions = true + module_out_path = module_output_path + sources = bundle_mgr_source + sources += bundle_install_sources + sources += sandbox_app + sources -= [ "${services_path}/bundlemgr/src/bms_param.cpp" ] + sources += [ "${services_path}/bundlemgr/test/mock/src/bms_param.cpp" ] + sources -= [ "${services_path}/bundlemgr/src/system_ability_helper.cpp" ] + sources -= [ + "${services_path}/bundlemgr/src/account_helper.cpp", + "${services_path}/bundlemgr/src/bundle_mgr_service_event_handler.cpp", + ] + sources += [ + "${services_path}/bundlemgr/src/aot/aot_executor.cpp", + "${services_path}/bundlemgr/src/installd/installd_host_impl.cpp", + "${services_path}/bundlemgr/test/mock/src/accesstoken_kit.cpp", + "${services_path}/bundlemgr/test/mock/src/bundle_mgr_service_event_handler.cpp", + "${services_path}/bundlemgr/test/mock/src/mock_account_helper_constraint.cpp", + "${services_path}/bundlemgr/test/mock/src/mock_status_receiver.cpp", + "${services_path}/bundlemgr/test/mock/src/parameter/parameters.cpp", + "${services_path}/bundlemgr/test/mock/src/system_ability_helper.cpp", + ] + + sources += [ "bms_account_constraint_test.cpp" ] + + configs = [ + "${services_path}/bundlemgr/test:bundlemgr_test_config", + "${inner_api_path}/appexecfwk_base:appexecfwk_base_sdk_config", + ] + cflags = [] + if (target_cpu == "arm") { + cflags += [ "-DBINDER_IPC_32BIT" ] + } + deps = [ "${core_path}:appexecfwk_core" ] + deps += bundle_install_deps + + external_deps = [ + "ability_base:want", + "ability_runtime:app_manager", + "access_token:el5_filekey_manager_sdk", + "access_token:libprivacy_sdk", + "access_token:libtokenid_sdk", + "appverify:libhapverify", + "bounds_checking_function:libsec_shared", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hitrace:hitrace_meter", + "init:libbegetutil", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + "selinux_adapter:librestorecon", + ] + external_deps += bundle_install_external_deps + defines = [] + if (code_signature_enable) { + sources += [ + "${services_path}/bundlemgr/src/aot/aot_sign_data_cache_mgr.cpp", + "${services_path}/bundlemgr/src/code_sign_helper.cpp", + ] + external_deps += [ + "bounds_checking_function:libsec_shared", + "code_signature:libcode_sign_utils", + "ets_runtime:libcompiler_service", + ] + defines += [ "CODE_SIGNATURE_ENABLE" ] + } + if (configpolicy_enable) { + external_deps += [ "config_policy:configpolicy_util" ] + defines += [ "CONFIG_POLOCY_ENABLE" ] + } + if (account_enable) { + external_deps += [ "os_account:os_account_innerkits" ] + defines += [ "ACCOUNT_ENABLE" ] + } + if (bundle_framework_free_install) { + sources += aging + sources += free_install + sources += distributed_manager + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:ability_start_options", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + defines += [ "BUNDLE_FRAMEWORK_FREE_INSTALL" ] + } + if (bundle_framework_sandbox_app) { + defines += [ "BUNDLE_FRAMEWORK_SANDBOX_APP" ] + } + if (global_resmgr_enable) { + defines += [ "GLOBAL_RESMGR_ENABLE" ] + external_deps += [ "resource_management:global_resmgr" ] + } + if (bundle_framework_power_mgr_enable) { + defines += [ "BUNDLE_FRAMEWORK_POWER_MGR_ENABLE" ] + } + if (hicollie_enable) { + external_deps += [ "hicollie:libhicollie" ] + defines += [ "HICOLLIE_ENABLE" ] + } + + if (hisysevent_enable) { + sources += [ "${services_path}/bundlemgr/src/inner_event_report.cpp" ] + external_deps += [ "hisysevent:libhisysevent" ] + defines += [ "HISYSEVENT_ENABLE" ] + } + if (storage_service_enable) { + external_deps += [ "storage_service:storage_manager_sa_proxy" ] + defines += [ "STORAGE_SERVICE_ENABLE" ] + } + external_deps += [ "kv_store:distributeddata_inner" ] + configs += [ "../../../../../services/bundlemgr:rdb_config" ] + external_deps += [ "relational_store:native_rdb" ] + sources += [ + "${services_path}/bundlemgr/src/preinstall_data_storage_rdb.cpp", + "${services_path}/bundlemgr/src/rdb/bms_rdb_open_callback.cpp", + "${services_path}/bundlemgr/src/rdb/rdb_data_manager.cpp", + "${services_path}/bundlemgr/test/mock/src/bundle_data_storage_rdb.cpp", + ] + if (udmf_enabled) { + defines += [ "BUNDLE_FRAMEWORK_UDMF_ENABLED" ] + external_deps += [ "udmf:utd_client" ] + } + + if (bms_device_info_manager_part_enabled) { + external_deps += [ + "device_info_manager:distributed_device_profile_common", + "device_info_manager:distributed_device_profile_sdk", + ] + defines += [ "BMS_DEVICE_INFO_MANAGER_ENABLE" ] + } + defines += [ "BUNDLE_FRAMEWORK_BUNDLE_UTIL_RETURN_TRUE" ] + + public_external_deps = [ + "googletest:gmock_main", + "googletest:gtest_main", + ] +} + +group("unittest") { + testonly = true + + deps = [ ":BmsAccountConstraintTest" ] +} diff --git a/services/bundlemgr/test/unittest/bms_account_constraint_test/bms_account_constraint_test.cpp b/services/bundlemgr/test/unittest/bms_account_constraint_test/bms_account_constraint_test.cpp new file mode 100644 index 0000000000..ed65580656 --- /dev/null +++ b/services/bundlemgr/test/unittest/bms_account_constraint_test/bms_account_constraint_test.cpp @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#define private public +#define protected public + +#include +#include + +#include "app_provision_info_manager.h" +#include "base_bundle_installer.h" +#include "bundle_cache_mgr.h" +#include "bundle_clone_installer.h" +#include "bundle_data_mgr.h" +#include "bundle_mgr_service.h" +#include "bundle_multiuser_installer.h" +#include "bundle_sandbox_installer.h" +#include "data_group_info.h" +#include "hmp_bundle_installer.h" +#include "installd/installd_service.h" +#include "installd_client.h" +#include "parameters.h" +#include "plugin_installer.h" +#include "rdb_data_manager.h" +#include "scope_guard.h" + +using namespace testing::ext; +using namespace OHOS::AppExecFwk; +using OHOS::Parcel; + +namespace OHOS { +namespace { +} // namespace + +class BmsAccountConstraintTest : public testing::Test { +public: + BmsAccountConstraintTest(); + ~BmsAccountConstraintTest(); + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); + +private: + static std::shared_ptr bundleMgrService_; +}; + +std::shared_ptr BmsAccountConstraintTest::bundleMgrService_ = + DelayedSingleton::GetInstance(); + +BmsAccountConstraintTest::BmsAccountConstraintTest() +{} + +BmsAccountConstraintTest::~BmsAccountConstraintTest() +{} + +void BmsAccountConstraintTest::SetUpTestCase() +{} + +void BmsAccountConstraintTest::TearDownTestCase() +{ + bundleMgrService_->OnStop(); +} + +void BmsAccountConstraintTest::SetUp() +{ +} + +void BmsAccountConstraintTest::TearDown() +{ +} + +/** + * @tc.number: CheckOsAccountConstraintEnabled_0001 + * @tc.name: test InnerProcessBundleInstall + * @tc.desc: 1.Test InnerProcessBundleInstall the BaseBundleInstaller +*/ +HWTEST_F(BmsAccountConstraintTest, CheckOsAccountConstraintEnabled_0001, Function | MediumTest | Level1) +{ + BaseBundleInstaller installer; + installer.isAppExist_ = false; + InnerBundleInfo newInfo; + std::unordered_map newInfos; + newInfos.insert(std::make_pair("com.example.helloworld", newInfo)); + InnerBundleInfo oldInfo; + InstallParam installParam; + int32_t uid = 0; + auto ret = installer.InnerProcessBundleInstall(newInfos, oldInfo, installParam, uid); + EXPECT_EQ(ret, ERR_APPEXECFWK_INSTALL_FAILED_ACCOUNT_CONSTRAINT); +} + +/** + * @tc.number: CheckOsAccountConstraintEnabled_0002 + * @tc.name: test InnerProcessBundleInstall + * @tc.desc: 1.Test InnerProcessBundleInstall the BaseBundleInstaller +*/ +HWTEST_F(BmsAccountConstraintTest, CheckOsAccountConstraintEnabled_0002, Function | MediumTest | Level1) +{ + BaseBundleInstaller installer; + installer.isAppExist_ = true; + installer.userId_ = -3; + InnerBundleInfo newInfo; + std::unordered_map newInfos; + newInfos.insert(std::make_pair("com.example.helloworld", newInfo)); + InnerBundleInfo oldInfo; + InstallParam installParam; + int32_t uid = 0; + auto ret = installer.InnerProcessBundleInstall(newInfos, oldInfo, installParam, uid); + EXPECT_EQ(ret, ERR_APPEXECFWK_INSTALL_FAILED_ACCOUNT_CONSTRAINT); +} + +/** + * @tc.number: CheckOsAccountConstraintEnabled_0003 + * @tc.name: test ProcessBundleInstall + * @tc.desc: 1.Test ProcessBundleInstall the BundleMultiUserInstaller +*/ +HWTEST_F(BmsAccountConstraintTest, CheckOsAccountConstraintEnabled_0003, Function | MediumTest | Level1) +{ + BundleMultiUserInstaller installer; + installer.dataMgr_ = DelayedSingleton::GetInstance()->GetDataMgr(); + InnerBundleInfo info; + InnerBundleUserInfo userInfo; + info.AddInnerBundleUserInfo(userInfo); + installer.dataMgr_->bundleInfos_.emplace("com.example.helloworld", info); + auto ret = installer.ProcessBundleInstall("com.example.helloworld", 100); + EXPECT_EQ(ret, ERR_APPEXECFWK_INSTALL_FAILED_ACCOUNT_CONSTRAINT); +} +} // OHOS -- Gitee