From 180dc660d6f9d7fd4b76fb91c9f31c15d088f430 Mon Sep 17 00:00:00 2001 From: "yangjun (CI)" Date: Mon, 9 Jun 2025 18:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=85=8D=E6=89=93=E6=89=B0?= =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E8=AF=BB=E5=8F=96dh=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangjun --- services/ans/src/clone/notification_clone_manager.cpp | 4 ++++ services/ans/src/notification_preferences_database.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/ans/src/clone/notification_clone_manager.cpp b/services/ans/src/clone/notification_clone_manager.cpp index d2bde8c4c..1a448dd02 100644 --- a/services/ans/src/clone/notification_clone_manager.cpp +++ b/services/ans/src/clone/notification_clone_manager.cpp @@ -36,6 +36,7 @@ namespace Notification { const int ANS_CLONE_ERROR = -1; const int32_t DEFAULT_APP_INDEX = -1; +constexpr int32_t DEFAULT_ANCO_APP_INDEX = 0; constexpr uint64_t NOTIFICATION_FDSAN_TAG = 0xD001203; constexpr uint64_t COMMON_FDSAN_TAG = 0; constexpr const char *CLONE_ITEM_BUNDLE_INFO = "notificationBundle"; @@ -309,6 +310,9 @@ void NotificationCloneManager::OnDhRestoreStart(const std::string bundleName, co if (iter->second != nullptr && iter->second->isDhSource()) { iter->second->OnRestoreStart(bundleName, DEFAULT_APP_INDEX, ZERO_USERID, uid); } + if (iter->first == CLONE_ITEM_DISTURB && iter->second != nullptr) { + iter->second->OnRestoreStart(bundleName, DEFAULT_ANCO_APP_INDEX, DEFAULT_USER_ID, uid); + } } } } diff --git a/services/ans/src/notification_preferences_database.cpp b/services/ans/src/notification_preferences_database.cpp index ea04217b4..53f912600 100644 --- a/services/ans/src/notification_preferences_database.cpp +++ b/services/ans/src/notification_preferences_database.cpp @@ -977,7 +977,7 @@ bool NotificationPreferencesDatabase::HandleDataBaseMap( if (result != ERR_OK) { return false; } - if (userid != currentUserId) { + if (userid != currentUserId && !(currentUserId == DEFAULT_USER_ID && userid == ZERO_USER_ID)) { continue; } NotificationBundleOption obj(value, StringToInt(uidItem->second)); -- Gitee