• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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_RECEIVE_MANAGER_H
17 #define SMS_RECEIVE_MANAGER_H
18 
19 #include <memory>
20 
21 #include "cdma_sms_receive_handler.h"
22 #include "gsm_sms_receive_handler.h"
23 #include "sms_receive_handler.h"
24 #include "sms_sender.h"
25 
26 namespace OHOS {
27 namespace Telephony {
28 class SmsReceiveManager : public std::enable_shared_from_this<SmsReceiveManager> {
29 public:
30     explicit SmsReceiveManager(int32_t slotId);
31     ~SmsReceiveManager();
32     void Init();
33     void SetCdmaSender(const std::weak_ptr<SmsSender> &smsSender);
34 
35 private:
36     std::shared_ptr<GsmSmsReceiveHandler> gsmSmsReceiveHandler_;
37     std::shared_ptr<CdmaSmsReceiveHandler> cdmaSmsReceiveHandler_;
38     std::shared_ptr<AppExecFwk::EventRunner> gsmSmsReceiveRunner_;
39     std::shared_ptr<AppExecFwk::EventRunner> cdmaSmsReceiveRunner_;
40     int32_t slotId_;
41 };
42 } // namespace Telephony
43 } // namespace OHOS
44 #endif