• 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_RECEIVE_RELIABILITY_HANDLER_H
17 #define SMS_RECEIVE_RELIABILITY_HANDLER_H
18 
19 #include "sms_wap_push_handler.h"
20 
21 namespace OHOS {
22 namespace Telephony {
23 class SmsReceiveReliabilityHandler : public std::enable_shared_from_this<SmsReceiveReliabilityHandler> {
24 public:
25     explicit SmsReceiveReliabilityHandler(int32_t slotId);
26     virtual ~SmsReceiveReliabilityHandler();
27     void SmsReceiveReliabilityProcessing();
28     std::string GetSmsExpire();
29     bool DeleteExpireSmsFromDB();
30     bool CheckSmsCapable();
31     void DeleteMessageFormDb(const uint16_t refId, const uint16_t dataBaseId = 0);
32     bool CheckBlockedPhoneNumber(std::string originatingAddress);
33     void SendBroadcast(
34         const std::shared_ptr<SmsReceiveIndexer> indexer, const std::shared_ptr<std::vector<std::string>> pdus);
35 
36 private:
37     void RemoveBlockedSms(std::vector<SmsReceiveIndexer> &dbIndexers);
38     void CheckUnReceiveWapPush(std::vector<SmsReceiveIndexer> &dbIndexers);
39     void HiSysEventCBResult(bool publishResult);
40     void GetWapPushUserDataSinglePage(
41         SmsReceiveIndexer &indexer, std::shared_ptr<std::vector<std::string>> userDataRaws);
42     void GetWapPushUserDataMultipage(int32_t &smsPagesCount, std::vector<SmsReceiveIndexer> &dbIndexers, int32_t place,
43         std::shared_ptr<std::vector<std::string>> userDataRaws);
44     void ReadyDecodeWapPushUserData(SmsReceiveIndexer &indexer, std::shared_ptr<std::vector<std::string>> userDataRaws);
45     void GetSmsUserDataMultipage(int32_t &smsPagesCount, std::vector<SmsReceiveIndexer> &dbIndexers, int32_t position,
46         std::shared_ptr<std::vector<std::string>> pdus);
47     void ReadySendSmsBroadcast(SmsReceiveIndexer &indexerObj, std::shared_ptr<std::vector<std::string>> pdus);
48 
49 private:
50     std::unique_ptr<SmsWapPushHandler> smsWapPushHandler_;
51     int32_t slotId_ = -1;
52 };
53 } // namespace Telephony
54 } // namespace OHOS
55 #endif