• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 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 
16 #include "notification_constant.h"
17 #include "notification_content.h"
18 #include "notification_normal_content.h"
19 #include "refbase.h"
20 #include <fuzzer/FuzzedDataProvider.h>
21 #include <memory>
22 #include <new>
23 #include <string>
24 #include <vector>
25 #define private public
26 #define protected public
27 #include "advanced_notification_service.h"
28 #include "ans_manager_proxy.h"
29 #include "ans_manager_stub.h"
30 #include "ans_subscriber_stub.h"
31 #undef private
32 #undef protected
33 #include "ansmanagerstub_fuzzer.h"
34 #include "notification_request.h"
35 #include "ans_permission_def.h"
36 
37 constexpr uint8_t SLOT_TYPE_NUM = 5;
38 
39 namespace OHOS {
GetCurrentTime()40     inline int64_t GetCurrentTime()
41     {
42         auto now = std::chrono::system_clock::now();
43         auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch());
44         return duration.count();
45     }
DoSomethingInterestingWithMyAPI(FuzzedDataProvider * fuzzData)46     bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData)
47     {
48         std::string stringData = fuzzData->ConsumeRandomLengthString();
49         int32_t intData = fuzzData->ConsumeIntegral<int32_t>();
50         bool boolData = fuzzData->ConsumeBool();
51         Notification::AdvancedNotificationService ansManagerStub;
52         MessageParcel datas;
53         MessageParcel reply;
54         MessageOption flags;
55         // test HandleIsNeedSilentInDoNotDisturbMode function
56         ansManagerStub.HandleIsNeedSilentInDoNotDisturbMode(datas, reply);
57         // test HandleRegisterSwingCallback function
58         #ifdef NOTIFICATION_SMART_REMINDER_SUPPORTED
59         ansManagerStub.HandleRegisterSwingCallback(datas, reply);
60         #endif
61         ansManagerStub.OnRemoteRequest(0, datas, reply, flags);
62         ansManagerStub.OnRemoteRequest((int) Notification::NotificationInterfaceCode::PUBLISH_NOTIFICATION,
63             datas, reply, flags);
64         sptr<Notification::NotificationRequest> notification = new Notification::NotificationRequest();
65         notification->SetOwnerUid(fuzzData->ConsumeIntegral<int32_t>());
66         notification->SetCreatorUid(fuzzData->ConsumeIntegral<int32_t>());
67         notification->SetSlotType(Notification::NotificationConstant::SlotType::LIVE_VIEW);
68         auto content = std::make_shared<Notification::NotificationLiveViewContent>();
69         notification->SetContent(std::make_shared<Notification::NotificationContent>(content));
70 
71         sptr<Notification::NotificationBundleOption> bundleOption = new Notification::NotificationBundleOption();
72         bundleOption->SetBundleName(fuzzData->ConsumeRandomLengthString());
73         bundleOption->SetUid(fuzzData->ConsumeIntegral<int32_t>());
74 
75         sptr<Notification::NotificationButtonOption> buttonOption = new Notification::NotificationButtonOption();
76 
77         sptr<Notification::AnsSubscriberStub> subscriber = new Notification::AnsSubscriberStub();
78         sptr<Notification::NotificationSubscribeInfo> info = new Notification::NotificationSubscribeInfo();
79 
80         sptr<Notification::NotificationSlot> slot = new Notification::NotificationSlot();
81         std::vector<sptr<Notification::NotificationSlot>> slots {slot};
82 
83         uint8_t type = fuzzData->ConsumeIntegral<uint8_t>() % SLOT_TYPE_NUM;
84 
85         sptr<Notification::NotificationDoNotDisturbDate> distribuDate = new Notification::NotificationDoNotDisturbDate();
86         distribuDate->SetBeginDate(GetCurrentTime());
87         distribuDate->SetEndDate(GetCurrentTime());
88 
89         datas.WriteString(stringData);
90         datas.WriteParcelable(notification);
91         ansManagerStub.HandlePublish(datas, reply);
92         datas.WriteParcelable(notification);
93         ansManagerStub.HandlePublishNotificationForIndirectProxy(datas, reply);
94         datas.WriteInt32(intData);
95         datas.WriteString(stringData);
96         datas.WriteInt32(intData);
97         ansManagerStub.HandleCancelAsBundle(datas, reply);
98         datas.WriteParcelable(bundleOption);
99         datas.WriteInt32(intData);
100         ansManagerStub.HandleCancelAsBundleOption(datas, reply);
101         datas.WriteInt32(intData);
102         ansManagerStub.HandleCancelAll(datas, reply);
103         datas.WriteInt32(intData);
104         datas.WriteString(stringData);
105         datas.WriteInt32(intData);
106         ansManagerStub.HandleCancel(datas, reply);
107         datas.WriteParcelable(bundleOption);
108         datas.WriteInt32(intData);
109         datas.WriteInt32(intData);
110         ansManagerStub.HandleCancelAsBundleAndUser(datas, reply);
111         datas.WriteInt32(type);
112         ansManagerStub.HandleAddSlotByType(datas, reply);
113         ansManagerStub.HandleAddSlots(datas, reply);
114         datas.WriteInt32(type);
115         ansManagerStub.HandleRemoveSlotByType(datas, reply);
116         ansManagerStub.HandleRemoveAllSlots(datas, reply);
117         ansManagerStub.HandleGetSlots(datas, reply);
118         datas.WriteInt32(type);
119         ansManagerStub.HandleGetSlotByType(datas, reply);
120         datas.WriteParcelable(bundleOption);
121         ansManagerStub.HandleGetSlotNumAsBundle(datas, reply);
122         datas.WriteParcelable(bundleOption);
123         datas.WriteInt32(intData);
124         ansManagerStub.HandleSetSlotFlagsAsBundle(datas, reply);
125         datas.WriteParcelable(bundleOption);
126         ansManagerStub.HandleGetSlotFlagsAsBundle(datas, reply);
127         datas.WriteInt32(intData);
128         ansManagerStub.HandleGetActiveNotifications(datas, reply);
129         ansManagerStub.HandleGetActiveNotificationNums(datas, reply);
130         ansManagerStub.HandleGetAllActiveNotifications(datas, reply);
131         std::vector<std::string> stringVector { stringData };
132         datas.WriteStringVector(stringVector);
133         ansManagerStub.HandleGetSpecialActiveNotifications(datas, reply);
134         datas.WriteParcelable(bundleOption);
135         datas.WriteInt32(intData);
136         datas.WriteString(stringData);
137         datas.WriteStringVector(stringVector);
138         ansManagerStub.HandleGetActiveNotificationByFilter(datas, reply);
139         datas.WriteString(stringData);
140         ansManagerStub.HandleCanPublishAsBundle(datas, reply);
141         datas.WriteParcelable(notification);
142         datas.WriteString(stringData);
143         ansManagerStub.HandlePublishAsBundle(datas, reply);
144         datas.WriteInt32(intData);
145         ansManagerStub.HandleSetNotificationBadgeNum(datas, reply);
146         ansManagerStub.HandleGetBundleImportance(datas, reply);
147         datas.WriteParcelable(distribuDate);
148         ansManagerStub.HandleSetDoNotDisturbDate(datas, reply);
149         ansManagerStub.HandleGetDoNotDisturbDate(datas, reply);
150         ansManagerStub.HandleDoesSupportDoNotDisturbMode(datas, reply);
151         datas.WriteParcelable(notification);
152         datas.WriteInt32(intData);
153         ansManagerStub.HandlePublishContinuousTaskNotification(datas, reply);
154         datas.WriteString(stringData);
155         datas.WriteInt32(intData);
156         ansManagerStub.HandleCancelContinuousTaskNotification(datas, reply);
157         ansManagerStub.HandleIsNotificationPolicyAccessGranted(datas, reply);
158         datas.WriteParcelable(bundleOption);
159         datas.WriteInt32(intData);
160         datas.WriteParcelable(buttonOption);
161         ansManagerStub.HandleTriggerLocalLiveView(datas, reply);
162         datas.WriteParcelable(bundleOption);
163         datas.WriteInt32(intData);
164         datas.WriteString(stringData);
165         datas.WriteInt32(intData);
166         ansManagerStub.HandleRemoveNotification(datas, reply);
167         ansManagerStub.HandleRemoveAllNotifications(datas, reply);
168         datas.WriteInt32(intData);
169         datas.WriteStringVector(stringVector);
170         datas.WriteInt32(intData);
171         ansManagerStub.HandleRemoveNotifications(datas, reply);
172         datas.WriteString(stringData);
173         datas.WriteInt32(intData);
174         ansManagerStub.HandleDelete(datas, reply);
175         datas.WriteParcelable(bundleOption);
176         ansManagerStub.HandleDeleteByBundle(datas, reply);
177         ansManagerStub.HandleDeleteAll(datas, reply);
178         datas.WriteParcelable(bundleOption);
179         datas.WriteInt32(intData);
180         ansManagerStub.HandleGetSlotByBundle(datas, reply);
181         ansManagerStub.HandleGetSlotsByBundle(datas, reply);
182         datas.WriteParcelable(bundleOption);
183         ansManagerStub.HandleUpdateSlots(datas, reply);
184         datas.WriteString(stringData);
185         datas.WriteRemoteObject(subscriber);
186         datas.WriteBool(boolData);
187         if (boolData) {
188             datas.WriteRemoteObject(subscriber);
189         }
190         ansManagerStub.HandleRequestEnableNotification(datas, reply);
191         datas.WriteString(stringData);
192         datas.WriteBool(boolData);
193         ansManagerStub.HandleSetNotificationsEnabledForBundle(datas, reply);
194         datas.WriteString(stringData);
195         datas.WriteBool(boolData);
196         ansManagerStub.HandleSetNotificationsEnabledForAllBundles(datas, reply);
197         datas.WriteString(stringData);
198         datas.WriteParcelable(bundleOption);
199         datas.WriteBool(boolData);
200         ansManagerStub.HandleSetNotificationsEnabledForSpecialBundle(datas, reply);
201         datas.WriteParcelable(bundleOption);
202         datas.WriteBool(boolData);
203         ansManagerStub.HandleSetShowBadgeEnabledForBundle(datas, reply);
204         datas.WriteParcelable(bundleOption);
205         ansManagerStub.HandleGetShowBadgeEnabledForBundle(datas, reply);
206         ansManagerStub.HandleGetShowBadgeEnabled(datas, reply);
207         datas.WriteRemoteObject(subscriber);
208         datas.WriteBool(boolData);
209         if (boolData) {
210             datas.WriteParcelable(info);
211         }
212         ansManagerStub.HandleSubscribe(datas, reply);
213         datas.WriteRemoteObject(subscriber);
214         ansManagerStub.HandleSubscribeSelf(datas, reply);
215         datas.WriteRemoteObject(subscriber);
216         datas.WriteBool(boolData);
217         if (boolData) {
218             datas.WriteParcelable(info);
219         }
220         datas.WriteBool(boolData);
221         ansManagerStub.HandleSubscribeLocalLiveView(datas, reply);
222         datas.WriteRemoteObject(subscriber);
223         datas.WriteBool(boolData);
224         if (boolData) {
225             datas.WriteParcelable(info);
226         }
227         ansManagerStub.HandleUnsubscribe(datas, reply);
228         ansManagerStub.HandleIsAllowedNotify(datas, reply);
229         ansManagerStub.HandleIsAllowedNotifySelf(datas, reply);
230         datas.WriteRemoteObject(subscriber);
231         ansManagerStub.HandleCanPopEnableNotificationDialog(datas, reply);
232         ansManagerStub.HandleRemoveEnableNotificationDialog(datas, reply);
233         datas.WriteParcelable(bundleOption);
234         ansManagerStub.HandleIsSpecialBundleAllowedNotify(datas, reply);
235         datas.WriteString(stringData);
236         datas.WriteInt32(intData);
237         ansManagerStub.HandleCancelGroup(datas, reply);
238         datas.WriteParcelable(bundleOption);
239         datas.WriteString(stringData);
240         ansManagerStub.HandleRemoveGroupByBundle(datas, reply);
241         ansManagerStub.HandleIsDistributedEnabled(datas, reply);
242         datas.WriteBool(boolData);
243         ansManagerStub.HandleEnableDistributed(datas, reply);
244         datas.WriteParcelable(bundleOption);
245         datas.WriteBool(boolData);
246         ansManagerStub.HandleEnableDistributedByBundle(datas, reply);
247         datas.WriteBool(boolData);
248         ansManagerStub.HandleEnableDistributedSelf(datas, reply);
249         datas.WriteParcelable(bundleOption);
250         ansManagerStub.HandleIsDistributedEnableByBundle(datas, reply);
251         ansManagerStub.HandleGetDeviceRemindType(datas, reply);
252         datas.WriteString(stringData);
253         datas.WriteString(stringData);
254         datas.WriteInt32(intData);
255         datas.WriteInt32(intData);
256         ansManagerStub.HandleShellDump(datas, reply);
257         datas.WriteString(stringData);
258         ansManagerStub.HandleIsSupportTemplate(datas, reply);
259         datas.WriteInt32(intData);
260         ansManagerStub.HandleIsSpecialUserAllowedNotifyByUser(datas, reply);
261         datas.WriteInt32(intData);
262         datas.WriteBool(boolData);
263         ansManagerStub.HandleSetNotificationsEnabledByUser(datas, reply);
264         datas.WriteInt32(intData);
265         ansManagerStub.HandleDeleteAllByUser(datas, reply);
266         datas.WriteInt32(intData);
267         datas.WriteParcelable(distribuDate);
268         ansManagerStub.HandleSetDoNotDisturbDateByUser(datas, reply);
269         datas.WriteInt32(intData);
270         ansManagerStub.HandleGetDoNotDisturbDateByUser(datas, reply);
271         datas.WriteInt32(intData);
272         ansManagerStub.HandleGetDoNotDisturbProfile(datas, reply);
273         datas.WriteParcelable(bundleOption);
274         datas.WriteInt32(type);
275         datas.WriteBool(boolData);
276         datas.WriteBool(boolData);
277         ansManagerStub.HandleSetEnabledForBundleSlot(datas, reply);
278         datas.WriteParcelable(bundleOption);
279         datas.WriteInt32(type);
280         ansManagerStub.HandleGetEnabledForBundleSlot(datas, reply);
281         datas.WriteInt32(type);
282         ansManagerStub.HandleGetEnabledForBundleSlotSelf(datas, reply);
283         datas.WriteInt32(intData);
284         datas.WriteBool(boolData);
285         ansManagerStub.HandleDistributedSetEnabledWithoutApp(datas, reply);
286         datas.WriteInt32(intData);
287         ansManagerStub.HandleDistributedGetEnabledWithoutApp(datas, reply);
288         datas.WriteInt32(intData);
289         datas.WriteInt32(intData);
290         ansManagerStub.HandleSetBadgeNumber(datas, reply);
291         datas.WriteParcelable(bundleOption);
292         datas.WriteInt32(intData);
293         ansManagerStub.HandleSetBadgeNumberByBundle(datas, reply);
294         ansManagerStub.HandleGetAllNotificationEnableStatus(datas, reply);
295         ansManagerStub.HandleRegisterPushCallback(datas, reply);
296         ansManagerStub.HandleUnregisterPushCallback(datas, reply);
297         ansManagerStub.HandleAddDoNotDisturbProfiles(datas, reply);
298         datas.WriteString(stringData);
299         datas.WriteBool(boolData);
300         ansManagerStub.HandleSetDistributedEnabledBySlot(datas, reply);
301         datas.WriteString(stringData);
302         ansManagerStub.HandleGetAllDistributedEnabledBundles(datas, reply);
303         datas.WriteInt32(intData);
304         ansManagerStub.HandleGetAllNotificationsBySlotType(datas, reply);
305         datas.WriteString(stringData);
306         ansManagerStub.HandleAllowUseReminder(datas, reply);
307         datas.WriteString(stringData);
308         datas.WriteInt32(intData);
309         datas.WriteInt32(intData);
310         ansManagerStub.HandleSetDeviceStatus(datas, reply);
311         datas.WriteParcelable(bundleOption);
312         datas.WriteString(stringData);
313         datas.WriteBool(boolData);
314         ansManagerStub.HandleSetDistributedEnabledByBundle(datas, reply);
315         ansManagerStub.HandleRemoveDoNotDisturbProfiles(datas, reply);
316         datas.WriteParcelable(bundleOption);
317         datas.WriteString(stringData);
318         ansManagerStub.HandleIsDistributedEnabledByBundle(datas, reply);
319         datas.WriteString(stringData);
320         datas.WriteBool(boolData);
321         ansManagerStub.HandleSetSmartReminderEnabled(datas, reply);
322         datas.WriteString(stringData);
323         ansManagerStub.HandleIsSmartReminderEnabled(datas, reply);
324         datas.WriteString(stringData);
325         datas.WriteString(stringData);
326         ansManagerStub.HandleSetAdditionConfig(datas, reply);
327         datas.WriteParcelable(bundleOption);
328         datas.WriteInt32(intData);
329         ansManagerStub.HandleCancelAsBundleWithAgent(datas, reply);
330         datas.WriteString(stringData);
331         datas.WriteInt32(intData);
332         ansManagerStub.HandleSetTargetDeviceStatus(datas, reply);
333         datas.WriteString(stringData);
334         ansManagerStub.HandleGetDeviceStatus(datas, reply);
335         datas.WriteInt32(intData);
336         datas.WriteBool(boolData);
337         ansManagerStub.HandleUpdateNotificationTimerByUid(datas, reply);
338         sptr<Notification::NotificationRequest> notification2 = new Notification::NotificationRequest();
339         notification2->SetOwnerUid(fuzzData->ConsumeIntegral<int32_t>());
340         notification2->SetCreatorUid(fuzzData->ConsumeIntegral<int32_t>());
341         notification2->SetSlotType(Notification::NotificationConstant::SlotType::SOCIAL_COMMUNICATION);
342         auto content2 = std::make_shared<Notification::NotificationNormalContent>();
343         notification2->SetContent(std::make_shared<Notification::NotificationContent>(content2));
344         ansManagerStub.Publish(stringData, notification2);
345         int notificationId = fuzzData->ConsumeIntegral<int>();
346         ansManagerStub.Cancel(notificationId, stringData, "");
347         ansManagerStub.CancelAll("");
348         int32_t userId = fuzzData->ConsumeIntegral<int32_t>();
349         ansManagerStub.CancelAsBundle(notificationId, stringData, userId);
350         Notification::NotificationConstant::SlotType slotType = Notification::NotificationConstant::SlotType(type);
351         ansManagerStub.AddSlotByType(slotType);
352         ansManagerStub.AddSlots(slots);
353         ansManagerStub.RemoveSlotByType(slotType);
354         ansManagerStub.RemoveAllSlots();
355         ansManagerStub.GetSlotByType(slotType, slot);
356         ansManagerStub.GetSlots(slots);
357         uint64_t num = fuzzData->ConsumeIntegral<uint64_t>();
358         ansManagerStub.GetSlotNumAsBundle(bundleOption, num);
359         std::vector<sptr<Notification::NotificationRequest>> notifications;
360         ansManagerStub.GetActiveNotifications(notifications, "");
361         ansManagerStub.GetActiveNotificationNums(num);
362         std::vector<sptr<Notification::Notification>> notificationss;
363         ansManagerStub.GetAllActiveNotifications(notificationss);
364         std::vector<std::string> key;
365         ansManagerStub.GetSpecialActiveNotifications(key, notificationss);
366         bool canPublish = fuzzData->ConsumeBool();
367         ansManagerStub.CanPublishAsBundle(stringData, canPublish);
368         ansManagerStub.PublishAsBundle(notification, stringData);
369         ansManagerStub.SetNotificationBadgeNum(num);
370         int importance = fuzzData->ConsumeIntegral<int>();
371         ansManagerStub.GetBundleImportance(importance);
372         bool granted = fuzzData->ConsumeBool();
373         ansManagerStub.HasNotificationPolicyAccessPermission(granted);
374         int32_t removeReason = fuzzData->ConsumeIntegral<int32_t>();
375         ansManagerStub.RemoveNotification(bundleOption, notificationId, stringData, removeReason);
376         ansManagerStub.RemoveAllNotifications(bundleOption);
377         ansManagerStub.Delete(stringData, removeReason);
378         ansManagerStub.DeleteByBundle(bundleOption);
379         ansManagerStub.DeleteAll();
380         ansManagerStub.GetSlotsByBundle(bundleOption, slots);
381         ansManagerStub.UpdateSlots(bundleOption, slots);
382         sptr<Notification::AnsDialogCallback> dialogCallback = nullptr;
383         sptr<IRemoteObject> callerToken = nullptr;
384         ansManagerStub.RequestEnableNotification(stringData, dialogCallback, callerToken);
385         bool enabled = fuzzData->ConsumeBool();
386         ansManagerStub.SetNotificationsEnabledForBundle(stringData, enabled);
387         ansManagerStub.SetNotificationsEnabledForSpecialBundle(stringData, bundleOption, enabled);
388         ansManagerStub.SetShowBadgeEnabledForBundle(bundleOption, enabled);
389         ansManagerStub.GetShowBadgeEnabledForBundle(bundleOption, enabled);
390         ansManagerStub.GetShowBadgeEnabled(enabled);
391         bool allowed = fuzzData->ConsumeBool();
392         ansManagerStub.IsAllowedNotify(allowed);
393         ansManagerStub.IsSpecialBundleAllowedNotify(bundleOption, allowed);
394         ansManagerStub.CancelGroup(stringData, "");
395         ansManagerStub.RemoveGroupByBundle(bundleOption, stringData);
396         sptr<Notification::NotificationDoNotDisturbDate> date = new Notification::NotificationDoNotDisturbDate();
397         ansManagerStub.SetDoNotDisturbDate(date);
398         ansManagerStub.GetDoNotDisturbDate(date);
399         bool doesSupport = fuzzData->ConsumeBool();
400         ansManagerStub.DoesSupportDoNotDisturbMode(doesSupport);
401         ansManagerStub.IsDistributedEnabled(enabled);
402         ansManagerStub.EnableDistributedByBundle(bundleOption, enabled);
403         ansManagerStub.EnableDistributedSelf(enabled);
404         ansManagerStub.IsDistributedEnableByBundle(bundleOption, enabled);
405         Notification::NotificationConstant::RemindType remindType;
406         ansManagerStub.GetDeviceRemindType(remindType);
407         sptr<Notification::NotificationRequest> request = new Notification::NotificationRequest();
408         ansManagerStub.PublishContinuousTaskNotification(request);
409         ansManagerStub.CancelContinuousTaskNotification(stringData, notificationId);
410         bool support = fuzzData->ConsumeBool();
411         ansManagerStub.IsSupportTemplate(stringData, support);
412         ansManagerStub.IsSpecialUserAllowedNotify(userId, allowed);
413         int32_t deviceIds = fuzzData->ConsumeIntegral<int32_t>();
414         ansManagerStub.SetNotificationsEnabledByUser(deviceIds, enabled);
415         ansManagerStub.DeleteAllByUser(userId);
416         ansManagerStub.SetDoNotDisturbDate(date);
417         ansManagerStub.GetDoNotDisturbDate(date);
418         ansManagerStub.SetEnabledForBundleSlot(bundleOption, slotType, enabled, false);
419         ansManagerStub.GetEnabledForBundleSlot(bundleOption, slotType, enabled);
420         std::vector<std::string> dumpInfo;
421         ansManagerStub.ShellDump(stringData, stringData, userId, userId, dumpInfo);
422         ansManagerStub.SetSyncNotificationEnabledWithoutApp(userId, enabled);
423         ansManagerStub.GetSyncNotificationEnabledWithoutApp(userId, enabled);
424         return true;
425     }
426 }
427 
428 /* Fuzzer entry point */
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)429 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
430 {
431     /* Run your code on data */
432     FuzzedDataProvider fdp(data, size);
433     std::vector<std::string> requestPermission = {
434         OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER,
435         OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER,
436         OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION
437     };
438     NativeTokenGet(requestPermission);
439     OHOS::DoSomethingInterestingWithMyAPI(&fdp);
440     return 0;
441 }
442