From 04a81285207ecf9d939ee322442b894f69737695 Mon Sep 17 00:00:00 2001 From: lizhengxing Date: Thu, 11 Sep 2025 16:11:50 +0800 Subject: [PATCH] Getdatasize Fix Bug Signed-off-by: lizhengxing --- services/backup_sa/src/module_ipc/sub_service.cpp | 5 +++++ tests/unittests/backup_sa/module_ipc/service_other_test.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/services/backup_sa/src/module_ipc/sub_service.cpp b/services/backup_sa/src/module_ipc/sub_service.cpp index de1d44c84..06e0bb232 100644 --- a/services/backup_sa/src/module_ipc/sub_service.cpp +++ b/services/backup_sa/src/module_ipc/sub_service.cpp @@ -1099,7 +1099,12 @@ ErrCode Service::GetBackupDataSize(bool isPreciseScan, const std::vectorDecreaseSessionCnt(__PRETTY_FUNCTION__); return BError(BError::Codes::SA_INVAL_ARG, "verify caller failed"); } + const int userId = GetUserIdDefault(); + BundleMgrAdapter::CreatBackupEnv(bundleNameList, userId); CyclicSendScannedInfo(isPreciseScan, bundleNameList); + for (const auto &bundleIncrementalData : bundleNameList) { + ClearIncrementalStatFile(userId, bundleIncrementalData.bundleName); + } return BError(BError::Codes::OK); } catch (...) { session_->DecreaseSessionCnt(__PRETTY_FUNCTION__); diff --git a/tests/unittests/backup_sa/module_ipc/service_other_test.cpp b/tests/unittests/backup_sa/module_ipc/service_other_test.cpp index 5cace8b41..abea36023 100644 --- a/tests/unittests/backup_sa/module_ipc/service_other_test.cpp +++ b/tests/unittests/backup_sa/module_ipc/service_other_test.cpp @@ -171,6 +171,8 @@ void Service::RemoveExtensionMutex(const BundleName&) {} void Service::CreateDirIfNotExist(const std::string&) {} void SvcSessionManager::UpdateDfxInfo(const std::string &bundleName, uint64_t uniqId) {} + +void Service::ClearIncrementalStatFile(int32_t userId, const string &bundleName) {} } class BThreadPool { -- Gitee