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