From 7c026587baba3202849207c359b64728c9207588 Mon Sep 17 00:00:00 2001 From: yangjun Date: Fri, 20 Jun 2025 15:14:45 +0800 Subject: [PATCH] bugfix: 1. default operation is not disturbing while get white list failed. 2. get current active userId while removing bundle Signed-off-by: yangjun --- services/ans/src/advanced_notification_service.cpp | 3 ++- services/ans/src/advanced_notification_utils.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77b40d6a5..cb4e0bd2a 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 f575aaecb..cd414b432 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; } -- Gitee