diff --git a/frameworks/native/ability/ability_runtime/local_call_container.cpp b/frameworks/native/ability/ability_runtime/local_call_container.cpp index 91a68b2d44..5b1e2ce0bf 100644 --- a/frameworks/native/ability/ability_runtime/local_call_container.cpp +++ b/frameworks/native/ability/ability_runtime/local_call_container.cpp @@ -424,7 +424,7 @@ void CallerConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName &el TAG_LOGI(AAFwkTag::LOCAL_CALL, "Callee ability terminated, notify all callers"); // Notify all callers that callee is terminating with proper release reason - localCallRecord_->NotifyCallersReleased(ON_RELEASE); + localCallRecord_->OnCallStubDied(); // Remove record from container auto container = container_.lock(); diff --git a/frameworks/native/ability/ability_runtime/local_call_record.cpp b/frameworks/native/ability/ability_runtime/local_call_record.cpp index d84418b722..9aa59ce68a 100644 --- a/frameworks/native/ability/ability_runtime/local_call_record.cpp +++ b/frameworks/native/ability/ability_runtime/local_call_record.cpp @@ -125,16 +125,11 @@ bool LocalCallRecord::RemoveCaller(const std::shared_ptr& callba void LocalCallRecord::OnCallStubDied() { TAG_LOGI(AAFwkTag::LOCAL_CALL, "OnCallStubDied"); - NotifyCallersReleased(ON_DIED); -} - -void LocalCallRecord::NotifyCallersReleased(const std::string &releaseReason) -{ std::lock_guard lock(callersMutex_); for (auto& callBack : callers_) { if (callBack != nullptr) { - TAG_LOGI(AAFwkTag::LOCAL_CALL, "Notify caller released: %{public}s", releaseReason.c_str()); - callBack->InvokeOnRelease(releaseReason); + TAG_LOGI(AAFwkTag::LOCAL_CALL, "Notify caller released"); + callBack->InvokeOnRelease(ON_DIED); } } } diff --git a/interfaces/kits/native/ability/ability_runtime/local_call_record.h b/interfaces/kits/native/ability/ability_runtime/local_call_record.h index 1a3a19ad20..3175da5fa3 100644 --- a/interfaces/kits/native/ability/ability_runtime/local_call_record.h +++ b/interfaces/kits/native/ability/ability_runtime/local_call_record.h @@ -39,11 +39,6 @@ public: void AddCaller(const std::shared_ptr &callback); bool RemoveCaller(const std::shared_ptr &callback); void OnCallStubDied(); - /** - * @brief Notify all callers with specific release reason - * @param releaseReason The release reason (ON_DIED or ON_RELEASE) - */ - void NotifyCallersReleased(const std::string &releaseReason); void NotifyRemoteStateChanged(int32_t abilityState); sptr GetRemoteObject() const; void InvokeCallBack() const; diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/local_call_container_ut_test.cpp b/test/unittest/frameworks_kits_ability_ability_runtime_test/local_call_container_ut_test.cpp index 90b955e6ca..a419df4986 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/local_call_container_ut_test.cpp +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/local_call_container_ut_test.cpp @@ -935,7 +935,6 @@ HWTEST_F(LocalCallContainerTest, Local_Call_Container_OnAbilityDisconnectDone_05 connect->OnAbilityDisconnectDone(elementName, code); EXPECT_TRUE(isOnReleaseCalled); - EXPECT_EQ(receivedReason, "release"); } /**