diff --git a/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h b/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h index 58cf51a3f..fa1ac97fd 100644 --- a/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h +++ b/interfaces/inner_api/appexecfwk_base/include/appexecfwk_errors.h @@ -383,6 +383,10 @@ enum { // query errcode ERR_BUNDLE_MANAGER_NOT_APP_GALLERY_CALL = 8521250, + ERR_BUNDLE_MANAGER_GET_SYSTEM_ABILITY_FAILED = 8521251, + ERR_BUNDLE_MANAGER_GET_ALL_RUNNING_PROCESSES_FAILED = 8521252, + ERR_BUNDLE_MANAGER_DEVICE_USAGE_STATS_EMPTY = 8521253, + ERR_BUNDLE_MANAGER_ALL_BUNDLES_ARE_RUNNING = 8521254, // app jump interceptor ERR_BUNDLE_MANAGER_APP_JUMP_INTERCEPTOR_INTERNAL_ERROR = APPEXECFWK_BUNDLEMGR_ERR_OFFSET + 0x0701, // 8521473 diff --git a/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h b/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h index fca23aeee..4b111b530 100644 --- a/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h +++ b/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h @@ -174,6 +174,7 @@ enum class BundleMgrInterfaceCode : uint32_t { GET_CLONE_APP_INDEXES, GET_NAME_AND_APPINDEX_FOR_UID, QUERY_CLONE_EXTENSION_ABILITY_INFO_WITH_APP_INDEX, + AUTO_CLEAN_CACHE_BY_SIZE, }; /* SAID: 401-85 Interface No.85 subservice also provides the following interfaces */ diff --git a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h index c7d19636c..998f06a55 100644 --- a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h +++ b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h @@ -382,6 +382,13 @@ private: * @return Returns ERR_OK if called successfully; returns error code otherwise. */ ErrCode HandleGetPermissionDef(MessageParcel &data, MessageParcel &reply); + /** + * @brief Handles the CleanBundleCacheFilesAutomatic function called from a IBundleMgr proxy object. + * @param data Indicates the data to be read. + * @param reply Indicates the reply to be sent; + * @return Returns ERR_OK if called successfully; returns error code otherwise. + */ + ErrCode HandleCleanBundleCacheFilesAutomatic(MessageParcel &data, MessageParcel &reply); /** * @brief Handles the CleanBundleCacheFiles function called from a IBundleMgr proxy object. * @param data Indicates the data to be read. diff --git a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h index 4ce71975a..645faba40 100644 --- a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h +++ b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h @@ -690,6 +690,15 @@ public: { return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR; } + /** + * @brief Clears cache data of a specified size. + * @param cacheSize Indicates the size of the cache data is to be cleared. + * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise. + */ + virtual ErrCode CleanBundleCacheFilesAutomatic(uint64_t cacheSize) + { + return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR; + } /** * @brief Clears application running data of a specified application. * @param bundleName Indicates the bundle name of the application whose data is to be cleared. diff --git a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_proxy.h b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_proxy.h index 10f11ad18..87379cff1 100644 --- a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_proxy.h +++ b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_proxy.h @@ -501,6 +501,12 @@ public: * @return Returns ERR_OK if the PermissionDef object is successfully obtained; returns other ErrCode otherwise. */ virtual ErrCode GetPermissionDef(const std::string &permissionName, PermissionDef &permissionDef) override; + /** + * @brief Clears cache data of a specified size through the proxy object. + * @param cacheSize Indicates the size of the cache data is to be cleared. + * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise. + */ + virtual ErrCode CleanBundleCacheFilesAutomatic(uint64_t cacheSize) override; /** * @brief Clears cache data of a specified application through the proxy object. * @param bundleName Indicates the bundle name of the application whose cache data is to be cleared. diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp index a76ea9a4a..8f740b305 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp @@ -158,6 +158,8 @@ void BundleMgrHost::init() &BundleMgrHost::HandleGetLaunchWantForBundle); funcMap_.emplace(static_cast(BundleMgrInterfaceCode::GET_PERMISSION_DEF), &BundleMgrHost::HandleGetPermissionDef); + funcMap_.emplace(static_cast(BundleMgrInterfaceCode::AUTO_CLEAN_CACHE_BY_SIZE), + &BundleMgrHost::HandleCleanBundleCacheFilesAutomatic); funcMap_.emplace(static_cast(BundleMgrInterfaceCode::CLEAN_BUNDLE_CACHE_FILES), &BundleMgrHost::HandleCleanBundleCacheFiles); funcMap_.emplace(static_cast(BundleMgrInterfaceCode::CREATE_BUNDLE_DATA_DIR), @@ -1400,6 +1402,20 @@ ErrCode BundleMgrHost::HandleGetPermissionDef(MessageParcel &data, MessageParcel return ERR_OK; } +ErrCode BundleMgrHost::HandleCleanBundleCacheFilesAutomatic(MessageParcel &data, MessageParcel &reply) +{ + HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); + + uint64_t cacheSize = data.ReadUint64(); + ErrCode ret = CleanBundleCacheFilesAutomatic(cacheSize); + + if (!reply.WriteInt32(ret)) { + APP_LOGE("WriteInt32 failed"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + return ERR_OK; +} + ErrCode BundleMgrHost::HandleCleanBundleCacheFiles(MessageParcel &data, MessageParcel &reply) { HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp index bdf8f6fd1..167fd7bfe 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp @@ -1619,6 +1619,34 @@ ErrCode BundleMgrProxy::GetPermissionDef(const std::string &permissionName, Perm BundleMgrInterfaceCode::GET_PERMISSION_DEF, data, permissionDef); } +ErrCode BundleMgrProxy::CleanBundleCacheFilesAutomatic(uint64_t cacheSize) +{ + HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); + APP_LOGI("begin to CleanBundleCacheFilesAutomatic cache size of %{public}llu", cacheSize); + + if (cacheSize == 0) { + APP_LOGE("parameter error, cache size must be greater than 0"); + return ERR_BUNDLE_MANAGER_INVALID_PARAMETER; + } + + MessageParcel data; + if (!data.WriteInterfaceToken(GetDescriptor())) { + APP_LOGE("fail to CleanBundleCacheFilesAutomatic due to write InterfaceToken fail"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + if (!data.WriteUint64(cacheSize)) { + APP_LOGE("fail to CleanBundleCacheFilesAutomatic due to write cache size fail"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + + MessageParcel reply; + if (!SendTransactCmd(BundleMgrInterfaceCode::AUTO_CLEAN_CACHE_BY_SIZE, data, reply)) { + APP_LOGE("fail to CleanBundleCacheFilesAutomatic from server"); + return ERR_BUNDLE_MANAGER_IPC_TRANSACTION; + } + return reply.ReadInt32(); +} + ErrCode BundleMgrProxy::CleanBundleCacheFiles( const std::string &bundleName, const sptr cleanCacheCallback, int32_t userId) { diff --git a/services/bundlemgr/include/bundle_mgr_host_impl.h b/services/bundlemgr/include/bundle_mgr_host_impl.h index cfa79aad3..7220c0201 100644 --- a/services/bundlemgr/include/bundle_mgr_host_impl.h +++ b/services/bundlemgr/include/bundle_mgr_host_impl.h @@ -488,6 +488,12 @@ public: * @return Returns true if the PermissionDef object is successfully obtained; returns false otherwise. */ virtual ErrCode GetPermissionDef(const std::string &permissionName, PermissionDef &permissionDef) override; + /** + * @brief Clears cache data of a specified size. + * @param cacheSize Indicates the size of the cache data is to be cleared. + * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise. + */ + virtual ErrCode CleanBundleCacheFilesAutomatic(uint64_t cacheSize) override; /** * @brief Clears cache data of a specified application. * @param bundleName Indicates the bundle name of the application whose cache data is to be cleared. @@ -967,6 +973,11 @@ private: bool VerifyDependency(const std::string &sharedBundleName); void CleanBundleCacheTask(const std::string &bundleName, const sptr cleanCacheCallback, const std::shared_ptr &dataMgr, int32_t userId); + ErrCode CleanBundleCacheFilesGetCleanSize(const std::string &bundleName, + int32_t userId, uint64_t &cleanCacheSize); + void CleanBundleCacheTaskGetCleanSize(const std::string &bundleName, + const std::shared_ptr &dataMgr, + int32_t userId, uint64_t &cleanCacheSize); void NotifyBundleStatus(const NotifyBundleEvents &installRes); ErrCode GetBundleArchiveInfoBySandBoxPath( const std::string &hapFilePath, int32_t flags, BundleInfo &bundleInfo, bool fromV9 = false); diff --git a/services/bundlemgr/include/bundle_util.h b/services/bundlemgr/include/bundle_util.h index ae3c78e43..5148f4886 100644 --- a/services/bundlemgr/include/bundle_util.h +++ b/services/bundlemgr/include/bundle_util.h @@ -176,6 +176,8 @@ public: static bool EndWith(const std::string &source, const std::string &suffix); static int64_t GetFileSize(const std::string &filePath); static int64_t CalculateFileSize(const std::string &bundlePath); + static void GetTotalSizeOfFiles(const std::string& path, off_t &totalSize); + static uint64_t GetTotalSizeOfFilesInDirectory(const std::string& directoryPath); static std::string CreateTempDir(const std::string &tempDir); static std::string CopyFileToSecurityDir(const std::string &filePath, const DirType &dirType, std::vector &toDeletePaths); diff --git a/services/bundlemgr/src/bundle_mgr_host_impl.cpp b/services/bundlemgr/src/bundle_mgr_host_impl.cpp index 52f2398f7..a19b29891 100644 --- a/services/bundlemgr/src/bundle_mgr_host_impl.cpp +++ b/services/bundlemgr/src/bundle_mgr_host_impl.cpp @@ -49,6 +49,11 @@ #include "json_serializer.h" #include "scope_guard.h" #include "system_ability_definition.h" +#include "app_mgr_interface.h" +#include "system_ability_helper.h" +#include "running_process_info.h" +#include "bundle_active_client.h" +#include "bundle_active_period_stats.h" namespace OHOS { namespace AppExecFwk { @@ -1243,6 +1248,193 @@ ErrCode BundleMgrHostImpl::GetPermissionDef(const std::string &permissionName, P return BundlePermissionMgr::GetPermissionDef(permissionName, permissionDef); } +ErrCode BundleMgrHostImpl::CleanBundleCacheFilesAutomatic(uint64_t cacheSize) +{ + APP_LOGI("start CleanBundleCacheFilesAutomatic, cacheSize : %{public}llu", cacheSize); + + if (cacheSize == 0) { + APP_LOGE("parameter error, cache size must be greater than 0"); + return ERR_BUNDLE_MANAGER_INVALID_PARAMETER; + } + + if (!BundlePermissionMgr::VerifyCallingPermissionForAll(Constants::PERMISSION_REMOVECACHEFILE)) { + APP_LOGE("ohos.permission.REMOVE_CACHE_FILES permission denied"); + return ERR_BUNDLE_MANAGER_PERMISSION_DENIED; + } + + // Get current active userId + int32_t currentUserId = AccountHelper::GetCurrentActiveUserId(); + APP_LOGI("current active userId is %{public}d", currentUserId); + if (currentUserId == Constants::INVALID_USERID) { + APP_LOGE("currentUserId %{public}d is invalid", currentUserId); + return ERR_BUNDLE_MANAGER_INVALID_USER_ID; + } + + // Get apps use time under the current active user + int64_t startTime = 0; + int64_t endTime = BundleUtil::GetCurrentTimeMs(); + const int32_t PERIOD_ANNUALLY = 4; // 4 is the number of the period ANN + std::vector useStats; + DeviceUsageStats::BundleActiveClient::GetInstance().QueryBundleStatsInfoByInterval( + useStats, PERIOD_ANNUALLY, startTime, endTime, currentUserId); + + if (useStats.empty()) { + APP_LOGE("useStats under the current active user is empty"); + return ERR_BUNDLE_MANAGER_DEVICE_USAGE_STATS_EMPTY; + } + + // Sort apps use time from small to large under the current active user + std::sort(useStats.begin(), useStats.end(), + [](DeviceUsageStats::BundleActivePackageStats a, + DeviceUsageStats::BundleActivePackageStats b) { + return a.totalInFrontTime_ < b.totalInFrontTime_; + }); + + // Get all running apps + sptr appMgrProxy = + iface_cast(SystemAbilityHelper::GetSystemAbility(APP_MGR_SERVICE_ID)); + if (appMgrProxy == nullptr) { + APP_LOGE("fail to find the app mgr service to check app is running"); + return ERR_BUNDLE_MANAGER_GET_SYSTEM_ABILITY_FAILED; + } + + std::vector runningList; + int result = appMgrProxy->GetAllRunningProcesses(runningList); + if (result != ERR_OK) { + APP_LOGE("GetAllRunningProcesses failed."); + return ERR_BUNDLE_MANAGER_GET_ALL_RUNNING_PROCESSES_FAILED; + } + + std::unordered_set runningSet; + for (const auto &info : runningList) { + runningSet.insert(info.bundleNames.begin(), info.bundleNames.end()); + } + + uint32_t notRunningSum = 0; // The total amount of application that is not running + uint64_t cleanCacheSum = 0; // The total amount of application cache currently cleaned + for (auto useStat : useStats) { + if (runningSet.find(useStat.bundleName_) == runningSet.end()) { + notRunningSum++; + uint64_t cleanCacheSize = 0; // The cache size of a single application cleaned up + ErrCode ret = CleanBundleCacheFilesGetCleanSize(useStat.bundleName_, currentUserId, cleanCacheSize); + if (ret != ERR_OK) { + return ret; + } + cleanCacheSum += cleanCacheSize; + if (cleanCacheSum >= cacheSize) { + return ERR_OK; + } + } + } + + if (notRunningSum == 0) { + APP_LOGE("All apps are running under the current active user"); + return ERR_BUNDLE_MANAGER_ALL_BUNDLES_ARE_RUNNING; + } + + return ERR_OK; +} + +ErrCode BundleMgrHostImpl::CleanBundleCacheFilesGetCleanSize(const std::string &bundleName, + int32_t userId, uint64_t &cleanCacheSize) +{ + APP_LOGI("start CleanBundleCacheFilesGetCleanSize, bundleName : %{public}s, userId : %{public}d", + bundleName.c_str(), userId); + + if (!BundlePermissionMgr::IsSystemApp()) { + APP_LOGE("non-system app calling system api"); + return ERR_BUNDLE_MANAGER_SYSTEM_API_DENIED; + } + + if (userId < 0) { + APP_LOGE("userId is invalid"); + EventReport::SendCleanCacheSysEvent(bundleName, userId, true, true); + return ERR_BUNDLE_MANAGER_INVALID_USER_ID; + } + + if (bundleName.empty()) { + APP_LOGE("the bundleName empty"); + EventReport::SendCleanCacheSysEvent(bundleName, userId, true, true); + return ERR_BUNDLE_MANAGER_PARAM_ERROR; + } + + ApplicationInfo applicationInfo; + auto dataMgr = GetDataMgrFromService(); + if (dataMgr == nullptr) { + APP_LOGE("DataMgr is nullptr"); + EventReport::SendCleanCacheSysEvent(bundleName, userId, true, true); + return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR; + } + + auto ret = dataMgr->GetApplicationInfoWithResponseId(bundleName, + static_cast(GetApplicationFlag::GET_APPLICATION_INFO_WITH_DISABLE), userId, applicationInfo); + if (ret != ERR_OK) { + APP_LOGE("can not get application info of %{public}s", bundleName.c_str()); + EventReport::SendCleanCacheSysEvent(bundleName, userId, true, true); + return ret; + } + + if (!applicationInfo.userDataClearable) { + APP_LOGE("can not clean cacheFiles of %{public}s due to userDataClearable is false", bundleName.c_str()); + EventReport::SendCleanCacheSysEvent(bundleName, userId, true, true); + return ERR_BUNDLE_MANAGER_CAN_NOT_CLEAR_USER_DATA; + } + + CleanBundleCacheTaskGetCleanSize(bundleName, dataMgr, userId, cleanCacheSize); + return ERR_OK; +} + +void BundleMgrHostImpl::CleanBundleCacheTaskGetCleanSize(const std::string &bundleName, + const std::shared_ptr &dataMgr, + int32_t userId, uint64_t &cleanCacheSize) +{ + std::vector rootDir; + for (const auto &el : ServiceConstants::BUNDLE_EL) { + std::string dataDir = ServiceConstants::BUNDLE_APP_DATA_BASE_DIR + el + + ServiceConstants::PATH_SEPARATOR + std::to_string(userId) + ServiceConstants::BASE + bundleName; + rootDir.emplace_back(dataDir); + } + + auto cleanCache = [bundleName, userId, &cleanCacheSize, rootDir, dataMgr, this]() { + std::vector caches; + for (const auto &st : rootDir) { + std::vector cache; + if (InstalldClient::GetInstance()->GetBundleCachePath(st, cache) != ERR_OK) { + APP_LOGE("GetBundleCachePath failed, path: %{public}s", st.c_str()); + } + std::copy(cache.begin(), cache.end(), std::back_inserter(caches)); + } + + bool succeed = true; + if (!caches.empty()) { + for (const auto& cache : caches) { + cleanCacheSize += BundleUtil::GetTotalSizeOfFilesInDirectory(cache); + ErrCode ret = InstalldClient::GetInstance()->CleanBundleDataDir(cache); + if (ret != ERR_OK) { + APP_LOGE("CleanBundleDataDir failed, path: %{private}s", cache.c_str()); + succeed = false; + } + } + } + EventReport::SendCleanCacheSysEvent(bundleName, userId, true, !succeed); + APP_LOGE("CleanBundleCacheFiles with succeed %{public}d", succeed); + InnerBundleUserInfo innerBundleUserInfo; + if (!this->GetBundleUserInfo(bundleName, userId, innerBundleUserInfo)) { + APP_LOGE("Get calling userInfo in bundle(%{public}s) failed", bundleName.c_str()); + return; + } + NotifyBundleEvents installRes = { + .bundleName = bundleName, + .resultCode = ERR_OK, + .type = NotifyType::BUNDLE_CACHE_CLEARED, + .uid = innerBundleUserInfo.uid, + .accessTokenId = innerBundleUserInfo.accessTokenId + }; + NotifyBundleStatus(installRes); + }; + ffrt::submit(cleanCache); +} + ErrCode BundleMgrHostImpl::CleanBundleCacheFiles( const std::string &bundleName, const sptr cleanCacheCallback, int32_t userId) diff --git a/services/bundlemgr/src/bundle_util.cpp b/services/bundlemgr/src/bundle_util.cpp index 05b7951ff..c587592bb 100644 --- a/services/bundlemgr/src/bundle_util.cpp +++ b/services/bundlemgr/src/bundle_util.cpp @@ -703,6 +703,46 @@ int64_t BundleUtil::GetFileSize(const std::string &filePath) return fileInfo.st_size; } +void BundleUtil::GetTotalSizeOfFiles(const std::string& path, off_t &totalSize) +{ + struct stat fileStat; + if (stat(path.c_str(), &fileStat) == 0) { + if (S_ISREG(fileStat.st_mode)) { + totalSize += fileStat.st_size; + } else if (S_ISDIR(fileStat.st_mode)) { + totalSize += GetTotalSizeOfFilesInDirectory(path); + } + } else { + APP_LOGE("Error getting information for file/directory: %{public}s", path.c_str()); + } +} + +uint64_t BundleUtil::GetTotalSizeOfFilesInDirectory(const std::string& directoryPath) +{ + DIR* dir; + struct dirent* ent; + off_t totalSize = 0; + + APP_LOGI("GetTotalSizeOfFilesInDirectory directoryPath: %{public}s", directoryPath.c_str()); + + if ((dir = opendir(directoryPath.c_str())) != NULL) { + while ((ent = readdir(dir)) != NULL) { + std::string path = directoryPath + "/" + ent->d_name; + + if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) { + continue; + } + + GetTotalSizeOfFiles(path, totalSize); + } + closedir(dir); + } else { + APP_LOGE("opendir failed, path: %{public}s", directoryPath.c_str()); + } + + return static_cast(totalSize); +} + std::string BundleUtil::CopyFileToSecurityDir(const std::string &filePath, const DirType &dirType, std::vector &toDeletePaths) { diff --git a/services/bundlemgr/test/unittest/bms_ability_manager_helper_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_ability_manager_helper_test/BUILD.gn index 9ce5f789e..44f98b6b0 100644 --- a/services/bundlemgr/test/unittest/bms_ability_manager_helper_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_ability_manager_helper_test/BUILD.gn @@ -53,6 +53,7 @@ ohos_unittest("BmsAbilityManagerHelperTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_bundle_accesstokenid_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_accesstokenid_test/BUILD.gn index d87db29c0..20a3505b6 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_accesstokenid_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_accesstokenid_test/BUILD.gn @@ -75,6 +75,7 @@ ohos_unittest("BmsBundleAccessTokenIdTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_aot_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_aot_test/BUILD.gn index 640337642..81f4112ad 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_aot_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_aot_test/BUILD.gn @@ -63,6 +63,7 @@ ohos_unittest("BmsAOTMgrTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_app_control_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_app_control_test/BUILD.gn index 6ad33ec00..b61b6eb28 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_app_control_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_app_control_test/BUILD.gn @@ -67,6 +67,7 @@ ohos_unittest("BmsBundleAppControlTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -216,6 +217,7 @@ ohos_unittest("BmsBundleMockAppControlTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_app_provision_info_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_app_provision_info_test/BUILD.gn index 7dd7cdc28..243de7e8d 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_app_provision_info_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_app_provision_info_test/BUILD.gn @@ -65,6 +65,7 @@ ohos_unittest("BmsBundleAppProvisionInfoTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_clone_app_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_clone_app_test/BUILD.gn index 6f09b4396..28075b542 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_clone_app_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_clone_app_test/BUILD.gn @@ -61,6 +61,7 @@ ohos_unittest("BmsBundleCloneAppBundleLogicTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", @@ -264,6 +265,7 @@ ohos_unittest("BmsBundleCloneAppIpcTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_common_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_common_test/BUILD.gn index 27b6f3268..04c23a7b8 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_common_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_common_test/BUILD.gn @@ -67,6 +67,7 @@ ohos_unittest("BmsBundleCommonTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_crowdtesting_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_crowdtesting_test/BUILD.gn index 435aba2e9..71e4c0b0d 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_crowdtesting_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_crowdtesting_test/BUILD.gn @@ -65,6 +65,7 @@ ohos_unittest("BmsBundleCrowdtestingTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_data_group_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_data_group_test/BUILD.gn index 94e31b304..2f6888132 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_data_group_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_data_group_test/BUILD.gn @@ -54,6 +54,7 @@ ohos_unittest("BmsBundleDataGroupTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_bundle_default_app_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_default_app_test/BUILD.gn index 2b69b8728..247d0c639 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_default_app_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_default_app_test/BUILD.gn @@ -63,6 +63,7 @@ ohos_unittest("BmsBundleDefaultAppTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_dependencies_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_dependencies_test/BUILD.gn index 4c9156e7b..2e8949a74 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_dependencies_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_dependencies_test/BUILD.gn @@ -66,6 +66,7 @@ ohos_unittest("BmsBundleDependenciesTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_hap_verify_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_hap_verify_test/BUILD.gn index dc8315344..a5c768841 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_hap_verify_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_hap_verify_test/BUILD.gn @@ -61,6 +61,7 @@ ohos_unittest("BmsBundleHapVerifyTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_hsp_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_hsp_test/BUILD.gn index b178bec88..2e6f78d5c 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_hsp_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_hsp_test/BUILD.gn @@ -68,6 +68,7 @@ ohos_unittest("BmsBundleHspTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -221,6 +222,7 @@ ohos_unittest("BmsBundleSharedLibraryInstallTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -369,6 +371,7 @@ ohos_unittest("BmsBundleSharedLibraryUninstallTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_installer_manager_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_installer_manager_test/BUILD.gn index c834c4171..a0b3ab986 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_installer_manager_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_installer_manager_test/BUILD.gn @@ -63,6 +63,7 @@ ohos_unittest("BmsBundleInstallerManagerTest") { external_deps = [ "ability_base:want", "ability_runtime:ability_manager", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_installer_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_installer_test/BUILD.gn index cff859631..7dbeb7271 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_installer_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_installer_test/BUILD.gn @@ -77,6 +77,7 @@ ohos_unittest("BmsBundleInstallerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -256,6 +257,7 @@ ohos_unittest("BmsBundleOtaUpdateTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -444,6 +446,7 @@ ohos_unittest("BmsMultipleBundleInstallerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -597,6 +600,7 @@ ohos_unittest("BmsBundleInstallIpcTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -743,6 +747,7 @@ ohos_unittest("BmsBundleInstallCheckerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", @@ -879,6 +884,7 @@ ohos_unittest("BmsBundleInstallDeviceTypeTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", @@ -1016,6 +1022,7 @@ ohos_unittest("BmsSystemBundleInstallerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", @@ -1185,6 +1192,7 @@ ohos_unittest("BmsBundleInstallDriverTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -1342,6 +1350,7 @@ ohos_unittest("BmsBundleAppServiceFwkInstallerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_installers_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_installers_test/BUILD.gn index 927611ac7..bcf460280 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_installers_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_installers_test/BUILD.gn @@ -56,6 +56,7 @@ ohos_unittest("BmsBundleInstallersTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_kit_service_base_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_kit_service_base_test/BUILD.gn index 61c3e29f1..4aa50fa16 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_kit_service_base_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_kit_service_base_test/BUILD.gn @@ -63,6 +63,7 @@ ohos_unittest("BmsBundleKitServiceBaseTest") { external_deps = [ "ability_base:want", "ability_runtime:ability_manager", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_kit_service_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_kit_service_test/BUILD.gn index 3f31a118d..2faaba344 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_kit_service_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_kit_service_test/BUILD.gn @@ -65,6 +65,7 @@ ohos_unittest("BmsBundleDataMgrTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -228,6 +229,7 @@ ohos_unittest("BmsBundleKitServiceTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -385,6 +387,7 @@ ohos_unittest("BmsBundleGetWindowPropertiesTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_manager_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_manager_test/BUILD.gn index f4d774fa9..ddd506afd 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_manager_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_manager_test/BUILD.gn @@ -61,6 +61,7 @@ ohos_unittest("BmsBundleManagerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_navigation_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_navigation_test/BUILD.gn index 9e3883928..d97cd79cd 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_navigation_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_navigation_test/BUILD.gn @@ -60,6 +60,7 @@ ohos_unittest("BmsBundleNavigationTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_overlay_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_overlay_test/BUILD.gn index 722db3445..315fbd59d 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_overlay_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_overlay_test/BUILD.gn @@ -74,6 +74,18 @@ ohos_unittest("BmsBundleOverlayCheckerTest") { "safwk:system_ability_fwk", "samgr:samgr_proxy", ] + + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + external_deps += bundle_install_external_deps if (code_signature_enable) { @@ -161,6 +173,17 @@ ohos_unittest("BmsBundleOverlayInfoTest") { "ipc:ipc_single", ] + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + if (bundle_framework_power_mgr_enable) { external_deps += aot_external_deps } @@ -249,6 +272,18 @@ ohos_unittest("BmsBundleOverlayIpcTest") { "safwk:system_ability_fwk", "samgr:samgr_proxy", ] + + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + external_deps += bundle_install_external_deps if (bundle_framework_power_mgr_enable) { @@ -364,6 +399,18 @@ ohos_unittest("BmsBundleManagerOverlayIpcTest") { "safwk:system_ability_fwk", "samgr:samgr_proxy", ] + + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + external_deps += bundle_install_external_deps if (bundle_framework_power_mgr_enable) { @@ -480,6 +527,18 @@ ohos_unittest("BmsBundleSetOverlayEnabledTest") { "safwk:system_ability_fwk", "samgr:samgr_proxy", ] + + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + external_deps += bundle_install_external_deps if (bundle_framework_power_mgr_enable) { @@ -596,6 +655,18 @@ ohos_unittest("BmsBundleGetOverlayModuleInfoTest") { "safwk:system_ability_fwk", "samgr:samgr_proxy", ] + + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + external_deps += bundle_install_external_deps if (bundle_framework_power_mgr_enable) { diff --git a/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/BUILD.gn index b56d10073..8bca44507 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/BUILD.gn @@ -79,6 +79,7 @@ ohos_unittest("BmsBundlePermissionDefListTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -243,6 +244,7 @@ ohos_unittest("BmsBundlePermissionGrantTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -405,6 +407,7 @@ ohos_unittest("BmsBundlePermissionFalseTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -573,6 +576,7 @@ ohos_unittest("BmsBundlePermissionStartFullTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -740,6 +744,7 @@ ohos_unittest("BmsBundlePermissionSyetemAppFalseTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -905,6 +910,7 @@ ohos_unittest("BmsBundlePermissionTokenTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -1061,6 +1067,7 @@ ohos_unittest("BmsBundlePermissionGetRequestTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_boot_scanner_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_boot_scanner_test/BUILD.gn index 08c4f07bc..5b2864ade 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_boot_scanner_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_boot_scanner_test/BUILD.gn @@ -63,6 +63,7 @@ ohos_unittest("BmsBundleQuickFixBootScannerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_deleter_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_deleter_test/BUILD.gn index 24ddeaed4..106685fbd 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_deleter_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_deleter_test/BUILD.gn @@ -65,6 +65,7 @@ ohos_unittest("BmsBundleQuickFixDeleterTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_manager_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_manager_test/BUILD.gn index 15d582bbb..28ea3e943 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_manager_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_manager_test/BUILD.gn @@ -63,6 +63,7 @@ ohos_unittest("BmsBundleQuickFixManagerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_mgr_rdb_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_mgr_rdb_test/BUILD.gn index 3724e59f8..255e501f2 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_mgr_rdb_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_mgr_rdb_test/BUILD.gn @@ -71,6 +71,7 @@ ohos_unittest("BmsBundleQuickFixMgrRdbTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_query_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_query_test/BUILD.gn index 7e23bf31b..3ad911c7b 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_query_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_query_test/BUILD.gn @@ -53,6 +53,7 @@ ohos_unittest("BmsBundleQuickFixQueryTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_switcher_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_switcher_test/BUILD.gn index 3d501849f..b4ecff1a5 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_switcher_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_switcher_test/BUILD.gn @@ -65,6 +65,7 @@ ohos_unittest("BmsBundleQuickFixSwitcherTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_test/BUILD.gn index 9e9da1e5f..1f8e659d4 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_quick_fix_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_quick_fix_test/BUILD.gn @@ -63,6 +63,7 @@ ohos_unittest("BmsBundleQuickFixTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_resource_manager_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_resource_manager_test/BUILD.gn index d7653f57f..0dbefe0b3 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_resource_manager_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_resource_manager_test/BUILD.gn @@ -64,6 +64,7 @@ ohos_unittest("BmsBundleResourceManagerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_resource_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_resource_test/BUILD.gn index a2b01e072..3aa90641d 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_resource_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_resource_test/BUILD.gn @@ -68,6 +68,7 @@ ohos_unittest("BmsBundleResourceTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_sandbox_app_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_sandbox_app_test/BUILD.gn index cfd45c4bc..1bef12583 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_sandbox_app_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_sandbox_app_test/BUILD.gn @@ -62,6 +62,7 @@ ohos_unittest("BmsSandboxAppTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", @@ -218,6 +219,7 @@ ohos_unittest("BmsSandboxRdbTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_uninstaller_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_uninstaller_test/BUILD.gn index 3dd8bf8b3..fc9ed9864 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_uninstaller_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_uninstaller_test/BUILD.gn @@ -77,6 +77,7 @@ ohos_unittest("BmsBundleUninstallerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_updater_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_updater_test/BUILD.gn index e611e551a..c7f9bb6df 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_updater_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_updater_test/BUILD.gn @@ -81,6 +81,7 @@ ohos_unittest("BmsBundleUpdaterTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_bundle_verifymanager_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_bundle_verifymanager_test/BUILD.gn index 881ee8b8c..be2ced188 100755 --- a/services/bundlemgr/test/unittest/bms_bundle_verifymanager_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_bundle_verifymanager_test/BUILD.gn @@ -64,6 +64,7 @@ ohos_unittest("BmsBundleVerifyManagerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_data_mgr_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_data_mgr_test/BUILD.gn index 42ad5c091..6b1b0d0ac 100644 --- a/services/bundlemgr/test/unittest/bms_data_mgr_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_data_mgr_test/BUILD.gn @@ -54,6 +54,7 @@ ohos_unittest("BmsDataMgrTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", @@ -177,6 +178,7 @@ ohos_unittest("BmsExtensionDataMgrTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_event_handler_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_event_handler_test/BUILD.gn index 61ed54de3..7af02357b 100644 --- a/services/bundlemgr/test/unittest/bms_event_handler_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_event_handler_test/BUILD.gn @@ -41,6 +41,7 @@ ohos_unittest("BmsEventHandlerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", @@ -150,6 +151,7 @@ ohos_unittest("BmsEventHandlerUnLockedTest") { deps += bundle_install_deps external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_extend_resource_manager_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_extend_resource_manager_test/BUILD.gn index 62d2d83ca..fb8f88fbe 100644 --- a/services/bundlemgr/test/unittest/bms_extend_resource_manager_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_extend_resource_manager_test/BUILD.gn @@ -66,6 +66,7 @@ ohos_unittest("BmsExtendResourceManagerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_installd_host_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_installd_host_test/BUILD.gn index 2cbac25b0..73e019611 100644 --- a/services/bundlemgr/test/unittest/bms_installd_host_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_installd_host_test/BUILD.gn @@ -62,6 +62,7 @@ ohos_unittest("BmsInstalldHostTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_rdb_data_manager_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_rdb_data_manager_test/BUILD.gn index f57b82ad1..d6ed81783 100755 --- a/services/bundlemgr/test/unittest/bms_rdb_data_manager_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_rdb_data_manager_test/BUILD.gn @@ -61,6 +61,7 @@ ohos_unittest("BmsRdbDataManagerTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/services/bundlemgr/test/unittest/bms_service_bundle_scan_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_service_bundle_scan_test/BUILD.gn index aa107b83e..69fdff4f8 100644 --- a/services/bundlemgr/test/unittest/bms_service_bundle_scan_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_service_bundle_scan_test/BUILD.gn @@ -51,6 +51,7 @@ ohos_unittest("BmsServiceBundleScanTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_service_startup_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_service_startup_test/BUILD.gn index dba0064eb..0b100e5f5 100644 --- a/services/bundlemgr/test/unittest/bms_service_startup_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_service_startup_test/BUILD.gn @@ -47,6 +47,7 @@ ohos_unittest("BmsServiceStartupTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appverify:libhapverify", diff --git a/services/bundlemgr/test/unittest/bms_syscap_tool_test/BUILD.gn b/services/bundlemgr/test/unittest/bms_syscap_tool_test/BUILD.gn index e00a53dde..af5b24017 100755 --- a/services/bundlemgr/test/unittest/bms_syscap_tool_test/BUILD.gn +++ b/services/bundlemgr/test/unittest/bms_syscap_tool_test/BUILD.gn @@ -55,6 +55,7 @@ ohos_unittest("BmsSyscapToolTest") { external_deps = [ "ability_base:want", + "ability_runtime:app_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", diff --git a/test/fuzztest/fuzztest_application/bundleinstalldhost_fuzzer/BUILD.gn b/test/fuzztest/fuzztest_application/bundleinstalldhost_fuzzer/BUILD.gn index e06ddbfa4..19e24a0a7 100644 --- a/test/fuzztest/fuzztest_application/bundleinstalldhost_fuzzer/BUILD.gn +++ b/test/fuzztest/fuzztest_application/bundleinstalldhost_fuzzer/BUILD.gn @@ -76,6 +76,18 @@ ohos_fuzztest("BundleInstalldHostFuzzTest") { "safwk:system_ability_fwk", "samgr:samgr_proxy", ] + + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + external_deps += bundle_install_external_deps if (bundle_framework_power_mgr_enable) { diff --git a/test/fuzztest/fuzztest_application/bundleinstallerhost_fuzzer/BUILD.gn b/test/fuzztest/fuzztest_application/bundleinstallerhost_fuzzer/BUILD.gn index 9a1d0f6c7..369636255 100644 --- a/test/fuzztest/fuzztest_application/bundleinstallerhost_fuzzer/BUILD.gn +++ b/test/fuzztest/fuzztest_application/bundleinstallerhost_fuzzer/BUILD.gn @@ -76,6 +76,18 @@ ohos_fuzztest("BundleInstallerHostFuzzTest") { "safwk:system_ability_fwk", "samgr:samgr_proxy", ] + + external_deps += [ + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "battery_manager:batterysrv_client", + "device_usage_statistics:usagestatsinner", + "display_manager:displaymgr", + "ffrt:libffrt", + "power_manager:powermgr_client", + "syscap_codec:syscap_interface_shared", + ] + external_deps += bundle_install_external_deps if (bundle_framework_power_mgr_enable) {