diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_client.h b/interfaces/inner_api/ability_manager/include/ability_manager_client.h index cddd807658f47480776a5a2afef363ab0de57593..60e6e80a8145c07cdc6d07e8519968e74412c9ca 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_client.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_client.h @@ -924,9 +924,10 @@ public: * * @param want, Special want for service type's ability. * @param connect, Callback used to notify caller the result of connecting or disconnecting. + * @param isSilent, whether show window when start fail. * @return Returns ERR_OK on success, others on failure. */ - ErrCode StartAbilityByCall(const Want &want, sptr connect); + ErrCode StartAbilityByCall(const Want &want, sptr connect, bool isSilent = false); /** * Start Ability, connect session with common ability. @@ -934,13 +935,14 @@ public: * @param want, Special want for service type's ability. * @param connect, Callback used to notify caller the result of connecting or disconnecting. * @param accountId Indicates the account to start. + * @param isSilent, whether show window when start fail. * @return Returns ERR_OK on success, others on failure. */ ErrCode StartAbilityByCall(const Want &want, sptr connect, - sptr callToken, int32_t accountId = DEFAULT_INVAL_VALUE); + sptr callToken, int32_t accountId = DEFAULT_INVAL_VALUE, bool isSilent = false); int32_t StartAbilityByCallWithErrMsg(const Want &want, sptr connect, - sptr callToken, int32_t accountId, std::string &errMsg); + sptr callToken, int32_t accountId, std::string &errMsg, bool isSilent = false); /** * CallRequestDone, after invoke callRequest, ability will call this interface to return callee. 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 51a85cb8b1661f3a933b143ce1edab23c5dcb226..c04c88ea43ab51e130c205d27b365d65a3ec4de9 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h @@ -1068,10 +1068,10 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) = 0; + const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, bool isSilent = false) = 0; virtual int StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId, std::string &errMsg) + const sptr &callerToken, int32_t accountId, std::string &errMsg, bool isSilent = false) { return 0; }; diff --git a/services/abilitymgr/include/ability_manager_proxy.h b/services/abilitymgr/include/ability_manager_proxy.h index e961c374ed81d9244d8ff45f6ede29f9b1b71ae3..90aa5002ea4b2fc397d3db6430d780e1c1cdde08 100644 --- a/services/abilitymgr/include/ability_manager_proxy.h +++ b/services/abilitymgr/include/ability_manager_proxy.h @@ -827,10 +827,12 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) override; + const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, + bool isSilent = false) override; virtual int StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId, std::string &errMsg) override; + const sptr &callerToken, int32_t accountId, std::string &errMsg, + bool isSilent = false) override; /** * CallRequestDone, after invoke callRequest, ability will call this interface to return callee. diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index 823be80a204242d01ab3edaddb048ef7cb0d75c4..d41193fd98904202c237ff48985be63e732b01a7 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -1015,19 +1015,14 @@ public: virtual int GetAppMemorySize() override; virtual bool IsRamConstrainedDevice() override; - /** - * Start Ability, connect session with common ability. - * - * @param want, Special want for service type's ability. - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @param accountId Indicates the account to start. - * @return Returns ERR_OK on success, others on failure. - */ + virtual int StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) override; + const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, + bool isSilent = false) override; virtual int StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId, std::string &errMsg) override; + const sptr &callerToken, int32_t accountId, std::string &errMsg, + bool isSilent = false) override; /** * As abilityRequest is prepared, just execute starting ability procedure. diff --git a/services/abilitymgr/src/ability_manager_client.cpp b/services/abilitymgr/src/ability_manager_client.cpp index c37651265db6f8ac391d195a2276ccc5b4f23955..e4149b294d189bc161089b437af22d1e793e1e44 100644 --- a/services/abilitymgr/src/ability_manager_client.cpp +++ b/services/abilitymgr/src/ability_manager_client.cpp @@ -1115,32 +1115,33 @@ ErrCode AbilityManagerClient::GetMissionIdByToken(sptr token, int return ERR_OK; } -ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr connect) +ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr connect, bool isSilent) { auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); - TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s", want.GetElement().GetURI().c_str()); - return abms->StartAbilityByCall(want, connect, nullptr, DEFAULT_INVAL_VALUE); + TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, isSilent::%{public}d", + want.GetElement().GetURI().c_str(), isSilent); + return abms->StartAbilityByCall(want, connect, nullptr, DEFAULT_INVAL_VALUE, isSilent); } ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr connect, - sptr callToken, int32_t accountId) + sptr callToken, int32_t accountId, bool isSilent) { auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); - TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, userId:%{public}d", - want.GetElement().GetURI().c_str(), accountId); - return abms->StartAbilityByCall(want, connect, callToken, accountId); + TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, userId:%{public}d, isSilent::%{public}d", + want.GetElement().GetURI().c_str(), accountId, isSilent); + return abms->StartAbilityByCall(want, connect, callToken, accountId, isSilent); } ErrCode AbilityManagerClient::StartAbilityByCallWithErrMsg(const Want &want, sptr connect, - sptr callToken, int32_t accountId, std::string &errMsg) + sptr callToken, int32_t accountId, std::string &errMsg, bool isSilent) { auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); - TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, userId:%{public}d", - want.GetElement().GetURI().c_str(), accountId); - return abms->StartAbilityByCallWithErrMsg(want, connect, callToken, accountId, errMsg); + TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, userId:%{public}d, isSilent::%{public}d", + want.GetElement().GetURI().c_str(), accountId, isSilent); + return abms->StartAbilityByCallWithErrMsg(want, connect, callToken, accountId, errMsg, isSilent); } void AbilityManagerClient::CallRequestDone(sptr token, sptr callStub) diff --git a/services/abilitymgr/src/ability_manager_proxy.cpp b/services/abilitymgr/src/ability_manager_proxy.cpp index fe4781cf93247d5328eaf7463ea019e72dc4536f..92415d9958ce71864f909ff9c203a01f01bdf7da 100644 --- a/services/abilitymgr/src/ability_manager_proxy.cpp +++ b/services/abilitymgr/src/ability_manager_proxy.cpp @@ -3727,14 +3727,14 @@ int AbilityManagerProxy::UnRegisterMissionListener(const std::string &deviceId, } int AbilityManagerProxy::StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId) + const sptr &callerToken, int32_t accountId, bool isSilent) { std::string errMsg; - return StartAbilityByCallWithErrMsg(want, connect, callerToken, accountId, errMsg); + return StartAbilityByCallWithErrMsg(want, connect, callerToken, accountId, errMsg, isSilent); } int AbilityManagerProxy::StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId, std::string &errMsg) + const sptr &callerToken, int32_t accountId, std::string &errMsg, bool isSilent) { TAG_LOGD(AAFwkTag::ABILITYMGR, "AbilityManagerProxy::StartAbilityByCall begin."); int error; @@ -3780,7 +3780,12 @@ int AbilityManagerProxy::StartAbilityByCallWithErrMsg(const Want &want, const sp return ERR_INVALID_VALUE; } - TAG_LOGD(AAFwkTag::ABILITYMGR, "AbilityManagerProxy::StartAbilityByCall SendRequest Call."); + if (!data.WriteBool(isSilent)) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "isSilent write fail"); + errMsg = "isSilent write fail"; + return ERR_INVALID_VALUE; + } + error = SendRequest(AbilityManagerInterfaceCode::START_CALL_ABILITY, data, reply, option); if (error != NO_ERROR) { TAG_LOGE(AAFwkTag::ABILITYMGR, "request error:%{public}d", error); diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index d013717be00e8c617acc7b5de1e7877f6a570a4d..31b647745e1db5ff1267bbba5af3934f3198664c 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -8441,14 +8441,14 @@ int AbilityManagerService::ReleaseRemoteAbility(const sptr &conne } int AbilityManagerService::StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId) + const sptr &callerToken, int32_t accountId, bool isSilent) { std::string errMsg; - return StartAbilityByCallWithErrMsg(want, connect, callerToken, accountId, errMsg); + return StartAbilityByCallWithErrMsg(want, connect, callerToken, accountId, errMsg, isSilent); } int AbilityManagerService::StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId, std::string &errMsg) + const sptr &callerToken, int32_t accountId, std::string &errMsg, bool isSilent) { XCOLLIE_TIMER_LESS_IGNORE(__PRETTY_FUNCTION__, !want.GetElement().GetDeviceID().empty()); TAG_LOGD(AAFwkTag::ABILITYMGR, "call"); @@ -8491,7 +8491,8 @@ int AbilityManagerService::StartAbilityByCallWithErrMsg(const Want &want, const StartAbilityInfoWrap threadLocalInfo(want, GetUserId(), appIndex, callerToken); auto shouldBlockFunc = [aams = shared_from_this()]() { return aams->ShouldBlockAllAppStart(); }; - AbilityInterceptorParam interceptorParam = AbilityInterceptorParam(want, 0, GetUserId(), true, nullptr, + isSilent = want.GetBoolParam(Want::PARAM_RESV_CALL_TO_FOREGROUND, false) ? true : isSilent; + AbilityInterceptorParam interceptorParam = AbilityInterceptorParam(want, 0, GetUserId(), isSilent, nullptr, shouldBlockFunc); auto result = interceptorExecuter_ == nullptr ? ERR_INVALID_VALUE : interceptorExecuter_->DoProcess(interceptorParam); @@ -8518,7 +8519,6 @@ int AbilityManagerService::StartAbilityByCallWithErrMsg(const Want &want, const abilityRequest.callType = AbilityCallType::CALL_REQUEST_TYPE; abilityRequest.callerUid = IPCSkeleton::GetCallingUid(); abilityRequest.callerToken = callerToken; - abilityRequest.startSetting = nullptr; abilityRequest.want = want; abilityRequest.connect = connect; result = GenerateAbilityRequest(want, -1, abilityRequest, callerToken, GetUserId()); diff --git a/services/abilitymgr/src/ability_manager_stub.cpp b/services/abilitymgr/src/ability_manager_stub.cpp index 8e759eb4ce924f4cd93b4694f9542117564d66d4..15e32445e5729b83e154902b868823eb306fa836 100644 --- a/services/abilitymgr/src/ability_manager_stub.cpp +++ b/services/abilitymgr/src/ability_manager_stub.cpp @@ -2483,8 +2483,9 @@ int AbilityManagerStub::StartAbilityByCallInner(MessageParcel &data, MessageParc } int32_t accountId = data.ReadInt32(); + bool isSilent = data.ReadBool(); std::string errMsg = ""; - int32_t result = StartAbilityByCallWithErrMsg(*want, callback, callerToken, accountId, errMsg); + int32_t result = StartAbilityByCallWithErrMsg(*want, callback, callerToken, accountId, errMsg, isSilent); TAG_LOGD(AAFwkTag::ABILITYMGR, "resolve call ability ret = %d", result); reply.WriteString(errMsg); diff --git a/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_ability_manager_client.cpp b/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_ability_manager_client.cpp index cc089fbb6c697617a9ed76833c9740e0cb1a6afc..9fddcdfc1cc0bb5582305161e308a59e65b10eb0 100644 --- a/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_ability_manager_client.cpp +++ b/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_ability_manager_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -134,7 +134,7 @@ ErrCode AbilityManagerClient::StartAbility( } ErrCode AbilityManagerClient::StartAbilityByCall(const Want& want, sptr connect, - sptr callerToken, int32_t accountId) + sptr callerToken, int32_t accountId, bool isSilent) { TAG_LOGI(AAFwkTag::TEST, "AbilityManagerClient::StartAbilityByCall start"); if (g_remoteObject == nullptr) { diff --git a/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.cpp b/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.cpp index 1b18573791f58bed1afa325a604d0316f2ae2e33..82a318dc732a095ecbdadb6cb80ffd4fa2546495 100644 --- a/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.cpp +++ b/test/mock/frameworks_kits_ability_ability_runtime_test/AMS/mock_serviceability_manager_service.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -52,7 +52,7 @@ int MockServiceAbilityManagerService::StartAbilityAsCaller( } int MockServiceAbilityManagerService::StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t accountId) + const sptr& callerToken, int32_t accountId, bool isSilent) { GTEST_LOG_(INFO) << "MockServiceAbilityManagerService::StartAbilityByCall begain"; if (!connect) { 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 4973fd976754230ee81b06faf436c2b715071b6b..89299aada1bd577ac39976bf5289ea28e376bd74 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -65,7 +65,7 @@ public: int requestCode = DEFAULT_INVAL_VALUE) override; int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE); + const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, bool isSilent = false); int TerminateAbility( const sptr& token, int resultCode = -1, const Want* resultWant = nullptr) override; 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 e4f2843c8708404a750c2adb75df52041da85fbf..dd7fe95a1495a3e013f780164891d3afff3030c8 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -145,8 +145,8 @@ public: MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetWantSenderInfo, int(const sptr& target, std::shared_ptr& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD5(StartAbilityAsCaller, int(const Want& want, const sptr& callerToken, sptr asCallerSourceToken, int32_t userId, int requestCode)); diff --git a/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.cpp b/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.cpp index 0a27e428fd79c3859a257d3d85106a9b3bdc4822..127ea466c0af146f0c91b014624e1c00966e999a 100644 --- a/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.cpp +++ b/test/mock/frameworks_kits_appkit_native_test/ability_delegator/mock_ability_delegator_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -98,7 +98,7 @@ int MockAbilityDelegatorStub::UnRegisterMissionListener(const std::string& devic } int MockAbilityDelegatorStub::StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t accountId) + const sptr& callerToken, int32_t accountId, bool isSilent) { return 0; } @@ -291,7 +291,7 @@ int MockAbilityDelegatorStub2::UnRegisterMissionListener(const std::string& devi } int MockAbilityDelegatorStub2::StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t accountId) + const sptr& callerToken, int32_t accountId, bool isSilent) { return 0; } 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 be458c7cfb9a9dc329ea3c8b55161bed4e66281b..7d1d71c42446b68dbbf2fc853d6cd3e1fb4e35ab 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -135,7 +135,8 @@ public: int UnRegisterMissionListener(const std::string& deviceId, const sptr& listener) override; int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) override; + const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, + bool isSilent = false) override; void CallRequestDone(const sptr& token, const sptr& callStub) override; int ReleaseCall(const sptr& connect, const AppExecFwk::ElementName& element) override; @@ -315,7 +316,8 @@ public: int UnRegisterMissionListener(const std::string& deviceId, const sptr& listener) override; int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) override; + const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, + bool isSilent = false) override; void CallRequestDone(const sptr& token, const sptr& callStub) override; virtual int32_t GetForegroundUIAbilities(std::vector &list) { 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 3aad74681d750f37651977ccf04a536f0b73d39c..3fb4002e1041dc3728952ad13cb6a64cc3dea46b 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -157,8 +157,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD1(GetMissionIdByToken, int32_t(const sptr& token)); MOCK_METHOD2(GetAbilityTokenByCalleeObj, void(const sptr &callStub, sptr &token)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); 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 6f831357fed2abd695d1aa1dd3e667201697dd96..2f54869dfb90dfd60f8880d7aaf69002fbc98a48 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -161,8 +161,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); diff --git a/test/moduletest/ability_manager_client_test/mock_iabilitymanager.h b/test/moduletest/ability_manager_client_test/mock_iabilitymanager.h index d952e784aa63d013ae9b465e49398fce7a15dc33..4682b9fb078deff882dfdf70785d5104cb832644 100644 --- a/test/moduletest/ability_manager_client_test/mock_iabilitymanager.h +++ b/test/moduletest/ability_manager_client_test/mock_iabilitymanager.h @@ -281,7 +281,7 @@ public: return 0; } int StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) override + const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, bool isSilent = false) override { return 0; } diff --git a/test/moduletest/mock/include/mock_ability_mgr_service.h b/test/moduletest/mock/include/mock_ability_mgr_service.h index 53d5c33d78b64bd93c4b5957bc140031c624542d..9f9438d17596815f858047a001e41515cdcdbc8c 100644 --- a/test/moduletest/mock/include/mock_ability_mgr_service.h +++ b/test/moduletest/mock/include/mock_ability_mgr_service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -114,8 +114,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); diff --git a/test/unittest/ability_manager_client_branch_second_test/ability_manager_stub_mock_second_test.h b/test/unittest/ability_manager_client_branch_second_test/ability_manager_stub_mock_second_test.h index e5481123507c3ac483a269ea8167a72d00961df7..5ed51e73603f771eccedbb3f76339b86be0a7c84 100644 --- a/test/unittest/ability_manager_client_branch_second_test/ability_manager_stub_mock_second_test.h +++ b/test/unittest/ability_manager_client_branch_second_test/ability_manager_stub_mock_second_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -351,7 +351,7 @@ public: } int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE) override + const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE, bool isSilent = false) override { return 0; } 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 3863558db5d399908e72c1a4ea97ce68cffd2531..660d1a744505d20939e43bf1574bfa829d401fe2 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 @@ -370,7 +370,7 @@ public: } int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE) override + const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE, bool isSilent = false) override { return 0; } diff --git a/test/unittest/ability_manager_client_branch_third_test/mock/include/ability_manager_stub_mock_test.h b/test/unittest/ability_manager_client_branch_third_test/mock/include/ability_manager_stub_mock_test.h index 916b58700fe34c1b2b3de186b0a3657c16c1dcd0..b27b0e36f800e96f1e059f7d67b26c3ff99da386 100644 --- a/test/unittest/ability_manager_client_branch_third_test/mock/include/ability_manager_stub_mock_test.h +++ b/test/unittest/ability_manager_client_branch_third_test/mock/include/ability_manager_stub_mock_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -319,7 +319,7 @@ public: } int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE) override + const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE, bool isSilent = false) override { return 0; } diff --git a/test/unittest/ability_manager_proxy_fifth_test/ability_manager_stub_mock.h b/test/unittest/ability_manager_proxy_fifth_test/ability_manager_stub_mock.h index 9643e1fb1f848e27e233b0f289d96c94e03542a3..b9559de09e78b81827cbec38bfc7716331b7be46 100644 --- a/test/unittest/ability_manager_proxy_fifth_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_proxy_fifth_test/ability_manager_stub_mock.h @@ -356,8 +356,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); diff --git a/test/unittest/ability_manager_proxy_fourth_test/ability_manager_stub_mock.h b/test/unittest/ability_manager_proxy_fourth_test/ability_manager_stub_mock.h index 001d1dc358514546e250ce449e7a3ec88d425afc..9c28fbf1e34b2aeb57c860cd873c9f014d14fc56 100644 --- a/test/unittest/ability_manager_proxy_fourth_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_proxy_fourth_test/ability_manager_stub_mock.h @@ -356,8 +356,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); diff --git a/test/unittest/ability_manager_proxy_second_test/ability_manager_stub_mock.h b/test/unittest/ability_manager_proxy_second_test/ability_manager_stub_mock.h index de1d65e657ab6ac334bf029fe2a8d68bbeff1b68..6d842980b18ca517df4651354e657334d9756444 100644 --- a/test/unittest/ability_manager_proxy_second_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_proxy_second_test/ability_manager_stub_mock.h @@ -356,8 +356,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); diff --git a/test/unittest/ability_manager_proxy_sixth_test/ability_manager_stub_mock.h b/test/unittest/ability_manager_proxy_sixth_test/ability_manager_stub_mock.h index de1d65e657ab6ac334bf029fe2a8d68bbeff1b68..6d842980b18ca517df4651354e657334d9756444 100644 --- a/test/unittest/ability_manager_proxy_sixth_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_proxy_sixth_test/ability_manager_stub_mock.h @@ -356,8 +356,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); diff --git a/test/unittest/ability_manager_proxy_test/ability_manager_proxy_test.cpp b/test/unittest/ability_manager_proxy_test/ability_manager_proxy_test.cpp index 8760b8b53cbb9ac585ba419542c7c2103a1a65d5..49af01d529d05c1abfd6f3eced456c749b77b207 100644 --- a/test/unittest/ability_manager_proxy_test/ability_manager_proxy_test.cpp +++ b/test/unittest/ability_manager_proxy_test/ability_manager_proxy_test.cpp @@ -896,6 +896,26 @@ HWTEST_F(AbilityManagerProxyTest, AbilityManagerProxy_StartAbilityByCall_002, Te EXPECT_EQ(static_cast(AbilityManagerInterfaceCode::START_CALL_ABILITY), mock_->code_); } +/* + * Feature: AbilityManagerService + * Function: StartAbilityByCall + * SubFunction: NA + * FunctionPoints: AbilityManagerService StartAbilityByCall + * EnvConditions: NA + * CaseDescription: Verify the function StartAbilityByCall is normal flow. + */ +HWTEST_F(AbilityManagerProxyTest, AbilityManagerProxy_StartAbilityByCall_003, TestSize.Level1) +{ + Want want; + sptr callerToken = sptr(new (std::nothrow) MockAbilityToken()); + sptr connect = new AbilityConnectCallback(); + EXPECT_CALL(*mock_, SendRequest(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(mock_.GetRefPtr(), &AbilityManagerStubMock::InvokeSendRequest)); + EXPECT_EQ(proxy_->StartAbilityByCall(want, connect, callerToken, -1, true), ERR_OK); + EXPECT_EQ(static_cast(AbilityManagerInterfaceCode::START_CALL_ABILITY), mock_->code_); +} + /* * Feature: AbilityManagerService * Function: ReleaseCall 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 0fa986f62274ecf86265189b53b2acade44397d0..4cb5157ecff12aeb57ee01917f48b60737d64e84 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 @@ -364,8 +364,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); diff --git a/test/unittest/ability_manager_proxy_third_test/ability_manager_stub_mock.h b/test/unittest/ability_manager_proxy_third_test/ability_manager_stub_mock.h index b12fdc033e98d3a0e3dc9f4645d0c80cdd9b1255..b443ad9e07c78b5d1fae762c80f7998a459483dc 100644 --- a/test/unittest/ability_manager_proxy_third_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_proxy_third_test/ability_manager_stub_mock.h @@ -324,8 +324,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4( - StartAbilityByCall, int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t& missionId, const sptr& shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr& token, const int32_t& resultCode, const int32_t& uniqueId, WantParams& wantParam)); 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 3b447c5fceae38eaee69209e8389806cc7415ab5..cc1dac2376ae126c490d7cac1f1e7a74834e13f6 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 @@ -69,8 +69,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); MOCK_METHOD4(ShareDataDone, int32_t(const sptr &token, const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam)); 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 20e1a0749f63f18a4066a40ad5975f6261584357..f87fe1e2e185211b62e2a68ebf8044e52c957bf4 100644 --- a/test/unittest/ability_manager_test/ability_manager_stub_mock.h +++ b/test/unittest/ability_manager_test/ability_manager_stub_mock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -356,7 +356,7 @@ public: } int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) override + const sptr& callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, bool isSilent = false) override { return 0; } diff --git a/test/unittest/app_service_extension_context_test/ability_manager_stub_mock.h b/test/unittest/app_service_extension_context_test/ability_manager_stub_mock.h index cf600291074be499713ec85972cbbde0fe1fca4e..a1966874fbb4e2074449349d2289c9bd55e54d72 100644 --- a/test/unittest/app_service_extension_context_test/ability_manager_stub_mock.h +++ b/test/unittest/app_service_extension_context_test/ability_manager_stub_mock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -327,7 +327,7 @@ public: } int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE) override + const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE, bool isSilent = false) override { return 0; } diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp index 468a327aad5418e72154f81703e19f842ba73904..b46525e93d3065adb8f5a5deb98d7f7556b60099 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp @@ -487,19 +487,19 @@ ErrCode AbilityManagerClient::GetMissionIdByToken(sptr token, int return MyFlag::GetInstance()->GetMissionIdByToken(); } -ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr connect) +ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr connect, bool isSilent) { return ERR_OK; } ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr connect, - sptr callToken, int32_t accountId) + sptr callToken, int32_t accountId, bool isSilent) { return ERR_OK; } ErrCode AbilityManagerClient::StartAbilityByCallWithErrMsg(const Want &want, sptr connect, - sptr callToken, int32_t accountId, std::string &errMsg) + sptr callToken, int32_t accountId, std::string &errMsg, bool isSilent) { return ERR_OK; } 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 cf600291074be499713ec85972cbbde0fe1fca4e..a1966874fbb4e2074449349d2289c9bd55e54d72 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -327,7 +327,7 @@ public: } int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE) override + const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE, bool isSilent = false) override { return 0; } 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 346bccbf3c95f8d7b6ac98bc542f4cdce9ac813a..7085639344e10e2c618f123b45db99f1b5028a87 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -143,8 +143,8 @@ public: MOCK_METHOD1(GetAbilityRunningInfos, int(std::vector& info)); MOCK_METHOD2(GetExtensionRunningInfos, int(int upperLimit, std::vector& info)); MOCK_METHOD1(GetProcessRunningInfos, int(std::vector& info)); - MOCK_METHOD4(StartAbilityByCall, - int(const Want&, const sptr&, const sptr&, int32_t)); + MOCK_METHOD5(StartAbilityByCall, + int(const Want&, const sptr&, const sptr&, int32_t, bool)); MOCK_METHOD1(GetMissionIdByToken, int32_t(const sptr& token)); MOCK_METHOD2(GetAbilityTokenByCalleeObj, void(const sptr &callStub, sptr &token)); MOCK_METHOD2(AcquireShareData, int32_t(const int32_t &missionId, const sptr &shareData)); diff --git a/tools/test/mock/mock_ability_manager_stub.h b/tools/test/mock/mock_ability_manager_stub.h index b2b0181584a478e2c6f17b8667cb265a05efca4b..0f0e3a697c58b0d677bd7d6cbdeb62727fccac0f 100644 --- a/tools/test/mock/mock_ability_manager_stub.h +++ b/tools/test/mock/mock_ability_manager_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -186,7 +186,7 @@ public: } virtual int StartAbilityByCall(const Want& want, const sptr& connect, - const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE) + const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE, bool isSilent = false) { return 0; }