diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77b40d6a59d4edc1796ffe6a3e41cd616a738576..cb4e0bd2aab7607517fede5d9f286ff70b06fdd5 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -874,14 +874,15 @@ void AdvancedNotificationService::CheckDoNotDisturbProfile(const std::shared_ptr if (NotificationPreferences::GetInstance()->GetDoNotDisturbProfile(atoll(profileId.c_str()), userId, profile) != ERR_OK) { ANS_LOGE("profile failed. pid: %{public}s, userid: %{public}d", profileId.c_str(), userId); - //ceshi message.Message("profileid:" + profileId + ",userid:" + std::to_string(userId)); NotificationAnalyticsUtil::ReportModifyEvent(message.BranchId(BRANCH_8)); + DoNotDisturbUpdataReminderFlags(record); return; } if (profile == nullptr) { ANS_LOGE("The do not disturb profile is nullptr."); NotificationAnalyticsUtil::ReportModifyEvent(message.BranchId(BRANCH_9)); + DoNotDisturbUpdataReminderFlags(record); return; } auto uid = record->bundleOption->GetUid(); diff --git a/services/ans/src/advanced_notification_utils.cpp b/services/ans/src/advanced_notification_utils.cpp index f575aaecb9bbf1951a6325ddcfe42ac2ae4f3c0a..cd414b432ffd33c9c3af8e82d8531d7b8780b6b3 100644 --- a/services/ans/src/advanced_notification_utils.cpp +++ b/services/ans/src/advanced_notification_utils.cpp @@ -553,7 +553,7 @@ void AdvancedNotificationService::RemoveDoNotDisturbProfileTrustList( { ANS_LOGD("Called."); int32_t userId = 0; - if (AccountSA::OsAccountManager::GetOsAccountLocalIdFromUid(bundleOption->GetUid(), userId) != ERR_OK) { + if (OsAccountManagerHelper::GetInstance().GetCurrentActiveUserId(userId) != ERR_OK) { ANS_LOGE("Failed to get active user id."); return; }