From 28ead8418ba6fe1346ba82f478f10e19ec8ef45c Mon Sep 17 00:00:00 2001 From: HengBai Date: Thu, 4 Sep 2025 21:38:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zxf --- .../include/bundle_active_user_service.h | 6 ++---- .../packageusage/src/bundle_active_user_service.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/services/packageusage/include/bundle_active_user_service.h b/services/packageusage/include/bundle_active_user_service.h index 299f1c4..f96f905 100644 --- a/services/packageusage/include/bundle_active_user_service.h +++ b/services/packageusage/include/bundle_active_user_service.h @@ -111,10 +111,8 @@ private: const std::string& bundleName, const int32_t deletedUid, const int32_t appIndex); void DeleteMemEvent(const std::shared_ptr& currentStats, const std::string& bundleName, const int32_t deletedUid, const int32_t appIndex); - void DeleteMemRecords(const std::shared_ptr& currentStats, const std::string& bundleName, - const int32_t deletedUid, const int32_t appIndex); - void DeleteMemPackageUidSet(const std::shared_ptr& currentStats, - const std::string& bundleName, const int32_t deletedUid, const int32_t appIndex); + void DeleteMemRecords(const std::string& bundleName, const int32_t deletedUid, const int32_t appIndex); + void DeleteMemPackageUidSet(const std::string& bundleName, const int32_t deletedUid, const int32_t appIndex); void UpdateExpiryDate(const bool timeChanged, BundleActiveCalendar& tmpCalendar, const int64_t timeStamp); }; } // namespace DeviceUsageStats diff --git a/services/packageusage/src/bundle_active_user_service.cpp b/services/packageusage/src/bundle_active_user_service.cpp index 23685dd..19f9676 100644 --- a/services/packageusage/src/bundle_active_user_service.cpp +++ b/services/packageusage/src/bundle_active_user_service.cpp @@ -58,10 +58,10 @@ void BundleActiveUserService::DeleteUninstalledBundleStats(const std::string& bu if (it != nullptr) { DeleteMemUsageStats(it, bundleName, uid, appIndex); DeleteMemEvent(it, bundleName, uid, appIndex); - DeleteMemRecords(it, bundleName, uid, appIndex); - DeleteMemPackageUidSet(it, bundleName, uid, appIndex); } } + DeleteMemRecords(bundleName, uid, appIndex); + DeleteMemPackageUidSet(bundleName, uid, appIndex); database_.OnPackageUninstalled(userId_, bundleName, uid, appIndex); } @@ -107,8 +107,8 @@ void BundleActiveUserService::DeleteMemEvent(const std::shared_ptr& currentStats, - const std::string& bundleName, const int32_t deletedUid, const int32_t appIndex) +void BundleActiveUserService::DeleteMemRecords(const std::string& bundleName, const int32_t deletedUid, + const int32_t appIndex) { if (appIndex != MAIN_APP_INDEX) { for (auto it = moduleRecords_.begin(); it != moduleRecords_.end();) { @@ -130,8 +130,8 @@ void BundleActiveUserService::DeleteMemRecords(const std::shared_ptr& currentStats, - const std::string& bundleName, const int32_t deletedUid, const int32_t appIndex) +void BundleActiveUserService::DeleteMemPackageUidSet(const std::string& bundleName, + const int32_t deletedUid, const int32_t appIndex) { if (appIndex != MAIN_APP_INDEX) { BundleActiveBundleMgrHelper::GetInstance()->DeletePackageUid(bundleName, deletedUid); -- Gitee