From f4b5b22333e3148bc3797852de2f30c6f0dfdacb Mon Sep 17 00:00:00 2001 From: "yaoruozi1@huawei.com" Date: Fri, 28 Mar 2025 16:44:48 +0800 Subject: [PATCH] remove the destructor part of the logic Signed-off-by: yaoruozi1@huawei.com --- .../src/b_incremental_backup_session.cpp | 13 +------------ .../src/b_incremental_restore_session.cpp | 13 +------------ .../src/b_incremental_session_restore_async.cpp | 13 +------------ .../backup_kit_inner/src/b_session_backup.cpp | 13 +------------ .../backup_kit_inner/src/b_session_restore.cpp | 13 +------------ .../src/b_session_restore_async.cpp | 13 +------------ 6 files changed, 6 insertions(+), 72 deletions(-) diff --git a/frameworks/native/backup_kit_inner/src/b_incremental_backup_session.cpp b/frameworks/native/backup_kit_inner/src/b_incremental_backup_session.cpp index 2413f9de2..731e23cdf 100644 --- a/frameworks/native/backup_kit_inner/src/b_incremental_backup_session.cpp +++ b/frameworks/native/backup_kit_inner/src/b_incremental_backup_session.cpp @@ -26,18 +26,7 @@ using namespace std; BIncrementalBackupSession::~BIncrementalBackupSession() { - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceClient::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } + HILOGE("BIncrementalBackupSession Destory"); deathRecipient_ = nullptr; } diff --git a/frameworks/native/backup_kit_inner/src/b_incremental_restore_session.cpp b/frameworks/native/backup_kit_inner/src/b_incremental_restore_session.cpp index 461763e15..b0f8179ce 100644 --- a/frameworks/native/backup_kit_inner/src/b_incremental_restore_session.cpp +++ b/frameworks/native/backup_kit_inner/src/b_incremental_restore_session.cpp @@ -26,18 +26,7 @@ using namespace std; BIncrementalRestoreSession::~BIncrementalRestoreSession() { - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceClient::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } + HILOGE("BIncrementalRestoreSession Destory"); deathRecipient_ = nullptr; } diff --git a/frameworks/native/backup_kit_inner/src/b_incremental_session_restore_async.cpp b/frameworks/native/backup_kit_inner/src/b_incremental_session_restore_async.cpp index fa1eb7624..d5925422f 100644 --- a/frameworks/native/backup_kit_inner/src/b_incremental_session_restore_async.cpp +++ b/frameworks/native/backup_kit_inner/src/b_incremental_session_restore_async.cpp @@ -27,18 +27,7 @@ using namespace std; BIncrementalSessionRestoreAsync::~BIncrementalSessionRestoreAsync() { - if (!deathRecipient_) { - HILOGE("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceClient::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } + HILOGE("BIncrementalSessionRestoreAsync Destory"); callbacks_ = {}; deathRecipient_ = nullptr; } diff --git a/frameworks/native/backup_kit_inner/src/b_session_backup.cpp b/frameworks/native/backup_kit_inner/src/b_session_backup.cpp index cbecc9896..863d696d5 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_backup.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_backup.cpp @@ -26,18 +26,7 @@ using namespace std; BSessionBackup::~BSessionBackup() { - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceClient::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } + HILOGE("BSessionBackup Destory"); deathRecipient_ = nullptr; } diff --git a/frameworks/native/backup_kit_inner/src/b_session_restore.cpp b/frameworks/native/backup_kit_inner/src/b_session_restore.cpp index d0a9d1644..501b054ba 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_restore.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_restore.cpp @@ -26,18 +26,7 @@ using namespace std; BSessionRestore::~BSessionRestore() { - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceClient::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } + HILOGE("BSessionRestore Destory"); deathRecipient_ = nullptr; } diff --git a/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp b/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp index f3f5276bd..8cc600b95 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp @@ -29,18 +29,7 @@ using namespace std; BSessionRestoreAsync::~BSessionRestoreAsync() { - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceClient::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } + HILOGE("BSessionRestoreAsync Destory"); callbacks_ = {}; deathRecipient_ = nullptr; } -- Gitee