diff --git a/frameworks/js/napi/src/publish.cpp b/frameworks/js/napi/src/publish.cpp index 00a4917ee48dbc466c0389d7390b9a25b7722b1b..f19f339b92b822a0fd4d40e118e4c65d0c65a75e 100644 --- a/frameworks/js/napi/src/publish.cpp +++ b/frameworks/js/napi/src/publish.cpp @@ -282,8 +282,8 @@ napi_value ParseShowOptions(const napi_env &env, const napi_callback_info &info, wants, extraInfo); std::shared_ptr context = AbilityRuntime::Context::GetApplicationContext(); - std::shared_ptr wantAgent = - WantAgentHelper::GetWantAgent(context, wantAgentInfo); + std::shared_ptr wantAgent = nullptr; + WantAgentHelper::GetWantAgent(context, wantAgentInfo, wantAgent); params.request.SetWantAgent(wantAgent); } diff --git a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp index 58531df1aaba277a426d5e3c8717d57eae4ebc5e..86480ca49a441c91219a1a9f391045014f0079ea 100644 --- a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp +++ b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp @@ -1563,8 +1563,8 @@ HWTEST_F(AnsInnerKitsModulePublishTest, ANS_Interface_MT_Publish_09000, Function std::shared_ptr context = std::make_shared(); - std::shared_ptr wantAgent = - AbilityRuntime::WantAgent::WantAgentHelper::GetWantAgent(context, paramsInfo); + std::shared_ptr wantAgent = nullptr; + AbilityRuntime::WantAgent::WantAgentHelper::GetWantAgent(context, paramsInfo, wantAgent); EXPECT_NE(wantAgent, nullptr); NotificationRequest req; diff --git a/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp b/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp index 09ac942341b3af708d5594118c57aee652c350cb..adce696dc76fc7cdc49e86b6d15a785048a25e7f 100644 --- a/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp +++ b/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp @@ -487,7 +487,8 @@ void NotificationFuzzTestManager::RegisterWantAgentHelper() callFunctionMap_.emplace("WantAgentHelperGetWantAgentAppExecFwkparamsInfo", []() { std::shared_ptr context = OHOS::AbilityRuntime::Context::GetApplicationContext(); const OHOS::AbilityRuntime::WantAgent::WantAgentInfo paramsInfo = *GetParamWantAgentInfo(); - OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::GetWantAgent(context, paramsInfo); + std::shared_ptr wantAgent = nullptr; + OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::GetWantAgent(context, paramsInfo, wantAgent); }); callFunctionMap_.emplace("WantAgentHelperGetWantAgentparamsInfo", []() { @@ -517,21 +518,19 @@ void NotificationFuzzTestManager::RegisterWantAgentHelper() const std::shared_ptr agent = GetParamWantAgent(); const std::shared_ptr otherAgent = GetParamWantAgent(); - OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::JudgeEquality(agent, otherAgent); - }); - callFunctionMap_.emplace("WantAgentHelperGetHashCode", []() { - const std::shared_ptr agent = GetParamWantAgent(); - OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::GetHashCode(agent); + OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::IsEquals(agent, otherAgent); }); callFunctionMap_.emplace("WantAgentHelperGetBundleName", []() { const std::shared_ptr agent = GetParamWantAgent(); - OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::GetBundleName(agent); + std::string bundleName = ""; + OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::GetBundleName(agent, bundleName); }); callFunctionMap_.emplace("WantAgentHelperGetUid", []() { const std::shared_ptr agent = GetParamWantAgent(); - OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::GetUid(agent); + int32_t uid = -1; + OHOS::AbilityRuntime::AbilityRuntime::WantAgent::WantAgentHelper::GetUid(agent, uid); }); callFunctionMap_.emplace("WantAgentHelperGetWant", []() {