From a05446490837bcc2adff39726106659d2001beb7 Mon Sep 17 00:00:00 2001 From: zhengzhuolan Date: Thu, 10 Apr 2025 19:59:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9AnsSubscriberIDL=E5=8C=96?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhengzhuolan --- frameworks/ans/IAnsManager.idl | 2 +- frameworks/ans/IAnsSubscriber.idl | 8 ++++---- .../ans/src/notification_subscriber_manager.cpp | 13 +++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/frameworks/ans/IAnsManager.idl b/frameworks/ans/IAnsManager.idl index 92ecf2280..e33538fdc 100644 --- a/frameworks/ans/IAnsManager.idl +++ b/frameworks/ans/IAnsManager.idl @@ -277,7 +277,7 @@ interface OHOS.Notification.IAnsManager { void AllowUseReminder([in] String bundleName, [out] boolean isAllowUseReminder); - void UpdateNotificationTimerByUid([in] int uid, [in] boolean isPaused); + [oneway] void UpdateNotificationTimerByUid([in] int uid, [in] boolean isPaused); void DisableNotificationFeature([in] sptr notificationDisable); diff --git a/frameworks/ans/IAnsSubscriber.idl b/frameworks/ans/IAnsSubscriber.idl index 0eb075a91..b14349d1c 100644 --- a/frameworks/ans/IAnsSubscriber.idl +++ b/frameworks/ans/IAnsSubscriber.idl @@ -27,8 +27,8 @@ interface OHOS.Notification.IAnsSubscriber { [oneway] void OnConsumed([in] sptr notification, [in] sptr notificationMap); [oneway] void OnConsumed([in] sptr notification); - [ipcincapacity 520] void OnConsumedWithMaxCapacity([in] sptr notification, [in] sptr notificationMap); - [ipcincapacity 520] void OnConsumedWithMaxCapacity([in] sptr notification); + [ipcincapacity 520, oneway] void OnConsumedWithMaxCapacity([in] sptr notification, [in] sptr notificationMap); + [ipcincapacity 520, oneway] void OnConsumedWithMaxCapacity([in] sptr notification); [ipcincapacity 520, oneway] void OnConsumedList([in] sptr[] notifications, [in] sptr notificationMap); [ipcincapacity 520, oneway] void OnConsumedList([in] sptr[] notifications); @@ -36,8 +36,8 @@ interface OHOS.Notification.IAnsSubscriber { [oneway] void OnCanceled([in] sptr notification, [in] sptr notificationMap, [in] int deleteReason); [oneway] void OnCanceled([in] sptr notification, [in] int deleteReason); - [ipcincapacity 520] void OnCanceledWithMaxCapacity([in] sptr notification, [in] sptr notificationMap, [in] int deleteReason); - [ipcincapacity 520] void OnCanceledWithMaxCapacity([in] sptr notification, [in] int deleteReason); + [ipcincapacity 520, oneway] void OnCanceledWithMaxCapacity([in] sptr notification, [in] sptr notificationMap, [in] int deleteReason); + [ipcincapacity 520, oneway] void OnCanceledWithMaxCapacity([in] sptr notification, [in] int deleteReason); [ipcincapacity 520, oneway] void OnCanceledList([in] sptr[] notifications, [in] sptr notificationMap, [in] int deleteReason); [ipcincapacity 520, oneway] void OnCanceledList([in] sptr[] notifications, [in] int deleteReason); diff --git a/services/ans/src/notification_subscriber_manager.cpp b/services/ans/src/notification_subscriber_manager.cpp index dcfc0e932..00a99784f 100644 --- a/services/ans/src/notification_subscriber_manager.cpp +++ b/services/ans/src/notification_subscriber_manager.cpp @@ -726,12 +726,13 @@ void NotificationSubscriberManager::BatchNotifyCanceledInner(const std::vector", currNotifications.size()); - if (record->subscriber != nullptr) { - if (notificationMap != nullptr) { - record->subscriber->OnCanceledList(currNotifications, notificationMap, deleteReason); - } else { - record->subscriber->OnCanceledList(currNotifications, deleteReason); - } + if (record->subscriber == nullptr) { + return; + } + if (notificationMap != nullptr) { + record->subscriber->OnCanceledList(currNotifications, notificationMap, deleteReason); + } else { + record->subscriber->OnCanceledList(currNotifications, deleteReason); } } } -- Gitee