mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
@@ -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();
|
||||
|
||||
@@ -125,16 +125,11 @@ bool LocalCallRecord::RemoveCaller(const std::shared_ptr<CallerCallBack>& 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,11 +39,6 @@ public:
|
||||
void AddCaller(const std::shared_ptr<CallerCallBack> &callback);
|
||||
bool RemoveCaller(const std::shared_ptr<CallerCallBack> &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<IRemoteObject> GetRemoteObject() const;
|
||||
void InvokeCallBack() const;
|
||||
|
||||
-1
@@ -935,7 +935,6 @@ HWTEST_F(LocalCallContainerTest, Local_Call_Container_OnAbilityDisconnectDone_05
|
||||
connect->OnAbilityDisconnectDone(elementName, code);
|
||||
|
||||
EXPECT_TRUE(isOnReleaseCalled);
|
||||
EXPECT_EQ(receivedReason, "release");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user