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 APN_INFO_H
17 #define APN_INFO_H
18 
19 #include "datashare_helper.h"
20 #include "datashare_predicates.h"
21 #include "iservice_registry.h"
22 #include "system_ability_definition.h"
23 
24 namespace OHOS {
25 namespace Telephony {
26 class MmsApnInfo {
27 public:
28     explicit MmsApnInfo(int32_t slotId);
29     ~MmsApnInfo();
30     void getMmsApn();
31     std::shared_ptr<DataShare::DataShareHelper> CreatePdpProfileHelper();
32     void PdpProfileSelect(const std::shared_ptr<DataShare::DataShareHelper> &helper);
33     std::string getMmscUrl();
34     void setMmscUrl(std::string mmscUrl);
35     std::string getMmsProxyAddressAndProxyPort();
36     void setMmsProxyAddressAndProxyPort(std::string mmsProxyAddressAndProxyPort);
37     bool SplitAndMatchApnTypes(std::string apn);
38     bool GetMmsApnValue(std::shared_ptr<DataShare::ResultSet> resultSet, int count, std::string &homeUrlVal,
39         std::string &mmsIPAddressVal);
40 
41 private:
42     std::shared_ptr<DataShare::DataShareHelper> CreateDataAHelper(
43         int32_t systemAbilityId, const std::string &dataAbilityUri) const;
44 
45 private:
46     int32_t slotId_ = -1;
47     std::string mmscUrl_;
48     std::string mmsProxyAddressAndProxyPort_;
49     std::shared_ptr<DataShare::DataShareHelper> mmsPdpProfileDataAbilityHelper = nullptr;
50 };
51 } // namespace Telephony
52 } // namespace OHOS
53 #endif