From a614ee6ca1900053307c531abd63d58769f2fd13 Mon Sep 17 00:00:00 2001 From: wangyang2022 Date: Wed, 1 Mar 2023 03:31:21 +0000 Subject: [PATCH] =?UTF-8?q?SA=E5=9F=BA=E7=B1=BB=E6=B7=BB=E5=8A=A0OnActive?= =?UTF-8?q?=E5=92=8COnIdle=E5=9B=9E=E8=B0=83=20Signed-off-by:=20wangyang20?= =?UTF-8?q?22=20=20Change-Id:=20I1fab3e2eadaf00b0e?= =?UTF-8?q?7c4d26e8127e5b012cd66c3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/mock/src/mock_service_registry.cpp | 5 +++++ .../aams/test/mock/src/mock_system_ability.cpp | 14 ++++++++++++++ services/test/mock/mock_service_registry.cpp | 5 +++++ services/test/mock/mock_system_ability.cpp | 17 +++++++++++++++++ 4 files changed, 41 insertions(+) diff --git a/frameworks/acfwk/test/mock/src/mock_service_registry.cpp b/frameworks/acfwk/test/mock/src/mock_service_registry.cpp index a552e988..723da4f2 100644 --- a/frameworks/acfwk/test/mock/src/mock_service_registry.cpp +++ b/frameworks/acfwk/test/mock/src/mock_service_registry.cpp @@ -149,6 +149,11 @@ int32_t SystemAbilityManagerProxy::UnloadSystemAbility(int32_t systemAbilityId) return -1; } +int32_t SystemAbilityManagerProxy::CancelUnloadSystemAbility(int32_t systemAbilityId) +{ + return -1; +} + int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr& ability, const SAExtraProp& extraProp) { diff --git a/services/aams/test/mock/src/mock_system_ability.cpp b/services/aams/test/mock/src/mock_system_ability.cpp index 21763bff..3f02a525 100644 --- a/services/aams/test/mock/src/mock_system_ability.cpp +++ b/services/aams/test/mock/src/mock_system_ability.cpp @@ -142,10 +142,24 @@ void SystemAbility::OnDump() void SystemAbility::OnStart() {} +void SystemAbility::OnStart(const std::unordered_map& startReason) +{} + +int32_t SystemAbility::OnIdle(const std::unordered_map& idleReason) +{ + return 0; +} + +void SystemAbility::OnActive(const std::unordered_map& activeReason) +{} + // The details should be implemented by subclass void SystemAbility::OnStop() {} +void SystemAbility::OnStop(const std::unordered_map& stopReason) +{} + // The details should be implemented by subclass void SystemAbility::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) { diff --git a/services/test/mock/mock_service_registry.cpp b/services/test/mock/mock_service_registry.cpp index b70f3524..016b9349 100644 --- a/services/test/mock/mock_service_registry.cpp +++ b/services/test/mock/mock_service_registry.cpp @@ -148,6 +148,11 @@ int32_t SystemAbilityManagerProxy::UnloadSystemAbility(int32_t systemAbilityId) return -1; } +int32_t SystemAbilityManagerProxy::CancelUnloadSystemAbility(int32_t systemAbilityId) +{ + return -1; +} + int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr& ability, const SAExtraProp& extraProp) { diff --git a/services/test/mock/mock_system_ability.cpp b/services/test/mock/mock_system_ability.cpp index 5e10600c..14f3fff2 100644 --- a/services/test/mock/mock_system_ability.cpp +++ b/services/test/mock/mock_system_ability.cpp @@ -170,11 +170,28 @@ void SystemAbility::OnStart() { } +void SystemAbility::OnStart(const std::unordered_map& startReason) +{ +} + +int32_t SystemAbility::OnIdle(const std::unordered_map& idleReason) +{ + return 0; +} + +void SystemAbility::OnActive(const std::unordered_map& activeReason) +{ +} + // The details should be implemented by subclass void SystemAbility::OnStop() { } +void SystemAbility::OnStop(const std::unordered_map& stopReason) +{ +} + // The details should be implemented by subclass void SystemAbility::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) {