• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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 #ifndef SMS_BROADCAST_SUBSCRIBER_RECEIVER_H
17 #define SMS_BROADCAST_SUBSCRIBER_RECEIVER_H
18 
19 #include <memory>
20 
21 #include "common_event_manager.h"
22 #include "common_event_subscriber.h"
23 #include "common_event_support.h"
24 #include "sms_receive_reliability_handler.h"
25 
26 namespace OHOS {
27 namespace Telephony {
28 
29 class SmsBroadcastSubscriberReceiver : public EventFwk::CommonEventSubscriber {
30 public:
31     SmsBroadcastSubscriberReceiver(const OHOS::EventFwk::CommonEventSubscribeInfo &subscriberInfo,
32         std::shared_ptr<SmsReceiveReliabilityHandler> handler, uint16_t refId, uint16_t dataBaseId,
33         const std::string &address);
34     ~SmsBroadcastSubscriberReceiver() = default;
35     virtual void OnReceiveEvent(const OHOS::EventFwk::CommonEventData &data);
36 
37 private:
38     std::shared_ptr<SmsReceiveReliabilityHandler> handler_ = nullptr;
39     uint16_t refId_ = 0;
40     uint16_t dataBaseId_ = 0;
41     std::string address_;
42 };
43 } // namespace Telephony
44 } // namespace OHOS
45 #endif