diff --git a/frameworks/ans/IAnsManager.idl b/frameworks/ans/IAnsManager.idl index 92ecf2280fedd1bbc89dd3d0556e2eda8696e113..e33538fdc19fd45c79de0e42a63fa56b006a7e30 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 0eb075a91aa5c0c45a5569211e0236b2a2f2e162..b14349d1ceb502ca048e53f9dba4d7af7e314684 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 dcfc0e932feb7893172a53184df5ea38d5a19b2f..00a99784fdb18fcc184322370bf381c2cb92afa0 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); } } }