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 97de333ab911e4f59baa6eaa29139c5a469b73c6..3908144a50faeddbc7bfd123b71d008acd582015 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 @@ -24,22 +24,7 @@ namespace OHOS::FileManagement::Backup { using namespace std; -BIncrementalBackupSession::~BIncrementalBackupSession() -{ - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceProxy::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } - deathRecipient_ = nullptr; -} +BIncrementalBackupSession::~BIncrementalBackupSession() {} unique_ptr BIncrementalBackupSession::Init(Callbacks callbacks) { @@ -112,7 +97,7 @@ void BIncrementalBackupSession::RegisterBackupServiceDied(function funct auto callback = [functor](const wptr &obj) { ServiceProxy::InvaildInstance(); - HILOGI("Backup service died"); + HILOGI("RegisterBackupServiceDied, Backup service died"); functor(); }; deathRecipient_ = sptr(new SvcDeathRecipient(callback)); 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 97468695aba6882cf56173692dbe3bb17eb7495b..28dfb51bffd6e34a20bc0853602f9104bc7669a2 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 @@ -24,22 +24,7 @@ namespace OHOS::FileManagement::Backup { using namespace std; -BIncrementalRestoreSession::~BIncrementalRestoreSession() -{ - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceProxy::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } - deathRecipient_ = nullptr; -} +BIncrementalRestoreSession::~BIncrementalRestoreSession() {} unique_ptr BIncrementalRestoreSession::Init(Callbacks callbacks) { @@ -206,7 +191,7 @@ void BIncrementalRestoreSession::RegisterBackupServiceDied(function func } auto callback = [functor](const wptr &obj) { - HILOGI("Backup service died"); + HILOGI("RegisterBackupServiceDied, Backup service died"); ServiceProxy::InvaildInstance(); functor(); }; 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 170a50db637afb7c6345fced6b262b52658855dd..a8a50a8645c2f466ec0673987ec98cb44a7ab8aa 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 @@ -25,23 +25,7 @@ namespace OHOS::FileManagement::Backup { using namespace std; -BIncrementalSessionRestoreAsync::~BIncrementalSessionRestoreAsync() -{ - if (!deathRecipient_) { - HILOGE("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceProxy::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } - callbacks_ = {}; - deathRecipient_ = nullptr; -} +BIncrementalSessionRestoreAsync::~BIncrementalSessionRestoreAsync() {} shared_ptr BIncrementalSessionRestoreAsync::Init(Callbacks callbacks) { 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 08e08533180e3c3367d5d9584a58b2926143084d..258bed60cca5cc33c38596e105eab4348e1fc6eb 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_backup.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_backup.cpp @@ -24,22 +24,7 @@ namespace OHOS::FileManagement::Backup { using namespace std; -BSessionBackup::~BSessionBackup() -{ - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceProxy::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } - deathRecipient_ = nullptr; -} +BSessionBackup::~BSessionBackup() {} unique_ptr BSessionBackup::Init(Callbacks callbacks) { @@ -112,7 +97,7 @@ void BSessionBackup::RegisterBackupServiceDied(std::function functor) auto callback = [functor](const wptr &obj) { ServiceProxy::InvaildInstance(); - HILOGI("Backup service died"); + HILOGI("RegisterBackupServiceDied, Backup service died"); functor(); }; deathRecipient_ = sptr(new SvcDeathRecipient(callback)); 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 21fbc125fcc9e8e41ce9380725dd1ea163d5f335..0771c972110e3f29a2cc74810723aa009660a418 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_restore.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_restore.cpp @@ -185,7 +185,7 @@ void BSessionRestore::RegisterBackupServiceDied(std::function functor) } auto callback = [functor](const wptr &obj) { - HILOGI("Backup service died"); + HILOGI("RegisterBackupServiceDied, Backup service died"); ServiceProxy::InvaildInstance(); functor(); }; 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 a60c564623d7e5bf79367356e579270ffb4b0fff..ccd0e62b9e34f332122bc880a079d0523be15f00 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 @@ -26,23 +26,7 @@ namespace OHOS::FileManagement::Backup { using namespace std; -BSessionRestoreAsync::~BSessionRestoreAsync() -{ - if (!deathRecipient_) { - HILOGI("Death Recipient is nullptr"); - return; - } - auto proxy = ServiceProxy::GetServiceProxyPointer(); - if (proxy == nullptr) { - return; - } - auto remoteObject = proxy->AsObject(); - if (remoteObject != nullptr) { - remoteObject->RemoveDeathRecipient(deathRecipient_); - } - callbacks_ = {}; - deathRecipient_ = nullptr; -} +BSessionRestoreAsync::~BSessionRestoreAsync() {} shared_ptr BSessionRestoreAsync::Init(Callbacks callbacks) { diff --git a/frameworks/native/backup_kit_inner/src/service_proxy.cpp b/frameworks/native/backup_kit_inner/src/service_proxy.cpp index 187f69ef7dc5926387ecf6b1b3e9d49ba57941a9..efdeaeede830e591d2146dfcb6bcb8a5686941fe 100644 --- a/frameworks/native/backup_kit_inner/src/service_proxy.cpp +++ b/frameworks/native/backup_kit_inner/src/service_proxy.cpp @@ -560,7 +560,7 @@ void ServiceProxy::ServiceProxyLoadCallback::OnLoadSystemAbilitySuccess(int32_t auto callback = [](const wptr &obj) { ServiceProxy::InvaildInstance(); - HILOGE("Backup service died"); + HILOGE("OnLoadSystemAbilitySuccess, Backup service died"); }; sptr deathRecipient = sptr(new SvcDeathRecipient(callback)); remoteObj->AddDeathRecipient(deathRecipient);