diff --git a/services/backup_sa/src/module_ipc/service.cpp b/services/backup_sa/src/module_ipc/service.cpp index 5cb873aed29797d90ddf24213449cae21c32c206..00d40948fc9fe09a92d7045fec5522901c6bd0f9 100644 --- a/services/backup_sa/src/module_ipc/service.cpp +++ b/services/backup_sa/src/module_ipc/service.cpp @@ -1237,6 +1237,7 @@ void Service::ExtConnectDone(string bundleName) return; } if (curSchedAction == BConstants::ServiceSchedAction::CLEAN) { + HILOGI("Current bundle will execute clean task, bundleName:%{public}s", bundleName.c_str()); sched_->Sched(bundleName); return; } @@ -1245,7 +1246,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 (...) { @@ -1547,6 +1552,7 @@ ErrCode Service::ClearResidualBundleData(const std::string &bundleName) return BError(BError::Codes::SA_INVAL_ARG); } // 通知ext清理 + HILOGI("Current bundle will clean extension data, bundleName:%{public}s", bundleName.c_str()); ErrCode res = proxy->HandleClear(); if (backUpConnection->IsExtAbilityConnected()) { backUpConnection->DisconnectBackupExtAbility(); diff --git a/services/backup_sa/src/module_ipc/sub_service.cpp b/services/backup_sa/src/module_ipc/sub_service.cpp index 4664c5f98dfd2f95912f32b643559f987df0d5ab..5851ba5cb76147764f67ad689a531b40f3c1baa9 100644 --- a/services/backup_sa/src/module_ipc/sub_service.cpp +++ b/services/backup_sa/src/module_ipc/sub_service.cpp @@ -442,10 +442,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 */