diff --git a/services/packageusage/include/bundle_active_user_service.h b/services/packageusage/include/bundle_active_user_service.h index 299f1c4adc3a202d2335282185e79480f4f31a1c..f96f90560d1ff49244da3805cb93b2c9c178608a 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 23685ddc50de09e962192668345c9a07959d08e4..19f9676199fe51d72c356536247e617c9bdfe77d 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);