From 1a1dabad9690e5673c4fb41ffef0e043a52eedd3 Mon Sep 17 00:00:00 2001 From: xinking129 Date: Sat, 25 Nov 2023 15:32:11 +0800 Subject: [PATCH] register and unregister app debug delete const& Signed-off-by: xinking129 --- .../ability_manager/include/ability_manager_interface.h | 4 ++-- services/abilitymgr/include/ability_manager_proxy.h | 4 ++-- services/abilitymgr/include/ability_manager_service.h | 4 ++-- services/abilitymgr/src/ability_manager_proxy.cpp | 4 ++-- services/abilitymgr/src/ability_manager_service.cpp | 4 ++-- .../AMS/mock_serviceability_manager_service.h | 4 ++-- .../include/mock_ability_manager_service.h | 4 ++-- .../ability_delegator/mock_ability_delegator_stub.h | 8 ++++---- .../include/mock_ability_mgr_service.h | 4 ++-- .../AMS/mock_ability_manager_service.h | 4 ++-- .../AMS/mock_serviceability_manager_service.h | 4 ++-- test/moduletest/mock/include/mock_ability_mgr_service.h | 4 ++-- .../ability_manager_stub_mock_test.h | 4 ++-- .../ability_manager_stub_mock.h | 4 ++-- .../ability_manager_stub_impl_mock.h | 4 ++-- .../ability_manager_test/ability_manager_stub_mock.h | 4 ++-- .../ability_manager_stub_mock.h | 4 ++-- .../sys_mgr_client_test/mock_ability_manager_service.h | 4 ++-- tools/test/mock/mock_ability_manager_stub.h | 4 ++-- 19 files changed, 40 insertions(+), 40 deletions(-) diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h index 142d27a09f..6431af10a1 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h @@ -1286,14 +1286,14 @@ public: * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t RegisterAppDebugListener(const sptr &listener) = 0; + virtual int32_t RegisterAppDebugListener(sptr listener) = 0; /** * @brief Unregister app debug listener. * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t UnregisterAppDebugListener(const sptr &listener) = 0; + virtual int32_t UnregisterAppDebugListener(sptr listener) = 0; /** * @brief Attach app debug. diff --git a/services/abilitymgr/include/ability_manager_proxy.h b/services/abilitymgr/include/ability_manager_proxy.h index 78f2fe3901..47c9bdb48e 100644 --- a/services/abilitymgr/include/ability_manager_proxy.h +++ b/services/abilitymgr/include/ability_manager_proxy.h @@ -1018,14 +1018,14 @@ public: * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - int32_t RegisterAppDebugListener(const sptr &listener) override; + int32_t RegisterAppDebugListener(sptr listener) override; /** * @brief Unregister app debug listener. * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - int32_t UnregisterAppDebugListener(const sptr &listener) override; + int32_t UnregisterAppDebugListener(sptr listener) override; /** * @brief Attach app debug. diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index c916cc5340..791acaf262 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -1330,14 +1330,14 @@ public: * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - int32_t RegisterAppDebugListener(const sptr &listener) override; + int32_t RegisterAppDebugListener(sptr listener) override; /** * @brief Unregister app debug listener. * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - int32_t UnregisterAppDebugListener(const sptr &listener) override; + int32_t UnregisterAppDebugListener(sptr listener) override; /** * @brief Attach app debug. diff --git a/services/abilitymgr/src/ability_manager_proxy.cpp b/services/abilitymgr/src/ability_manager_proxy.cpp index c84f14fbbf..25ac67122b 100644 --- a/services/abilitymgr/src/ability_manager_proxy.cpp +++ b/services/abilitymgr/src/ability_manager_proxy.cpp @@ -4440,7 +4440,7 @@ int AbilityManagerProxy::PrepareTerminateAbilityBySCB(const sptr &s return NO_ERROR; } -int32_t AbilityManagerProxy::RegisterAppDebugListener(const sptr &listener) +int32_t AbilityManagerProxy::RegisterAppDebugListener(sptr listener) { HILOG_DEBUG("Called."); MessageParcel data; @@ -4464,7 +4464,7 @@ int32_t AbilityManagerProxy::RegisterAppDebugListener(const sptr &listener) +int32_t AbilityManagerProxy::UnregisterAppDebugListener(sptr listener) { HILOG_DEBUG("Called."); MessageParcel data; diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 2baaed4be1..9d692866a0 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -8812,7 +8812,7 @@ bool AbilityManagerService::CheckUserIdActive(int32_t userId) return true; } -int32_t AbilityManagerService::RegisterAppDebugListener(const sptr &listener) +int32_t AbilityManagerService::RegisterAppDebugListener(sptr listener) { HILOG_DEBUG("Called."); if (!AAFwk::PermissionVerification::GetInstance()->IsSACall()) { @@ -8822,7 +8822,7 @@ int32_t AbilityManagerService::RegisterAppDebugListener(const sptr::GetInstance()->RegisterAppDebugListener(listener); } -int32_t AbilityManagerService::UnregisterAppDebugListener(const sptr &listener) +int32_t AbilityManagerService::UnregisterAppDebugListener(sptr listener) { HILOG_DEBUG("Called."); if (!AAFwk::PermissionVerification::GetInstance()->IsSACall()) { diff --git a/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.h b/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.h index 66d6c82863..c25a57b37c 100644 --- a/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.h +++ b/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.h @@ -324,8 +324,8 @@ public: commonMockResultFlag_ = flag; } MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/mock/frameworks_kits_ability_native_test/include/mock_ability_manager_service.h b/test/mock/frameworks_kits_ability_native_test/include/mock_ability_manager_service.h index c70274ad27..ba8da234ac 100644 --- a/test/mock/frameworks_kits_ability_native_test/include/mock_ability_manager_service.h +++ b/test/mock/frameworks_kits_ability_native_test/include/mock_ability_manager_service.h @@ -291,8 +291,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.h b/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.h index dc9013e672..1eee737d81 100644 --- a/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.h +++ b/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.h @@ -173,8 +173,8 @@ public: void CompleteFirstFrameDrawing(const sptr& abilityToken) override {} #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, @@ -340,8 +340,8 @@ public: void CompleteFirstFrameDrawing(const sptr& abilityToken) override {} #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/mock/frameworks_kits_appkit_test/include/mock_ability_mgr_service.h b/test/mock/frameworks_kits_appkit_test/include/mock_ability_mgr_service.h index 0a4025eb9f..ae61f8a36f 100644 --- a/test/mock/frameworks_kits_appkit_test/include/mock_ability_mgr_service.h +++ b/test/mock/frameworks_kits_appkit_test/include/mock_ability_mgr_service.h @@ -125,8 +125,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/mock/frameworks_kits_test/AMS/mock_ability_manager_service.h b/test/mock/frameworks_kits_test/AMS/mock_ability_manager_service.h index 8e5f641483..74fcd64773 100644 --- a/test/mock/frameworks_kits_test/AMS/mock_ability_manager_service.h +++ b/test/mock/frameworks_kits_test/AMS/mock_ability_manager_service.h @@ -281,8 +281,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/mock/frameworks_kits_test/AMS/mock_serviceability_manager_service.h b/test/mock/frameworks_kits_test/AMS/mock_serviceability_manager_service.h index 25aff15a34..fc949f671b 100644 --- a/test/mock/frameworks_kits_test/AMS/mock_serviceability_manager_service.h +++ b/test/mock/frameworks_kits_test/AMS/mock_serviceability_manager_service.h @@ -297,8 +297,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/moduletest/mock/include/mock_ability_mgr_service.h b/test/moduletest/mock/include/mock_ability_mgr_service.h index 374305754b..4b52b5066c 100644 --- a/test/moduletest/mock/include/mock_ability_mgr_service.h +++ b/test/moduletest/mock/include/mock_ability_mgr_service.h @@ -263,8 +263,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/unittest/ability_manager_client_branch_test/ability_manager_stub_mock_test.h b/test/unittest/ability_manager_client_branch_test/ability_manager_stub_mock_test.h index 071786b15a..ed9d16cb18 100644 --- a/test/unittest/ability_manager_client_branch_test/ability_manager_stub_mock_test.h +++ b/test/unittest/ability_manager_client_branch_test/ability_manager_stub_mock_test.h @@ -417,8 +417,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/unittest/ability_manager_proxy_test/ability_manager_stub_mock.h b/test/unittest/ability_manager_proxy_test/ability_manager_stub_mock.h index 61f6f64cb8..65f36dee3d 100644 --- a/test/unittest/ability_manager_proxy_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_proxy_test/ability_manager_stub_mock.h @@ -402,8 +402,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(IsAbilityControllerStart, bool(const Want& want)); diff --git a/test/unittest/ability_manager_stub_test/ability_manager_stub_impl_mock.h b/test/unittest/ability_manager_stub_test/ability_manager_stub_impl_mock.h index 0f3afdcf7e..e523d3851b 100644 --- a/test/unittest/ability_manager_stub_test/ability_manager_stub_impl_mock.h +++ b/test/unittest/ability_manager_stub_test/ability_manager_stub_impl_mock.h @@ -402,8 +402,8 @@ public: #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); MOCK_METHOD2(PrepareTerminateAbilityBySCB, int32_t(const sptr &sessionInfo, bool &isPrepareTerminate)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(IsAbilityControllerStart, bool(const Want& want)); diff --git a/test/unittest/ability_manager_test/ability_manager_stub_mock.h b/test/unittest/ability_manager_test/ability_manager_stub_mock.h index f6a5f8e03a..654bb715f8 100644 --- a/test/unittest/ability_manager_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_test/ability_manager_stub_mock.h @@ -403,8 +403,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/unittest/service_extension_context_test/ability_manager_stub_mock.h b/test/unittest/service_extension_context_test/ability_manager_stub_mock.h index b5a460293f..10660d2117 100644 --- a/test/unittest/service_extension_context_test/ability_manager_stub_mock.h +++ b/test/unittest/service_extension_context_test/ability_manager_stub_mock.h @@ -394,8 +394,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/test/unittest/sys_mgr_client_test/mock_ability_manager_service.h b/test/unittest/sys_mgr_client_test/mock_ability_manager_service.h index cfd0ffb1f5..9e1f546c6b 100644 --- a/test/unittest/sys_mgr_client_test/mock_ability_manager_service.h +++ b/test/unittest/sys_mgr_client_test/mock_ability_manager_service.h @@ -271,8 +271,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken, diff --git a/tools/test/mock/mock_ability_manager_stub.h b/tools/test/mock/mock_ability_manager_stub.h index 82df1ea4b8..901d779727 100644 --- a/tools/test/mock/mock_ability_manager_stub.h +++ b/tools/test/mock/mock_ability_manager_stub.h @@ -273,8 +273,8 @@ public: } #endif MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector&, std::vector&)); - MOCK_METHOD1(RegisterAppDebugListener, int32_t(const sptr &listener)); - MOCK_METHOD1(UnregisterAppDebugListener, int32_t(const sptr &listener)); + MOCK_METHOD1(RegisterAppDebugListener, int32_t(sptr listener)); + MOCK_METHOD1(UnregisterAppDebugListener, int32_t(sptr listener)); MOCK_METHOD1(AttachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD1(DetachAppDebug, int32_t(const std::string &bundleName)); MOCK_METHOD3(ExecuteIntent, int32_t(uint64_t key, const sptr &callerToken,