From 913a5c6609de0ff71a009b4bb764c17d511daa88 Mon Sep 17 00:00:00 2001 From: g00613291 Date: Tue, 10 Dec 2024 12:08:09 +0800 Subject: [PATCH] fix session occupy Signed-off-by: g00613291 --- services/backup_sa/src/module_ipc/service.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/backup_sa/src/module_ipc/service.cpp b/services/backup_sa/src/module_ipc/service.cpp index d68d6a415..10c187826 100644 --- a/services/backup_sa/src/module_ipc/service.cpp +++ b/services/backup_sa/src/module_ipc/service.cpp @@ -1720,6 +1720,14 @@ ErrCode Service::AppendBundlesClearSession(const std::vector &bundle } session_->IncreaseSessionCnt(__PRETTY_FUNCTION__); // BundleMgrAdapter::GetBundleInfos可能耗时 auto backupInfos = BundleMgrAdapter::GetBundleInfos(bundleNames, session_->GetSessionUserId()); + if (backupInfos.empty()) { + if (clearRecorder_ != nullptr) { + clearRecorder_->DeleteConfigFile(); + } + HILOGE("AppendBundles clear session error, backupInfos is empty"); + session_->DecreaseSessionCnt(__PRETTY_FUNCTION__); + return EPERM; + } std::vector supportBundleNames; for (auto info : backupInfos) { std::string bundleNameIndexStr = BJsonUtil::BuildBundleNameIndexInfo(info.name, info.appIndex); -- Gitee