diff --git a/services/abilitymgr/abilitymgr.gni b/services/abilitymgr/abilitymgr.gni index a957ac0f72..ebec6ef7bb 100644 --- a/services/abilitymgr/abilitymgr.gni +++ b/services/abilitymgr/abilitymgr.gni @@ -49,7 +49,7 @@ abilityms_files = [ "src/extension_record/base_extension_record.cpp", "src/extension_record/extension_record_manager.cpp", "src/extension_running_timeout_monitor.cpp", - "src/bg_user_extension_monitor.cpp", + "src/background_user_extension_monitor.cpp", "src/extension_record/extension_record.cpp", "src/extension_record/extension_record_factory.cpp", "src/foreground_app_connection_manager/foreground_app_connection_manager.cpp", diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index 4d075a9ac0..650be5d474 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -3513,7 +3513,7 @@ private: void ReportPreventStartAbilityResult(const AppExecFwk::AbilityInfo &callerAbilityInfo, const AppExecFwk::AbilityInfo &abilityInfo); - void ReportBgUserExtensionEvent(const sptr &callerToken, + void ReportBackgroundUserExtensionEvent(const sptr &callerToken, const AppExecFwk::AbilityInfo &calleeAbilityInfo, int32_t targetUserId); void SetAbilityRequestSessionInfo(AbilityRequest &abilityRequest, AppExecFwk::ExtensionAbilityType extensionType); diff --git a/services/abilitymgr/include/bg_user_extension_monitor.h b/services/abilitymgr/include/background_user_extension_monitor.h similarity index 65% rename from services/abilitymgr/include/bg_user_extension_monitor.h rename to services/abilitymgr/include/background_user_extension_monitor.h index f0d040daff..c907d5bfcd 100644 --- a/services/abilitymgr/include/bg_user_extension_monitor.h +++ b/services/abilitymgr/include/background_user_extension_monitor.h @@ -13,8 +13,8 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_BG_USER_EXTENSION_MONITOR_H -#define OHOS_ABILITY_RUNTIME_BG_USER_EXTENSION_MONITOR_H +#ifndef OHOS_ABILITY_RUNTIME_BACKGROUND_USER_EXTENSION_MONITOR_H +#define OHOS_ABILITY_RUNTIME_BACKGROUND_USER_EXTENSION_MONITOR_H #include #include @@ -25,14 +25,14 @@ namespace OHOS { namespace AAFwk { -struct BgUserExtensionCallerInfo { +struct BackgroundUserExtensionCallerInfo { int32_t callerUid = 0; int32_t callerUserId = 0; std::string callerProcessName; std::string callerBundleName; }; -struct BgUserExtensionEvent { +struct BackgroundUserExtensionEvent { // Caller info int32_t callerUid = 0; std::string callerBundleName; @@ -45,13 +45,13 @@ struct BgUserExtensionEvent { int32_t cnt = 1; }; -class BgUserExtensionMonitor : public DelayedSingleton { - DECLARE_DELAYED_SINGLETON(BgUserExtensionMonitor) +class BackgroundUserExtensionMonitor : public DelayedSingleton { + DECLARE_DELAYED_SINGLETON(BackgroundUserExtensionMonitor) public: void StartMonitor(); void StopMonitor(); - void OnBgUserExtensionStarted(const BgUserExtensionCallerInfo &callerInfo, + void OnBackgroundUserExtensionStarted(const BackgroundUserExtensionCallerInfo &callerInfo, const std::string &calleeBundleName, const std::string &calleeProcessName, const std::string &extensionTypeName, const std::string &abilityName, int32_t calleeUid); @@ -59,20 +59,20 @@ public: void ReportCachedEvents(); private: - void AddOrUpdateEvent(const BgUserExtensionEvent &event); - bool IsDuplicateEvent(const BgUserExtensionEvent &event, - std::list::iterator &dupIter); + void AddOrUpdateEvent(const BackgroundUserExtensionEvent &event); + bool IsDuplicateEvent(const BackgroundUserExtensionEvent &event, + std::list::iterator &dupIter); void SubmitPeriodicTask(); std::mutex cacheMutex_; - std::list cachedEvents_; + std::list cachedEvents_; static constexpr int32_t HISEVENT_PARAM_COUNT = 7; static constexpr int32_t MAX_CACHED_EVENTS = 5; static constexpr int64_t REPORT_INTERVAL_MS = 2 * 60 * 60 * 1000; // 2 hours - static constexpr const char *PERIODIC_TASK_NAME = "BgUserExtensionPeriodicTask"; + static constexpr const char *PERIODIC_TASK_NAME = "BackgroundUserExtensionPeriodicTask"; }; } // namespace AAFwk } // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_BG_USER_EXTENSION_MONITOR_H +#endif // OHOS_ABILITY_RUNTIME_BACKGROUND_USER_EXTENSION_MONITOR_H diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 2a08e46551..37f276b502 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -55,7 +55,7 @@ #include "hitrace_meter.h" #include "hisysevent_report.h" #include "extension_running_timeout_monitor.h" -#include "bg_user_extension_monitor.h" +#include "background_user_extension_monitor.h" #include "insight_intent_execute_manager.h" #include "insight_intent_db_cache.h" #include "insight_intent_utils.h" @@ -475,7 +475,7 @@ bool AbilityManagerService::Init() modularObjectExtensionEventMgr_->SubscribeSysEventReceiver(); ReportDataPartitionUsageManager::SendReportDataPartitionUsageEvent(); DelayedSingleton::GetInstance()->StartMonitor(); - DelayedSingleton::GetInstance()->StartMonitor(); + DelayedSingleton::GetInstance()->StartMonitor(); #ifdef RESOURCE_SCHEDULE_SERVICE_ENABLE ResourceSchedule::ResSchedClient::GetInstance().InitKillReasonListener(); #endif @@ -606,7 +606,7 @@ void AbilityManagerService::InitStartupFlag() void AbilityManagerService::OnStop() { TAG_LOGI(AAFwkTag::ABILITYMGR, "stop"); - DelayedSingleton::GetInstance()->StopMonitor(); + DelayedSingleton::GetInstance()->StopMonitor(); #ifdef BGTASKMGR_CONTINUOUS_TASK_ENABLE std::unique_lock lock(bgtaskObserverMutex_); if (bgtaskObserver_) { @@ -4461,7 +4461,7 @@ int32_t AbilityManagerService::StartExtensionAbilityInner(const Want &want, cons } } if (eventInfo.errCode == ERR_OK) { - ReportBgUserExtensionEvent(callerToken, abilityInfo, validUserId); + ReportBackgroundUserExtensionEvent(callerToken, abilityInfo, validUserId); } ReportAbilityAssociatedStartInfoToRSS(abilityRequest.abilityInfo, RES_TYPE_EXTENSION_START_ABILITY, callerToken); return eventInfo.errCode; @@ -6156,7 +6156,7 @@ int32_t AbilityManagerService::ConnectLocalAbility(const Want &want, const int32 indirectCallerInfo); } if (ret == ERR_OK) { - ReportBgUserExtensionEvent(callerToken, abilityInfo, userId); + ReportBackgroundUserExtensionEvent(callerToken, abilityInfo, userId); } return ret; } @@ -15515,13 +15515,13 @@ void AbilityManagerService::ReportPreventStartAbilityResult(const AppExecFwk::Ab hisyseventReport->Report("AAFWK", "PREVENT_START_ABILITY", HISYSEVENT_BEHAVIOR); } -void AbilityManagerService::ReportBgUserExtensionEvent(const sptr &callerToken, +void AbilityManagerService::ReportBackgroundUserExtensionEvent(const sptr &callerToken, const AppExecFwk::AbilityInfo &calleeAbilityInfo, int32_t targetUserId) { if (JudgeMultiUserConcurrency(targetUserId)) { return; } - TAG_LOGI(AAFwkTag::ABILITYMGR, "report bg user extension event, targetUserId:%{public}d", targetUserId); + TAG_LOGI(AAFwkTag::ABILITYMGR, "report background user extension event, targetUserId:%{public}d", targetUserId); int32_t callerUid = IPCSkeleton::GetCallingUid(); int32_t callerUserId = callerUid / BASE_USER_RANGE; @@ -15551,14 +15551,14 @@ void AbilityManagerService::ReportBgUserExtensionEvent(const sptr } } - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); if (monitor != nullptr) { - AAFwk::BgUserExtensionCallerInfo callerInfo; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo; callerInfo.callerUid = callerUid; callerInfo.callerUserId = callerUserId; callerInfo.callerProcessName = callerProcessName; callerInfo.callerBundleName = callerBundleName; - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, calleeAbilityInfo.bundleName, calleeAbilityInfo.process, calleeAbilityInfo.extensionTypeName, calleeAbilityInfo.name, calleeAbilityInfo.applicationInfo.uid); diff --git a/services/abilitymgr/src/bg_user_extension_monitor.cpp b/services/abilitymgr/src/background_user_extension_monitor.cpp similarity index 73% rename from services/abilitymgr/src/bg_user_extension_monitor.cpp rename to services/abilitymgr/src/background_user_extension_monitor.cpp index b0b101d645..9e40dcbab9 100644 --- a/services/abilitymgr/src/bg_user_extension_monitor.cpp +++ b/services/abilitymgr/src/background_user_extension_monitor.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "bg_user_extension_monitor.h" +#include "background_user_extension_monitor.h" #include @@ -33,7 +33,7 @@ constexpr const char *ABILITY_NAME_KEY = "ABILITY_NAME"; constexpr const char *RUNNING_DURATION_KEY = "RUNNING_DURATION"; constexpr const char *STILL_ALIVE_KEY = "STILL_ALIVE"; constexpr const char *CNT_KEY = "CNT"; -constexpr const char *BG_START_EVENT_VALUE = "BG_USER_START_EVENT"; +constexpr const char *BACKGROUND_START_EVENT_VALUE = "BACKGROUND_USER_START_EVENT"; bool CopyStringParam(const std::string &str, std::vector> &buffers, std::vector &ptrs) @@ -48,7 +48,7 @@ bool CopyStringParam(const std::string &str, std::vector return true; } -std::string BuildJsonInfo(const BgUserExtensionEvent &event) +std::string BuildJsonInfo(const BackgroundUserExtensionEvent &event) { return std::string("{\"callerUid\":") + std::to_string(event.callerUid) + ",\"callerBundleName\":\"" + event.callerBundleName + "\"" + @@ -61,37 +61,38 @@ std::string BuildJsonInfo(const BgUserExtensionEvent &event) } } -BgUserExtensionMonitor::BgUserExtensionMonitor() {} +BackgroundUserExtensionMonitor::BackgroundUserExtensionMonitor() {} -BgUserExtensionMonitor::~BgUserExtensionMonitor() {} +BackgroundUserExtensionMonitor::~BackgroundUserExtensionMonitor() {} -void BgUserExtensionMonitor::StartMonitor() +void BackgroundUserExtensionMonitor::StartMonitor() { - TAG_LOGI(AAFwkTag::ABILITYMGR, "start bg user extension monitor"); + TAG_LOGI(AAFwkTag::ABILITYMGR, "start background user extension monitor"); SubmitPeriodicTask(); } -void BgUserExtensionMonitor::StopMonitor() +void BackgroundUserExtensionMonitor::StopMonitor() { - TAG_LOGI(AAFwkTag::ABILITYMGR, "stop bg user extension monitor"); + TAG_LOGI(AAFwkTag::ABILITYMGR, "stop background user extension monitor"); auto taskHandler = TaskHandlerWrap::GetFfrtHandler(); if (taskHandler != nullptr) { taskHandler->CancelTask(PERIODIC_TASK_NAME); } } -void BgUserExtensionMonitor::OnBgUserExtensionStarted(const BgUserExtensionCallerInfo &callerInfo, +void BackgroundUserExtensionMonitor::OnBackgroundUserExtensionStarted( + const BackgroundUserExtensionCallerInfo &callerInfo, const std::string &calleeBundleName, const std::string &calleeProcessName, const std::string &extensionTypeName, const std::string &abilityName, int32_t calleeUid) { TAG_LOGI(AAFwkTag::ABILITYMGR, - "bg user extension started, type:%{public}s, callerUid:%{public}d, callerBundle:%{public}s, " + "background user extension started, type:%{public}s, callerUid:%{public}d, callerBundle:%{public}s, " "calleeBundle:%{public}s, ability:%{public}s, calleeUid:%{public}d", extensionTypeName.c_str(), callerInfo.callerUid, callerInfo.callerBundleName.c_str(), calleeBundleName.c_str(), abilityName.c_str(), calleeUid); - BgUserExtensionEvent event; + BackgroundUserExtensionEvent event; event.callerUid = callerInfo.callerUid; event.callerBundleName = callerInfo.callerBundleName; event.calleeBundleName = calleeBundleName; @@ -104,7 +105,7 @@ void BgUserExtensionMonitor::OnBgUserExtensionStarted(const BgUserExtensionCalle AddOrUpdateEvent(event); } -void BgUserExtensionMonitor::SubmitPeriodicTask() +void BackgroundUserExtensionMonitor::SubmitPeriodicTask() { auto taskHandler = TaskHandlerWrap::GetFfrtHandler(); if (taskHandler == nullptr) { @@ -113,21 +114,21 @@ void BgUserExtensionMonitor::SubmitPeriodicTask() } auto task = []() { - TAG_LOGI(AAFwkTag::ABILITYMGR, "bg user extension periodic task triggered"); - auto monitor = DelayedSingleton::GetInstance(); + TAG_LOGI(AAFwkTag::ABILITYMGR, "background user extension periodic task triggered"); + auto monitor = DelayedSingleton::GetInstance(); monitor->ReportCachedEvents(); monitor->SubmitPeriodicTask(); }; taskHandler->SubmitTask(task, PERIODIC_TASK_NAME, REPORT_INTERVAL_MS); } -void BgUserExtensionMonitor::ReportCachedEvents() +void BackgroundUserExtensionMonitor::ReportCachedEvents() { - std::list eventsToReport; + std::list eventsToReport; { std::lock_guard lock(cacheMutex_); if (cachedEvents_.empty()) { - TAG_LOGD(AAFwkTag::ABILITYMGR, "no bg user extension events to report"); + TAG_LOGD(AAFwkTag::ABILITYMGR, "no background user extension events to report"); return; } eventsToReport = cachedEvents_; @@ -138,9 +139,9 @@ void BgUserExtensionMonitor::ReportCachedEvents() std::vector extensionTypePtrs; std::vector bundleNamePtrs; - // EXTENSION_TYPE is fixed to "BG_START_EVENT" with length 1 - if (!CopyStringParam(BG_START_EVENT_VALUE, stringBuffers, extensionTypePtrs)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "strcpy_s failed for BG_START_EVENT"); + // EXTENSION_TYPE is fixed to "BACKGROUND_START_EVENT" with length 1 + if (!CopyStringParam(BACKGROUND_START_EVENT_VALUE, stringBuffers, extensionTypePtrs)) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "strcpy_s failed for BACKGROUND_START_EVENT"); return; } @@ -169,12 +170,12 @@ void BgUserExtensionMonitor::ReportCachedEvents() report.InsertParam(STILL_ALIVE_KEY, emptyBoolArray); report.InsertParam(CNT_KEY, emptyInt32Array); int32_t ret = report.Report(DOMAIN, EVENT_NAME, HISYSEVENT_STATISTIC); - TAG_LOGI(AAFwkTag::ABILITYMGR, "reported %{public}zu bg user extension events, ret: %{public}d", + TAG_LOGI(AAFwkTag::ABILITYMGR, "reported %{public}zu background user extension events, ret: %{public}d", eventsToReport.size(), ret); } -bool BgUserExtensionMonitor::IsDuplicateEvent(const BgUserExtensionEvent &event, - std::list::iterator &dupIter) +bool BackgroundUserExtensionMonitor::IsDuplicateEvent(const BackgroundUserExtensionEvent &event, + std::list::iterator &dupIter) { for (auto it = cachedEvents_.begin(); it != cachedEvents_.end(); ++it) { if (it->calleeExtensionTypeName == event.calleeExtensionTypeName && @@ -186,9 +187,9 @@ bool BgUserExtensionMonitor::IsDuplicateEvent(const BgUserExtensionEvent &event, return false; } -void BgUserExtensionMonitor::AddOrUpdateEvent(const BgUserExtensionEvent &event) +void BackgroundUserExtensionMonitor::AddOrUpdateEvent(const BackgroundUserExtensionEvent &event) { - std::list::iterator dupIter; + std::list::iterator dupIter; if (IsDuplicateEvent(event, dupIter)) { dupIter->cnt++; dupIter->callerUid = event.callerUid; @@ -196,7 +197,7 @@ void BgUserExtensionMonitor::AddOrUpdateEvent(const BgUserExtensionEvent &event) dupIter->calleeBundleName = event.calleeBundleName; dupIter->calleeUid = event.calleeUid; TAG_LOGD(AAFwkTag::ABILITYMGR, - "updated existing bg user extension event for %{public}s, cnt: %{public}d", + "updated existing background user extension event for %{public}s, cnt: %{public}d", event.calleeAbilityName.c_str(), dupIter->cnt); return; } @@ -210,7 +211,7 @@ void BgUserExtensionMonitor::AddOrUpdateEvent(const BgUserExtensionEvent &event) cachedEvents_.push_back(event); TAG_LOGD(AAFwkTag::ABILITYMGR, - "added new bg user extension event for %{public}s, cache size: %{public}zu", + "added new background user extension event for %{public}s, cache size: %{public}zu", event.calleeAbilityName.c_str(), cachedEvents_.size()); } diff --git a/test/moduletest/ability_timeout_module_test/BUILD.gn b/test/moduletest/ability_timeout_module_test/BUILD.gn index 2256fc753f..a513ac2998 100644 --- a/test/moduletest/ability_timeout_module_test/BUILD.gn +++ b/test/moduletest/ability_timeout_module_test/BUILD.gn @@ -30,7 +30,7 @@ ohos_moduletest("ability_timeout_module_test") { "${ability_runtime_services_path}/abilitymgr/src/ability_bundle_event_callback.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_cache_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_manager_service.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/app_exit_reason_data_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/assert_fault_callback_death_mgr.cpp", "${ability_runtime_services_path}/abilitymgr/src/assert_fault_proxy.cpp", diff --git a/test/moduletest/running_infos_module_test/BUILD.gn b/test/moduletest/running_infos_module_test/BUILD.gn index 70a3ab062f..10fb8b0094 100644 --- a/test/moduletest/running_infos_module_test/BUILD.gn +++ b/test/moduletest/running_infos_module_test/BUILD.gn @@ -31,7 +31,7 @@ ohos_moduletest("running_infos_module_test") { "${ability_runtime_services_path}/abilitymgr/src/ability_bundle_event_callback.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_cache_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_manager_service.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/app_exit_reason_data_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/assert_fault_callback_death_mgr.cpp", "${ability_runtime_services_path}/abilitymgr/src/assert_fault_proxy.cpp", diff --git a/test/unittest/ability_manager_service_first_test/abilitymgr.gni b/test/unittest/ability_manager_service_first_test/abilitymgr.gni index 9f269531f3..d11350c825 100644 --- a/test/unittest/ability_manager_service_first_test/abilitymgr.gni +++ b/test/unittest/ability_manager_service_first_test/abilitymgr.gni @@ -44,7 +44,7 @@ abilityms_files = [ "${ability_runtime_services_path}/abilitymgr/src/extension_record/base_extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_timeout_monitor.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/foreground_app_connection_manager/foreground_app_connection_manager.cpp", diff --git a/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn b/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn index 19d5f34816..975b7a59d7 100644 --- a/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn +++ b/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn @@ -124,7 +124,7 @@ ohos_unittest("ability_manager_service_fourteenth_test") { "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_timeout_monitor.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/foreground_app_connection_manager/foreground_app_connection_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/free_install_observer_manager.cpp", diff --git a/test/unittest/ability_manager_service_second_test/BUILD.gn b/test/unittest/ability_manager_service_second_test/BUILD.gn index 83dc074e21..b5e71a009b 100644 --- a/test/unittest/ability_manager_service_second_test/BUILD.gn +++ b/test/unittest/ability_manager_service_second_test/BUILD.gn @@ -126,7 +126,7 @@ ohos_unittest("ability_manager_service_second_test") { "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_timeout_monitor.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/foreground_app_connection_manager/foreground_app_connection_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/free_install_observer_manager.cpp", diff --git a/test/unittest/ability_manager_service_sixth_test/abilitymgr.gni b/test/unittest/ability_manager_service_sixth_test/abilitymgr.gni index e7ecb74d6b..04c9a15dce 100644 --- a/test/unittest/ability_manager_service_sixth_test/abilitymgr.gni +++ b/test/unittest/ability_manager_service_sixth_test/abilitymgr.gni @@ -44,7 +44,7 @@ abilityms_files = [ "${ability_runtime_services_path}/abilitymgr/src/extension_record/base_extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_timeout_monitor.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/foreground_app_connection_manager/foreground_app_connection_manager.cpp", diff --git a/test/unittest/ability_manager_service_third_test/abilitymgr.gni b/test/unittest/ability_manager_service_third_test/abilitymgr.gni index 09494859de..bb4b482dfe 100644 --- a/test/unittest/ability_manager_service_third_test/abilitymgr.gni +++ b/test/unittest/ability_manager_service_third_test/abilitymgr.gni @@ -44,7 +44,7 @@ abilityms_files = [ "${ability_runtime_services_path}/abilitymgr/src/extension_record/base_extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_timeout_monitor.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/foreground_app_connection_manager/foreground_app_connection_manager.cpp", diff --git a/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn b/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn index cd7042eef1..a8fa9baae3 100644 --- a/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn +++ b/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn @@ -124,7 +124,7 @@ ohos_unittest("ability_manager_service_thirteenth_test") { "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_timeout_monitor.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/foreground_app_connection_manager/foreground_app_connection_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/free_install_observer_manager.cpp", diff --git a/test/unittest/ui_extension/extension_record_manager_second_test/BUILD.gn b/test/unittest/ui_extension/extension_record_manager_second_test/BUILD.gn index e52e5bedc8..1973e5c704 100644 --- a/test/unittest/ui_extension/extension_record_manager_second_test/BUILD.gn +++ b/test/unittest/ui_extension/extension_record_manager_second_test/BUILD.gn @@ -49,7 +49,7 @@ ohos_unittest("extension_record_manager_second_test") { "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_record/extension_record_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_timeout_monitor.cpp", - "${ability_runtime_services_path}/abilitymgr/src/bg_user_extension_monitor.cpp", + "${ability_runtime_services_path}/abilitymgr/src/background_user_extension_monitor.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_config.cpp", "${ability_runtime_services_path}/common/src/ffrt_task_handler_wrap.cpp", "${ability_runtime_services_path}/common/src/hisysevent_report.cpp", diff --git a/test/unittest/ui_extension/extension_record_manager_second_test/extension_record_manager_second_test.cpp b/test/unittest/ui_extension/extension_record_manager_second_test/extension_record_manager_second_test.cpp index b4135711bf..3306ea26bd 100644 --- a/test/unittest/ui_extension/extension_record_manager_second_test/extension_record_manager_second_test.cpp +++ b/test/unittest/ui_extension/extension_record_manager_second_test/extension_record_manager_second_test.cpp @@ -26,7 +26,7 @@ #include "extension_record.h" #include "extension_record_manager.h" #include "extension_running_timeout_monitor.h" -#include "bg_user_extension_monitor.h" +#include "background_user_extension_monitor.h" #include "extension_config.h" #define inline #undef protected @@ -1931,9 +1931,9 @@ HWTEST_F(ExtensionRunningTimeoutMonitorTest, OnExtensionStarted_0500, TestSize.L TAG_LOGI(AAFwkTag::TEST, "end."); } -// ========== BgUserExtensionMonitor TDD Tests ========== +// ========== BackgroundUserExtensionMonitor TDD Tests ========== -class BgUserExtensionMonitorTest : public testing::Test { +class BackgroundUserExtensionMonitorTest : public testing::Test { public: static void SetUpTestCase(); static void TearDownTestCase(); @@ -1941,44 +1941,44 @@ public: void TearDown() override; }; -void BgUserExtensionMonitorTest::SetUpTestCase() +void BackgroundUserExtensionMonitorTest::SetUpTestCase() {} -void BgUserExtensionMonitorTest::TearDownTestCase() +void BackgroundUserExtensionMonitorTest::TearDownTestCase() {} -void BgUserExtensionMonitorTest::SetUp() +void BackgroundUserExtensionMonitorTest::SetUp() { - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); monitor->cachedEvents_.clear(); } -void BgUserExtensionMonitorTest::TearDown() +void BackgroundUserExtensionMonitorTest::TearDown() { - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); monitor->StopMonitor(); monitor->cachedEvents_.clear(); } /** - * @tc.name: BgUserExtension_OnBgUserExtensionStarted_0100 - * @tc.desc: Test OnBgUserExtensionStarted stores event fields correctly. + * @tc.name: BackgroundUserExtension_OnBackgroundUserExtensionStarted_0100 + * @tc.desc: Test OnBackgroundUserExtensionStarted stores event fields correctly. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_0100, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_OnBackgroundUserExtensionStarted_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionCallerInfo callerInfo; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo; callerInfo.callerUid = 200000100; callerInfo.callerUserId = 100; callerInfo.callerProcessName = "com.example.caller"; callerInfo.callerBundleName = "com.example.caller"; - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, "com.example.callee", "com.example.callee", "ServiceExtension", "ServiceExtAbility", 100200); @@ -1996,26 +1996,26 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_01 } /** - * @tc.name: BgUserExtension_OnBgUserExtensionStarted_0200 - * @tc.desc: Test OnBgUserExtensionStarted with multiple different events. + * @tc.name: BackgroundUserExtension_OnBackgroundUserExtensionStarted_0200 + * @tc.desc: Test OnBackgroundUserExtensionStarted with multiple different events. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_0200, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_OnBackgroundUserExtensionStarted_0200, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionCallerInfo callerInfo; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo; callerInfo.callerUid = 200000100; callerInfo.callerBundleName = "com.example.caller"; - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, "com.example.callee", "com.example.callee", "ServiceExtension", "ServiceExtAbility", 100200); - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, "com.example.callee", "com.example.callee", "ShareExtension", "ShareExtAbility", 100200); @@ -2025,22 +2025,22 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_02 } /** - * @tc.name: BgUserExtension_OnBgUserExtensionStarted_0300 - * @tc.desc: Test OnBgUserExtensionStarted dedupes by extensionTypeName + abilityName and increments cnt. + * @tc.name: BackgroundUserExtension_OnBackgroundUserExtensionStarted_0300 + * @tc.desc: Test OnBackgroundUserExtensionStarted dedupes by extensionTypeName + abilityName and increments cnt. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_0300, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_OnBackgroundUserExtensionStarted_0300, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionCallerInfo callerInfo1; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo1; callerInfo1.callerUid = 200000100; callerInfo1.callerBundleName = "com.example.caller1"; - monitor->OnBgUserExtensionStarted(callerInfo1, + monitor->OnBackgroundUserExtensionStarted(callerInfo1, "com.example.callee", "com.example.callee", "ServiceExtension", "ServiceExtAbility", 100200); @@ -2048,11 +2048,11 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_03 EXPECT_EQ(monitor->cachedEvents_.front().cnt, 1); // Second call with same extension type + ability name → dedupe, cnt++ - AAFwk::BgUserExtensionCallerInfo callerInfo2; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo2; callerInfo2.callerUid = 200000200; callerInfo2.callerBundleName = "com.example.caller2"; - monitor->OnBgUserExtensionStarted(callerInfo2, + monitor->OnBackgroundUserExtensionStarted(callerInfo2, "com.example.callee2", "com.example.callee2", "ServiceExtension", "ServiceExtAbility", 100300); @@ -2068,30 +2068,30 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_03 } /** - * @tc.name: BgUserExtension_OnBgUserExtensionStarted_0400 - * @tc.desc: Test OnBgUserExtensionStarted discards event when cache is full (MAX_CACHED_EVENTS=5). + * @tc.name: BackgroundUserExtension_OnBackgroundUserExtensionStarted_0400 + * @tc.desc: Test OnBackgroundUserExtensionStarted discards event when cache is full (MAX_CACHED_EVENTS=5). * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_0400, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_OnBackgroundUserExtensionStarted_0400, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionCallerInfo callerInfo; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo; callerInfo.callerUid = 200000100; callerInfo.callerBundleName = "com.example.caller"; for (int32_t i = 0; i < monitor->MAX_CACHED_EVENTS; i++) { - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, "com.example.callee" + std::to_string(i), "com.example.callee" + std::to_string(i), "ServiceExtension", "Ability" + std::to_string(i), 100200 + i); } EXPECT_EQ(monitor->cachedEvents_.size(), static_cast(monitor->MAX_CACHED_EVENTS)); // 6th event should be discarded - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, "com.example.overflow", "com.example.overflow", "ServiceExtension", "OverflowAbility", 999999); EXPECT_EQ(monitor->cachedEvents_.size(), static_cast(monitor->MAX_CACHED_EVENTS)); @@ -2109,27 +2109,27 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_OnBgUserExtensionStarted_04 } /** - * @tc.name: BgUserExtension_IsDuplicateEvent_0100 + * @tc.name: BackgroundUserExtension_IsDuplicateEvent_0100 * @tc.desc: Test IsDuplicateEvent returns true for same extensionTypeName + abilityName. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_IsDuplicateEvent_0100, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_IsDuplicateEvent_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionEvent event; + AAFwk::BackgroundUserExtensionEvent event; event.calleeExtensionTypeName = "ServiceExtension"; event.calleeAbilityName = "TestAbility"; monitor->cachedEvents_.push_back(event); - AAFwk::BgUserExtensionEvent candidate; + AAFwk::BackgroundUserExtensionEvent candidate; candidate.calleeExtensionTypeName = "ServiceExtension"; candidate.calleeAbilityName = "TestAbility"; - std::list::iterator dupIter; + std::list::iterator dupIter; EXPECT_TRUE(monitor->IsDuplicateEvent(candidate, dupIter)); EXPECT_EQ(dupIter->calleeAbilityName, "TestAbility"); @@ -2137,69 +2137,69 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_IsDuplicateEvent_0100, Test } /** - * @tc.name: BgUserExtension_IsDuplicateEvent_0200 + * @tc.name: BackgroundUserExtension_IsDuplicateEvent_0200 * @tc.desc: Test IsDuplicateEvent returns false for different extensionTypeName. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_IsDuplicateEvent_0200, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_IsDuplicateEvent_0200, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionEvent event; + AAFwk::BackgroundUserExtensionEvent event; event.calleeExtensionTypeName = "ServiceExtension"; event.calleeAbilityName = "TestAbility"; monitor->cachedEvents_.push_back(event); - AAFwk::BgUserExtensionEvent candidate; + AAFwk::BackgroundUserExtensionEvent candidate; candidate.calleeExtensionTypeName = "ShareExtension"; candidate.calleeAbilityName = "TestAbility"; - std::list::iterator dupIter; + std::list::iterator dupIter; EXPECT_FALSE(monitor->IsDuplicateEvent(candidate, dupIter)); TAG_LOGI(AAFwkTag::TEST, "end."); } /** - * @tc.name: BgUserExtension_IsDuplicateEvent_0300 + * @tc.name: BackgroundUserExtension_IsDuplicateEvent_0300 * @tc.desc: Test IsDuplicateEvent returns false for different abilityName. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_IsDuplicateEvent_0300, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_IsDuplicateEvent_0300, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionEvent event; + AAFwk::BackgroundUserExtensionEvent event; event.calleeExtensionTypeName = "ServiceExtension"; event.calleeAbilityName = "Ability1"; monitor->cachedEvents_.push_back(event); - AAFwk::BgUserExtensionEvent candidate; + AAFwk::BackgroundUserExtensionEvent candidate; candidate.calleeExtensionTypeName = "ServiceExtension"; candidate.calleeAbilityName = "Ability2"; - std::list::iterator dupIter; + std::list::iterator dupIter; EXPECT_FALSE(monitor->IsDuplicateEvent(candidate, dupIter)); TAG_LOGI(AAFwkTag::TEST, "end."); } /** - * @tc.name: BgUserExtension_ReportCachedEvents_0100 + * @tc.name: BackgroundUserExtension_ReportCachedEvents_0100 * @tc.desc: Test ReportCachedEvents with empty cache does nothing. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_ReportCachedEvents_0100, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_ReportCachedEvents_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); EXPECT_EQ(monitor->cachedEvents_.size(), static_cast(0)); @@ -2210,18 +2210,18 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_ReportCachedEvents_0100, Te } /** - * @tc.name: BgUserExtension_ReportCachedEvents_0200 + * @tc.name: BackgroundUserExtension_ReportCachedEvents_0200 * @tc.desc: Test ReportCachedEvents clears cache after reporting events. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_ReportCachedEvents_0200, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_ReportCachedEvents_0200, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionEvent event; + AAFwk::BackgroundUserExtensionEvent event; event.callerUid = 200000100; event.callerBundleName = "com.example.caller"; event.calleeBundleName = "com.example.callee"; @@ -2239,15 +2239,15 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_ReportCachedEvents_0200, Te } /** - * @tc.name: BgUserExtension_StartStopMonitor_0100 + * @tc.name: BackgroundUserExtension_StartStopMonitor_0100 * @tc.desc: Test StartMonitor and StopMonitor do not crash. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_StartStopMonitor_0100, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_StartStopMonitor_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); monitor->StartMonitor(); @@ -2259,24 +2259,24 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_StartStopMonitor_0100, Test } /** - * @tc.name: BgUserExtension_BuildJsonInfo_0100 + * @tc.name: BackgroundUserExtension_BuildJsonInfo_0100 * @tc.desc: Test JSON string built from event contains all 7 fields. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_BuildJsonInfo_0100, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_BuildJsonInfo_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); - AAFwk::BgUserExtensionCallerInfo callerInfo; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo; callerInfo.callerUid = 200000100; callerInfo.callerUserId = 100; callerInfo.callerProcessName = "com.example.caller"; callerInfo.callerBundleName = "com.example.caller"; - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, "com.example.callee", "com.example.callee", "ServiceExtension", "ServiceExtAbility", 100200); @@ -2301,15 +2301,15 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_BuildJsonInfo_0100, TestSiz } /** - * @tc.name: BgUserExtension_ConcurrentAccess_0100 - * @tc.desc: Test concurrent OnBgUserExtensionStarted does not crash. + * @tc.name: BackgroundUserExtension_ConcurrentAccess_0100 + * @tc.desc: Test concurrent OnBackgroundUserExtensionStarted does not crash. * @tc.type: FUNC * @tc.require: issue */ -HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_ConcurrentAccess_0100, TestSize.Level1) +HWTEST_F(BackgroundUserExtensionMonitorTest, BackgroundUserExtension_ConcurrentAccess_0100, TestSize.Level1) { TAG_LOGI(AAFwkTag::TEST, "begin."); - auto monitor = DelayedSingleton::GetInstance(); + auto monitor = DelayedSingleton::GetInstance(); ASSERT_NE(monitor, nullptr); const int32_t threadCount = 10; @@ -2317,10 +2317,10 @@ HWTEST_F(BgUserExtensionMonitorTest, BgUserExtension_ConcurrentAccess_0100, Test for (int32_t i = 0; i < threadCount; i++) { threads.emplace_back([monitor, i]() { - AAFwk::BgUserExtensionCallerInfo callerInfo; + AAFwk::BackgroundUserExtensionCallerInfo callerInfo; callerInfo.callerUid = 200000100 + i; callerInfo.callerBundleName = "com.example.caller" + std::to_string(i); - monitor->OnBgUserExtensionStarted(callerInfo, + monitor->OnBackgroundUserExtensionStarted(callerInfo, "com.example.callee" + std::to_string(i), "com.example.callee" + std::to_string(i), "ServiceExtension",