• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16interface OHOS.Notification.IAnsDialogCallback;
17interface OHOS.Notification.IAnsSubscriberLocalLiveView;
18interface OHOS.Notification.IAnsSubscriber;
19interface OHOS.Notification.IAnsOperationCallback;
20
21sequenceable OHOS.Notification.NotificationBundleOption;
22sequenceable OHOS.Notification.NotificationDisable;
23sequenceable OHOS.Notification.NotificationDoNotDisturbDate;
24sequenceable OHOS.Notification.NotificationDoNotDisturbProfile;
25sequenceable OHOS.Notification.NotificationRequest;
26sequenceable OHOS.Notification.NotificationSlot;
27sequenceable OHOS.Notification.NotificationSubscribeInfo;
28sequenceable OHOS.Notification.NotificationOperationInfo;
29sequenceable OHOS.Notification.Notification;
30sequenceable OHOS.Notification.NotificationButtonOption;
31sequenceable OHOS.Notification.NotificationCheckRequest;
32sequenceable OHOS.IRemoteObject;
33
34interface OHOS.Notification.IAnsNotificationManager {
35    void Publish([in] String label, [in] sptr<NotificationRequest> notification);
36    [ipcincapacity 520] void PublishWithMaxCapacity([in] String label, [in] sptr<NotificationRequest> notification);
37
38    void PublishNotificationForIndirectProxy([in] sptr<NotificationRequest> notification);
39    [ipcincapacity 520] void PublishNotificationForIndirectProxyWithMaxCapacity([in] sptr<NotificationRequest> notification);
40
41    void Cancel([in] int notificationId, [in] String label, [in] String instanceKey);
42
43    void CancelAll([in] String instanceKey);
44
45    void CancelAsBundle([in] int notificationId, [in] String representativeBundle, [in] int userId);
46
47    void CancelAsBundle([in] sptr<NotificationBundleOption> bundleOption, [in] int notificationId);
48
49    void CancelAsBundle([in] sptr<NotificationBundleOption> bundleOption, [in] int notificationId, [in] int userId);
50
51    void GetActiveNotifications([out] sptr<NotificationRequest>[] notifications, [in] String instanceKey);
52
53    void GetActiveNotificationNums([out] unsigned long num);
54
55    void GetAllActiveNotifications([out] sptr<Notification>[] notifications);
56
57    void GetAllNotificationsBySlotType([out] sptr<Notification>[] notifications, [in] int slotTypeInt);
58
59    void GetSpecialActiveNotifications([in] String[] key, [out] sptr<Notification>[] notifications);
60
61    [ipcoutcapacity 520] void GetActiveNotificationByFilter(
62        [in] sptr<NotificationBundleOption> bundleOption,
63        [in] int notificationId,
64        [in] String label,
65        [in] String[] extraInfoKeys,
66        [out] null_sptr<NotificationRequest> request);
67
68    void PublishAsBundle([in] sptr<NotificationRequest> notification, [in] String representativeBundle);
69    [ipcincapacity 520] void PublishAsBundleWithMaxCapacity([in] sptr<NotificationRequest> notification, [in] String representativeBundle);
70
71    void SetNotificationBadgeNum([in] int num);
72
73    void TriggerLocalLiveView(
74        [in] sptr<NotificationBundleOption> bundleOption,
75        [in] int notificationId,
76        [in] sptr<NotificationButtonOption> buttonOption);
77
78    void RemoveNotification(
79        [in] sptr<NotificationBundleOption> bundleOption,
80        [in] int notificationId,
81        [in] String label,
82        [in] int removeReason);
83
84    void RemoveAllNotifications([in] sptr<NotificationBundleOption> bundleOption);
85
86    void RemoveNotifications([in] String[] hashcodes, [in] int removeReason);
87
88    void RemoveDistributedNotifications([in] String[] hashcodes, [in] int slotTypeInt, [in] int deleteTypeInt, [in] int removeReason);
89
90    void Delete([in] String key, [in] int removeReason);
91
92    void DeleteByBundle([in] sptr<NotificationBundleOption> bundleOption);
93
94    void DeleteAll();
95
96    void SubscribeLocalLiveView(
97        [in] IAnsSubscriberLocalLiveView subscriber,
98        [in] boolean isNative);
99    void SubscribeLocalLiveView(
100        [in] IAnsSubscriberLocalLiveView subscriber,
101        [in] sptr<NotificationSubscribeInfo> info,
102        [in] boolean isNative);
103
104    void CancelGroup([in] String groupName, [in] String instanceKey);
105
106    void RemoveGroupByBundle([in] sptr<NotificationBundleOption> bundleOption, [in] String groupName);
107
108    void PublishContinuousTaskNotification([in] sptr<NotificationRequest> request);
109
110    void CancelContinuousTaskNotification([in] String label, [in] int notificationId);
111
112    void DeleteAllByUser([in] int userId);
113
114    void SetBadgeNumber([in] int badgeNumber, [in] String instanceKey);
115
116    void SetBadgeNumberByBundle([in] sptr<NotificationBundleOption> bundleOption, [in] int badgeNumber);
117
118    void SetBadgeNumberForDhByBundle([in] sptr<NotificationBundleOption> bundleOption, [in] int badgeNumber);
119
120    void RegisterPushCallback([in] IRemoteObject pushCallback, [in] sptr<NotificationCheckRequest> notificationCheckRequest);
121
122    void UnregisterPushCallback();
123
124    void CancelAsBundleWithAgent([in] sptr<NotificationBundleOption> bundleOption, [in] int id);
125
126    [oneway] void UpdateNotificationTimerByUid([in] int uid, [in] boolean isPaused);
127
128    void GetNotificationRequestByHashCode(
129        [in] String hashCode, [out] null_sptr<NotificationRequest> notificationRequest);
130
131    void SetHashCodeRule([in] unsigned int type);
132
133    [macrodef NOTIFICATION_SMART_REMINDER_SUPPORTED] void RegisterSwingCallback([in] IRemoteObject swingCallback);
134}
135