From 40c3334430bbb89479e8c2a29ccadf8644dec73e Mon Sep 17 00:00:00 2001 From: "yaoruozi1@huawei.com" Date: Tue, 14 Jan 2025 11:31:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=90=AF=E6=B8=85=E7=90=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yaoruozi1@huawei.com --- services/backup_sa/src/module_ipc/service.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/services/backup_sa/src/module_ipc/service.cpp b/services/backup_sa/src/module_ipc/service.cpp index 6f84ebb5b..732585bdb 100644 --- a/services/backup_sa/src/module_ipc/service.cpp +++ b/services/backup_sa/src/module_ipc/service.cpp @@ -1062,10 +1062,18 @@ void Service::ExtConnectDied(const string &callName) if (backUpConnection != nullptr && backUpConnection->IsExtAbilityConnected()) { backUpConnection->DisconnectBackupExtAbility(); } + bool needCleanData = session_->GetClearDataFlag(callName); + if (!needCleanData) { + HILOGE("Current extension is died, but not need clean data, bundleName:%{public}s", callName.c_str()); + ClearSessionAndSchedInfo(callName); + NoticeClientFinish(callName, BError(BError::Codes::EXT_ABILITY_DIED)); + return; + } session_->SetServiceSchedAction(callName, BConstants::ServiceSchedAction::CLEAN); auto ret = LaunchBackupExtension(callName); if (ret) { /* Clear Session before notice client finish event */ + HILOGE("Current bundle launch extension failed, bundleName:%{public}s", callName.c_str()); ClearSessionAndSchedInfo(callName); } /* Notice Client Ext Ability Process Died */ @@ -1246,6 +1254,7 @@ void Service::ExtConnectDone(string bundleName) BConstants::ServiceSchedAction curSchedAction = session_->GetServiceSchedAction(bundleName); if (curSchedAction == BConstants::ServiceSchedAction::CLEAN) { + HILOGI("Current bundle will execute clean task, bundleName:%{public}s", bundleName.c_str()); sched_->Sched(bundleName); return; } @@ -1254,7 +1263,11 @@ void Service::ExtConnectDone(string bundleName) session_->SetServiceSchedAction(bundleName, BConstants::ServiceSchedAction::CLEAN); } else { session_->SetServiceSchedAction(bundleName, BConstants::ServiceSchedAction::RUNNING); - AddClearBundleRecord(bundleName); + bool needCleanData = session_->GetClearDataFlag(bundleName); + if (needCleanData) { + HILOGI("Current bundle need clean data, bundleName:%{public}s", bundleName.c_str()); + AddClearBundleRecord(bundleName); + } } sched_->Sched(bundleName); } catch (...) { @@ -1579,6 +1592,7 @@ ErrCode Service::ClearResidualBundleData(const std::string &bundleName) throw BError(BError::Codes::SA_INVAL_ARG, "Extension backup Proxy is empty"); } // 通知ext清理 + HILOGI("Current bundle will clean extension data, bundleName:%{public}s", bundleName.c_str()); ErrCode res = proxy->HandleClear(); if (backUpConnection->IsExtAbilityConnected()) { backUpConnection->DisconnectBackupExtAbility(); -- Gitee