/* * Copyright (c) 2022-2024 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 FOUNDATION_RESOURCESCHEDULE_BACKGROUND_TASK_MGR_SERVICES_CONTINUOUS_TASK_INCLUDE_NOTIFICATION_SUBSCRIBER_H #define FOUNDATION_RESOURCESCHEDULE_BACKGROUND_TASK_MGR_SERVICES_CONTINUOUS_TASK_INCLUDE_NOTIFICATION_SUBSCRIBER_H #include "notification_helper.h" namespace OHOS { namespace BackgroundTaskMgr { class BgContinuousTaskMgr; class TaskNotificationSubscriber : public Notification::NotificationSubscriber { public: TaskNotificationSubscriber(); ~TaskNotificationSubscriber() override; void OnConnected() override; void OnDisconnected() override; void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override; void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override; void OnUpdate(const std::shared_ptr &sortingMap) override; void OnDied() override; void OnDoNotDisturbDateChange( const std::shared_ptr &date) override; void OnEnabledNotificationChanged( const std::shared_ptr &callbackData) override; void OnBadgeChanged(const std::shared_ptr &badgeData) override; void OnBadgeEnabledChanged(const sptr &callbackData) override; void OnBatchCanceled(const std::vector> &requestList, const std::shared_ptr &sortingMap, int32_t deleteReason) override; private: std::vector StringSplit(const std::string &str, const char &delim); private: static std::shared_ptr continuousTaskMgr_; }; } // namespace BackgroundTaskMgr } // namespace OHOS #endif // FOUNDATION_RESOURCESCHEDULE_BACKGROUND_TASK_MGR_SERVICES_CONTINUOUS_TASK_INCLUDE_NOTIFICATION_SUBSCRIBER_H