• 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 OHOS_SIM_SMS_MANAGER_H
17 #define OHOS_SIM_SMS_MANAGER_H
18 
19 #include "event_handler.h"
20 #include "event_runner.h"
21 #include "i_tel_ril_manager.h"
22 #include "sim_sms_controller.h"
23 #include "telephony_log_wrapper.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 class SimSmsManager {
28 public:
29     SimSmsManager(std::shared_ptr<Telephony::ITelRilManager> telRilManager,
30         std::shared_ptr<SimFileManager> simFileManager, std::shared_ptr<SimStateManager> simStateManager);
31     virtual ~SimSmsManager();
32     void Init(int slotId);
33     int32_t AddSmsToIcc(int status, std::string &pdu, std::string &smsc);
34     int32_t UpdateSmsIcc(int index, int status, std::string &pduData, std::string &smsc);
35     int32_t DelSmsIcc(int index);
36     std::vector<std::string> ObtainAllSmsOfIcc();
37     enum class HandleRunningState {
38         STATE_NOT_START,
39         STATE_RUNNING
40     };
41 
42 protected:
43     int slotId_ = 0;
44     std::shared_ptr<Telephony::ITelRilManager> telRilManager_ = nullptr;
45     std::shared_ptr<SimFileManager> simFileManager_ = nullptr;
46     std::shared_ptr<SimStateManager> stateManager_ = nullptr;
47     std::shared_ptr<SimSmsController> smsController_ = nullptr;
48     std::shared_ptr<AppExecFwk::EventRunner> eventLoopSms_ = nullptr;
49     HandleRunningState stateSms_ = HandleRunningState::STATE_NOT_START;
50 };
51 } // namespace Telephony
52 } // namespace OHOS
53 #endif // OHOS_SIM_SMS_MANAGER_H
54