• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 TELEPHONY_OPERATOR_CONFIG_TYPES_H
17 #define TELEPHONY_OPERATOR_CONFIG_TYPES_H
18 
19 #include <map>
20 #include <string>
21 #include <vector>
22 #include "parcel.h"
23 
24 namespace OHOS {
25 namespace Telephony {
26 const std::string BROADCAST_ARG_SLOT_ID = "slotId";
27 const std::string BROADCAST_ARG_OPERATOR_STATE = "state";
28 const std::string KEY_EMERGENCY_CALL_STRING_ARRAY = "emergency_call_string_array";
29 const int32_t DEFAULT_CALL_WAITING_SERVICE_CLASS_CONFIG = 1;
30 const std::vector<std::string> IMS_CALL_DISCONNECT_REASONINFO_MAPPING_CONFIG = std::vector<std::string> {};
31 const int32_t CARRIER_NR_AVAILABILITY_NSA = 1;
32 const int32_t CARRIER_NR_AVAILABILITY_SA = 2;
33 constexpr const char *KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL = "ims_switch_on_by_default_bool";
34 constexpr const char *KEY_HIDE_IMS_SWITCH_BOOL = "hide_ims_switch_bool";
35 constexpr const char *KEY_VOLTE_SUPPORTED_BOOL = "volte_supported_bool";
36 constexpr const char *KEY_NR_MODE_SUPPORTED_LIST_INT_ARRAY = "nr_mode_supported_list_int_array";
37 constexpr const char *KEY_VOLTE_PROVISIONING_SUPPORTED_BOOL = "volte_provisioning_supported_bool";
38 constexpr const char *KEY_CARRIER_VT_AVAILABLE_BOOL = "carrier_vt_available_bool";
39 constexpr const char *KEY_SS_OVER_UT_SUPPORTED_BOOL = "ss_over_ut_supported_bool";
40 constexpr const char *KEY_IMS_GBA_REQUIRED_BOOL = "ims_gba_required_bool";
41 constexpr const char *KEY_UT_PROVISIONING_SUPPORTED_BOOL = "ut_provisioning_supported_bool";
42 constexpr const char *KEY_IMS_PREFER_FOR_EMERGENCY_BOOL = "ims_prefer_for_emergency_bool";
43 constexpr const char *KEY_CALL_WAITING_SERVICE_CLASS_INT = "call_waiting_service_class_int";
44 constexpr const char *KEY_IMS_CALL_DISCONNECT_REASONINFO_MAPPING_STRING_ARRAY =
45     "ims_call_disconnect_reasoninfo_mapping_string_array";
46 constexpr const char *KEY_FORCE_VOLTE_SWITCH_ON_BOOL = "force_volte_switch_on_bool";
47 constexpr const char *KEY_VIDEO_CALL_WAITING_ON_BOOL = "video_call_waiting_on_bool";
48 /**
49  * If true, customize the items related to operator name.
50  */
51 constexpr const char *KEY_ENABLE_OPERATOR_NAME_CUST_BOOL = "enable_operator_name_cust_bool";
52 /**
53  * Customize the operatoer name if #KEY_ENABLE_OPERATOR_NAME_CUST_BOOL is true.
54  */
55 constexpr const char *KEY_OPERATOR_NAME_CUST_STRING = "operator_name_cust_string";
56 /**
57  * Customize the SPN Display Condition bits if #KEY_ENABLE_OPERATOR_NAME_CUST_BOOL is true. The default value '-1' means
58  * this field is not set.
59  * b1 = 0: display of registered PLMN name not required when registered PLMN is either HPLMN or a PLMN in the service
60  * provider PLMN list (see EF_SPDI).
61  * b1 = 1: display of registered PLMN name required when registered PLMN is either HPLMN or a PLMN in the service
62  * provider PLMN list(see EF_SPDI).
63  * b2 = 0: display of the service provider name required when registered PLMN is neither HPLMN nor a PLMN in the
64  * service provider PLMN list(see EF_SPDI).
65  * b2 = 1: display of the service provider name not required when registered PLMN is neither HPLMN nor a PLMN in the
66  * service provider PLMN list(see EF_SPDI).
67  *
68  * See 3GPP TS 31.102 v15.2.0 Section 4.2.12 EF_SPN.
69  */
70 constexpr const char *KEY_SPN_DISPLAY_CONDITION_CUST_INT = "spn_display_condition_cust_int";
71 /**
72  * Customize the PNN - a string array of comma-separated long and short names:
73  * "long_name1,short_name1".
74  *
75  * See 3GPP TS 31.102 v15.2.0 Section 4.2.58 EF_PNN.
76  */
77 constexpr const char *KEY_PNN_CUST_STRING_ARRAY = "pnn_cust_string_array";
78 /**
79  * Customize the OPL - a string array of OPL records, each with comma-delimited data fields as follows:
80  * "plmn1,lac_start,lac_end,index".
81  *
82  * See 3GPP TS 31.102 v15.2.0 Section 4.2.59 EF_OPL.
83  */
84 constexpr const char *KEY_OPL_CUST_STRING_ARRAY = "opl_cust_string_array";
85 /**
86  * Indicates whether a modem is used as the bandwidth reporting source.
87  */
88 constexpr const char *KEY_BANDWIDTH_SOURCE_USE_MODEM_BOOL = "bandwidth_source_use_modem_bool";
89 /**
90  * Indicates whether to use uplink bandwidth value of LTE if it is NR NSA.
91  */
92 constexpr const char *KEY_UPLINK_BANDWIDTH_NR_NSA_USE_LTE_VALUE_BOOL = "uplink_bandwidth_nr_nsa_use_lte_value_bool";
93 /**
94  * Indicates the uplink and downlink bandwidth values for the network.
95  */
96 constexpr const char *KEY_BANDWIDTH_STRING_ARRAY = "bandwidth_string_array";
97 /**
98  * Indicates the MTU size.
99  */
100 constexpr const char *KEY_MTU_SIZE_STRING = "mtu_size_string";
101 /**
102  * Indicates the whether support single pdp mode.
103  */
104 constexpr const char *KEY_SINGLE_PDP_ENABLED_BOOL = "single_pdp_enabled_bool";
105 /**
106  * Indicates the whether carry ESM information to network.
107  */
108 constexpr const char *KEY_PLMN_ESM_FLAG_INT = "plmn_esm_flag_int";
109 /**
110  * Indicates the whether only support single pdp radio type array.
111  */
112 constexpr const char *KEY_SINGLE_PDP_RADIO_TYPE_INT_ARRAY = "single_pdp_radio_type_int_array";
113 /**
114  * Indicates default value of data roaming bool.
115  */
116 constexpr const char *KEY_DEFAULT_DATA_ROAMING_BOOL = "default_data_roaming_bool";
117 /**
118  * Indicates default value of data enable bool.
119  */
120 constexpr const char *KEY_DEFAULT_DATA_ENABLE_BOOL = "default_data_enable_bool";
121 /**
122  * Indicates the voice mail number from cust.
123  */
124 constexpr const char *KEY_VOICE_MAIL_NUMBER_STRING = "voice_mail_number_string";
125 /**
126  * Indicates the voice mail carrier from cust.
127  */
128 constexpr const char *KEY_VOICE_MAIL_CARRIER_STRING = "voice_mail_carrier_string";
129 /**
130  * Indicates the voice mail tag from cust.
131  */
132 constexpr const char *KEY_VOICE_MAIL_TAG_STRING = "voice_mail_tag_string";
133 /**
134  * Indicates whether to edit voice mail information to sim card.
135  */
136 constexpr const char *KEY_VOICE_MAIL_EDIT_NOT_TO_SIM_BOOL = "voice_mail_edit_not_to_sim_bool";
137 
138 constexpr const char *KEY_NR_MODE_SUPPORTED_INT = "nr_mode_supported_int";
139 
140 struct OperatorConfig : public Parcelable {
141     std::map<std::u16string, std::u16string> configValue {};
142     std::map<std::string, std::string> stringValue {};
143     std::map<std::string, std::vector<std::string>> stringArrayValue {};
144     std::map<std::string, int32_t> intValue {};
145     std::map<std::string, std::vector<int32_t>> intArrayValue {};
146     std::map<std::string, int64_t> longValue {};
147     std::map<std::string, std::vector<int64_t>> longArrayValue {};
148     std::map<std::string, bool> boolValue {};
149     const int32_t MAX_CONFIG_SIZE = 10000;
150     bool Marshalling(Parcel &parcel) const;
151     bool MarshallingU16StringMap(Parcel &parcel) const;
152     bool MarshallingStringMap(Parcel &parcel) const;
153     bool MarshallingBoolMap(Parcel &parcel) const;
154     bool MarshallingIntMap(Parcel &parcel) const;
155     bool MarshallingLongMap(Parcel &parcel) const;
156     bool MarshallingStringArrayMap(Parcel &parcel) const;
157     bool MarshallingIntArrayMap(Parcel &parcel) const;
158     bool MarshallingLongArrayMap(Parcel &parcel) const;
159     std::shared_ptr<OperatorConfig> UnMarshalling(Parcel &parcel);
160     bool ReadFromParcel(Parcel &parcel);
161     bool ReadFromU16StringMap(Parcel &parcel);
162     bool ReadFromStringMap(Parcel &parcel);
163     bool ReadFromIntMap(Parcel &parcel);
164     bool ReadFromBoolMap(Parcel &parcel);
165     bool ReadFromLongMap(Parcel &parcel);
166     bool ReadFromStringArrayMap(Parcel &parcel);
167     bool ReadFromIntArrayMap(Parcel &parcel);
168     bool ReadFromLongArrayMap(Parcel &parcel);
169 };
170 
171 struct ImsCapFromChip {
172     int32_t volteCap;
173     int32_t vowifiCap;
174     int32_t vonrCap;
175     int32_t vtCap;
176 };
177 } // namespace Telephony
178 } // namespace OHOS
179 #endif // TELEPHONY_OPERATOR_CONFIG_TYPES_H
180