diff --git a/services/ans/include/advanced_notification_service.h b/services/ans/include/advanced_notification_service.h index 87f745fb76c99e5c0575b73205feb45efa1eff06..2607a305663848ed3c5a4837767bb1dc869ee5d0 100644 --- a/services/ans/include/advanced_notification_service.h +++ b/services/ans/include/advanced_notification_service.h @@ -809,7 +809,7 @@ private: ErrCode GetAppTargetBundle(const sptr &bundleOption, sptr &targetBundle); bool PublishSlotChangeCommonEvent(const sptr &bundleOption); - void ReportHasSeenEvent(const int32_t userId, const std::string &bundleName); + void ReportInfoToResourceSchedule(const int32_t userId, const std::string &bundleName); private: static sptr instance_; diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index c7903ff54704c81f170b82195da51ef6ef358e52..77d4781dc2e518c3e832150ea48f5dfbe5f74507 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -457,6 +457,7 @@ ErrCode AdvancedNotificationService::PublishPreparedNotification( } UpdateRecentNotification(record->notification, false, 0); sptr sortingMap = GenerateSortingMap(); + ReportInfoToResourceSchedule(request->GetCreatorUserId(), bundleOption->GetBundleName()); NotificationSubscriberManager::GetInstance()->NotifyConsumed(record->notification, sortingMap); #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED DoDistributedPublish(bundleOption, record); @@ -478,11 +479,10 @@ ErrCode AdvancedNotificationService::Publish(const std::string &label, const spt if (result != ERR_OK) { return result; } - ReportHasSeenEvent(request->GetCreatorUserId(), bundleOption->GetBundleName()); return PublishPreparedNotification(request, bundleOption); } -void AdvancedNotificationService::ReportHasSeenEvent(const int32_t userId, const std::string &bundleName) +void AdvancedNotificationService::ReportInfoToResourceSchedule(const int32_t userId, const std::string &bundleName) { DeviceUsageStats::BundleActiveEvent event(DeviceUsageStats::BundleActiveEvent::NOTIFICATION_SEEN, bundleName); DeviceUsageStats::BundleActiveClient::GetInstance().ReportEvent(event, userId);