diff --git a/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp index 9e0e8533274790f4b4981f004d6b3b0789f093a7..e8dadb50c4c0152e33faf337435a9085dcef6920 100644 --- a/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp @@ -23,6 +23,10 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + std::string groupName = fuzzData->ConsumeRandomLengthString(); + std::string instanceKey = fuzzData->ConsumeRandomLengthString(); + service->CancelGroup(groupName, instanceKey); return true; } } diff --git a/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp index a14eb0e92e8101482b243d2a7adabc7f60c32d62..32c258d9e3af66fe99a6e60ae1649d4bb957a74f 100644 --- a/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp @@ -23,6 +23,10 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + std::string representativeBundle = fuzzData->ConsumeRandomLengthString(); + bool canPublish; + service->CanPublishAsBundle(representativeBundle, canPublish); return true; } } diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp index 9c1a454e466c666197ac6f51aba366b8feedd5c2..1223ab9362fb622be5b02b385adce2c3763efb33 100644 --- a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp @@ -23,6 +23,11 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + sptr option = ObjectBuilder::Build(fuzzData); + int32_t slotTypeInt = fuzzData->ConsumeIntegralInRange(0, 5); + bool enabled; + service->GetEnabledForBundleSlot(option, slotTypeInt, enabled); return true; } } @@ -33,6 +38,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp index e531760e03961247af626fba0533b72b0ed9f6c5..dc3d887772e9b3325134c41c6414223e70221800 100644 --- a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp @@ -23,6 +23,10 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + bool enable; + int32_t slotTypeInt = fuzzData->ConsumeIntegral(); + service->GetEnabledForBundleSlotSelf(slotTypeInt, enable); return true; } } @@ -33,6 +37,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp index 27524e6799f35f1fc58fe83b4f7bee8e8c8ee3df..ce37f1108c5d53bba3559b42c3983ecb218eef2a 100644 --- a/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp @@ -18,11 +18,17 @@ #include "advanced_notification_service.h" #include "ans_permission_def.h" #include "mock_notification_request.h" +#include "notification_slot.h" + +#include namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + std::vector> slots; + service->GetSlots(slots); return true; } } @@ -33,6 +39,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp index 4624afca3e3702c7114aac4ad6a24032ccd9689b..4c9b98fe041ee57767aa3b132ffefb1ecc6870bd 100644 --- a/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp @@ -23,6 +23,10 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + std::string templateName = fuzzData->ConsumeRandomLengthString(); + bool support; + service->IsSupportTemplate(templateName, support); return true; } } diff --git a/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp index e6c52125a2fe4e2ae54eac31ef2a257728756e43..a9ea4ea3a0d78498b418db9533e23e4b913b62d4 100644 --- a/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp @@ -23,6 +23,12 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + service->InitPublishProcess(); + service->CreateDialogManager(); + std::string stringData = fuzzData->ConsumeRandomLengthString(); + sptr request = ObjectBuilder::Build(fuzzData); + service->Publish(stringData, request); return true; } } @@ -33,6 +39,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp index e759156ffaf7bd25a79aba77ee0a45bb4adf37b1..91c833824691ee24fec74cafd24724fd2d3880cf 100644 --- a/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp @@ -23,6 +23,9 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + sptr option = ObjectBuilder::Build(fuzzData); + service->RemoveAllNotifications(option); return true; } } @@ -33,6 +36,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp index 1f6c7e0c0eac1b14d42fd980d61835a4ac4b87fc..c91dcd072c7d8f38f0dde74636ef61a4e693ca70 100644 --- a/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp @@ -23,6 +23,10 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + + int32_t num = fuzzData->ConsumeIntegral(); + service->SetNotificationBadgeNum(num); return true; } } @@ -33,6 +37,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp index f072f76d931e40f2ccddb7d23b38eea05cd3f825..013f10a0fa5e8031d98ecbeb93bb98ef14432e53 100644 --- a/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp @@ -23,6 +23,9 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + uint32_t type = fuzzData->ConsumeIntegral(); + service->SetHashCodeRule(type); return true; } } @@ -33,6 +36,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp index 461f370a08803bbeaf8ffb57099b3460715f0f8b..476e7e0e19468e0fdb78d2cbb526a59a878365c6 100644 --- a/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp @@ -23,6 +23,10 @@ namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + int32_t userId = fuzzData->ConsumeIntegral(); + bool enabled = fuzzData->ConsumeBool(); + auto service = AdvancedNotificationService::GetInstance(); + service->SetSyncNotificationEnabledWithoutApp(userId, enabled); return true; } } @@ -33,6 +37,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp index f9ed56c048d08a661008f20c029004c73431e796..56eed56a62e7b728066b23a6bc58b21418d801ea 100644 --- a/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp @@ -18,11 +18,56 @@ #include "advanced_notification_service.h" #include "ans_permission_def.h" #include "mock_notification_request.h" +#include "mock_notification_subscribe_info.h" +#include "notification_subscriber.h" +#include "ans_subscriber_listener.h" namespace OHOS { namespace Notification { + +class TestSubscriber : public NotificationSubscriber { +public: + void OnDisconnected() override + {} + void OnDied() override + {} + void OnUpdate(const std::shared_ptr &sortingMap) override + {} + void OnDoNotDisturbDateChange(const std::shared_ptr &date) override + {} + void OnConnected() override + {} + void OnEnabledNotificationChanged(const std::shared_ptr &callbackData) override + {} + void OnCanceled(const std::shared_ptr &request, + const std::shared_ptr &sortingMap, int deleteReason) override + {} + void OnBadgeChanged(const std::shared_ptr &badgeData) override + {} + void OnBadgeEnabledChanged(const sptr &callbackData) override + {} + void OnConsumed(const std::shared_ptr &request, + const std::shared_ptr &sortingMap) override + {} + + void OnBatchCanceled(const std::vector> &requestList, + const std::shared_ptr &sortingMap, int32_t deleteReason) override + {} + + bool HasOnBatchCancelCallback() override + { + return true; + } +}; + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + std::shared_ptr subscriber = std::make_shared(); + sptr listener = new (std::nothrow) SubscriberListener(subscriber); + + sptr subscribeInfo = ObjectBuilder::Build(fuzzData); + service->Unsubscribe(listener, subscribeInfo); return true; } } @@ -33,6 +78,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp index 098266716973c62b3b97b506c865e15b1ba6c6ec..7b543e9b310b8bd2f819bb3d61493d12d0e086a5 100644 --- a/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp +++ b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp @@ -19,10 +19,18 @@ #include "ans_permission_def.h" #include "mock_notification_request.h" +#include + namespace OHOS { namespace Notification { bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) { + auto service = AdvancedNotificationService::GetInstance(); + sptr option = ObjectBuilder::Build(fuzzData); + std::vector> slots; + sptr slot = ObjectBuilder::Build(fuzzData); + slots.emplace_back(slot); + service->UpdateSlots(option, slots); return true; } } @@ -33,6 +41,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ FuzzedDataProvider fdp(data, size); + std::vector requestPermission = { + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER, + OHOS::Notification::OHOS_PERMISSION_SET_UNREMOVABLE_NOTIFICATION + }; + MockRandomToken(&fdp, requestPermission); OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); return 0; } diff --git a/test/fuzztest/fuzz_common_base/mock/mock_notification_slot.h b/test/fuzztest/fuzz_common_base/mock/mock_notification_slot.h new file mode 100644 index 0000000000000000000000000000000000000000..73bde459aa347e85ee5f90f3be722104d337ace8 --- /dev/null +++ b/test/fuzztest/fuzz_common_base/mock/mock_notification_slot.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MOCK_NOTIFICATION_SLOT_H +#define MOCK_NOTIFICATION_SLOT_H + +#include "mock_fuzz_object.h" +#include "notification_slot.h" +namespace OHOS { +namespace Notification { + +constexpr uint32_t MAX_SLOT_TYPE = 5; +constexpr uint32_t MAX_STR_LENGTH = 20; +constexpr uint32_t MAX_FLAGS = 63; +constexpr uint32_t MAX_VISIBLENESS_STATUS = 2; + +template <> +NotificationSlot* ObjectBuilder::Build(FuzzedDataProvider *fdp) +{ + NotificationSlot* slot = new NotificationSlot(static_cast( + fdp->ConsumeIntegralInRange(0, MAX_SLOT_TYPE))); + slot->SetEnableLight(fdp->ConsumeBool()); + slot->SetEnableVibration(fdp->ConsumeBool()); + slot->SetDescription(fdp->ConsumeRandomLengthString(MAX_STR_LENGTH)); + slot->SetLedLightColor(fdp->ConsumeIntegral()); + slot->SetLevel(static_cast( + dp->ConsumeIntegralInRange(0, MAX_SLOT_TYPE))); + slot->SetSlotFlags(dp->ConsumeIntegralInRange(0, MAX_FLAGS)); + slot->SetVisibleness(static_cast( + fdp->ConsumeIntegralInRange(0, VISIBLENESS_STATUS))); + slot->EnableBypassDnd(fdp->ConsumeBool()); + slot->EnableBadge(fdp->ConsumeBool()); + slot->SetEnable(fdp->ConsumeBool()); + slot->SetForceControl(fdp->ConsumeBool()); + slot->SetAuthorizedStatus(dp->ConsumeIntegralInRange(0, 1)); + slot->SetAuthHintCnt(dp->ConsumeIntegralInRange(0, 1)); + slot->SetReminderMode(dp->ConsumeIntegralInRange(0, MAX_FLAGS)); + + ANS_LOGE("Build mock veriables"); + return slot; +} + +} // namespace Notification +} // namespace OHOS +#endif // MOCK_NOTIFICATION_SLOT_H \ No newline at end of file