• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-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 #ifndef OHOS_TEL_RIL_TEST_H
16 #define OHOS_TEL_RIL_TEST_H
17 
18 #include <iostream>
19 
20 #include "radio_event.h"
21 #include "securec.h"
22 #include "tel_ril_manager.h"
23 #include "telephony_log_wrapper.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 enum class DiffInterfaceId {
28     TEST_GET_SIM_CARD_STATUS = 1,
29     TEST_SIM_IO,
30     TEST_GET_SIM_SMS,
31     TEST_OPEN_LG_SIMIO,
32     TEST_TRANSMIT_APDU_LOGICAL_CHANNEL,
33     TEST_TRANSMIT_APDU_BASIC_CHANNEL,
34     TEST_CLOSE_LG_SIMIO,
35     TEST_SIM_AUTH,
36     TEST_SIM_SEND_NCFG_OPER_INFO,
37     TEST_GET_IMSI,
38     TEST_GET_ICCID,
39     TEST_GET_SIM_LOCK_STATUS,
40     TEST_SET_SIM_LOCK,
41     TEST_GET_CHANGE_SIM_PASSWD,
42     TEST_ENTER_SIM_PIN,
43     TEST_UNLOCK_SIM_PIN,
44     TEST_ENTER_SIM_PIN2,
45     TEST_UNLOCK_SIM_PIN2,
46     TEST_ENABLE_SIM_CARD,
47     TEST_GET_RILCM_VOICE_REGISTRATION_STATE_TEST,
48     TEST_GET_RILCM_DATA_REGISTRATION_STATE_TEST,
49     TEST_ACKNOWLEDGE_RILCM_LAST_INCOMING_GSM_SMS_TEST,
50     TEST_STK_SEND_TERMINAL_RESPONSE,
51     TEST_STK_SEND_ENVELOPE,
52     TEST_STK_SEND_CALL_SETUP_REQUEST_RESULT,
53     /* =========== Cellular Data Start ============= */
54     TEST_RILCM_SET_INIT_APN_INFO_TEST,
55     TEST_RILCM_SETUP_DATA_CALL_TEST,
56     TEST_RILCM_DEACTIVATE_DATA_CALL_TEST,
57     TEST_RILCM_GET_DATA_CALL_LIST_TEST,
58     TEST_RILCM_GET_LINK_BANDWIDTH_INFO,
59     TEST_RILCM_SET_LINK_BANDWIDTH_REPORTING_RULE,
60     TEST_RILCM_SET_DATA_PERMITTED_TEST,
61     TEST_RILCM_GET_LINK_CAPABILITY,
62     TEST_RILCM_CLEAN_ALL_DATA_CONNECTIONS_TEST,
63     TEST_RILCM_SEND_URSP_DECODE_RESULT,
64     TEST_RILCM_SEND_UE_POLICY_SECTION_IDENTIFIER,
65     TEST_RILCM_SEND_IMS_RSD_LIST,
66     TEST_RILCM_GET_NETWORKSLICE_ALLOWEDNSSAI,
67     TEST_RILCM_GET_NETWORKSLICE_EHPLMN,
68     /* =========== Cellular Data End ============= */
69     TEST_GET_SIGNAL_STRENGTH,
70     TEST_CALL_DIAL,
71     TEST_HANDUP_CONNECT,
72     TEST_ACCEPT_CALL,
73     TEST_HOLD_CALL,
74     TEST_ACTIVE_CALL,
75     TEST_SWAP_CALL,
76     TEST_CURRENT_CALLS,
77     TEST_REJECT_CALL,
78     TEST_JOIN_CALL,
79     TEST_SPLIT_CALL,
80     TEST_GET_CALL_WAIT,
81     TEST_SET_CALL_WAIT,
82     TEST_GET_CALL_FORWARD,
83     TEST_SET_CALL_FORWARD,
84     TEST_GET_CALL_DEAL_CLIP,
85     TEST_SET_CALL_CLIP,
86     TEST_GET_CALL_DEAL_CLIR,
87     TEST_SET_CALL_CLIR,
88     TEST_GET_CALL_RESTRICTION,
89     TEST_SET_CALL_RESTRICTION,
90     TEST_SEND_DTMF,
91     TEST_START_DTMF,
92     TEST_STOP_DTMF,
93     TEST_SEND_SMS,
94     TEST_SEND_CDMA_SMS,
95     TEST_STORAGE_SMS,
96     TEST_DELETE_SMS,
97     TEST_UPDATE_SMS,
98     TEST_SET_SMS_CENTER_ADDRESS,
99     TEST_GET_SMS_CENTER_ADDRESS,
100     TEST_SET_CB_CONFIG,
101     TEST_SET_CDMA_CB_CONFIG,
102     TEST_GET_CB_CONFIG,
103     TEST_GET_CDMA_CB_CONFIG,
104     TEST_SEND_SMS_EXPECT_MORE,
105     TEST_ADD_CDMA_SMS,
106     TEST_DEL_CDMA_SMS,
107     TEST_UPDATE_CDMA_SMS,
108 
109     TEST_SHUT_DOWN,
110     TEST_SET_POWER_STATE,
111     TEST_GET_POWER_STATE,
112     TEST_OPERATOR,
113     TEST_GET_NETWORKS_TO_USE,
114     TEST_GET_SELECTION_MOD_FOR_NETWORKS,
115     TEST_SET_MODE_AUTOMATIC_NETWORKS,
116     TEST_GET_CURRENT_CELL_INFO,
117     TEST_GET_CELL_INFO_LIST,
118     TEST_GET_PREFERRED_NETWORK_TYPE,
119     TEST_SET_PREFERRED_NETWORK_TYPE,
120     TEST_GET_IMEI,
121     TEST_GET_IMEISV,
122     TEST_GET_BASEBAND_VERSION,
123     TEST_GET_MEID,
124     TEST_SET_CALL_PREFERENCE_MODE,
125     TEST_GET_CALL_PREFERENCE_MODE,
126     TEST_GET_CS_REG_STATUS,
127     TEST_GET_PS_REG_STATUS,
128     TEST_GET_RADIO_PROTOCOL,
129     TEST_SET_RADIO_PROTOCOL,
130     TEST_GET_VOICE_RADIO_INFO,
131     TEST_GET_PHYSICAL_CHANNEL_CONFIG,
132     TEST_SET_LOCATE_UPDATES,
133     TEST_SET_NOTIFICATION_FILTER,
134     TEST_SET_DEVICE_STATE,
135     TEST_SET_USSD,
136     TEST_GET_USSD,
137     TEST_SET_MUTE,
138     TEST_GET_MUTE,
139     TEST_GET_XLEMA,
140     TEST_GET_CALL_FAIL,
141     TEST_SET_VONR_SWITCH,
142     TEST_GET_RRC_CONNECTION_STATE,
143     TEST_GET_NR_OPTION_MODE,
144     TEST_SET_NR_OPTION_MODE,
145     TEST_GET_NR_SSBID_INFO,
146     TEST_EXIT,
147 };
148 
149 enum class CustomMessageID : uint32_t {
150     MSG_OPEN_LOGICAL_CHANNEL_DONE = 0x7f000000,
151     MSG_TRANSMIT_LOGICAL_CHANNEL_DONE = 0x7f000001,
152     MSG_CLOSE_LOGICAL_CHANNEL_DONE = 0x7f000002,
153     MSG_TRANSMIT_BASIC_CHANNEL_DONE = 0x7f000003,
154     MSG_SIM_AUTHENTICATION_DONE = 0x7f000004,
155     MSG_SIM_SEND_NCFG_OPER_INFO_DONE = 0x7f000005
156 };
157 
158 const int32_t CID = 1;
159 const int32_t REASON = 2;
160 const int32_t TYPE = 7;
161 const int32_t MAXCONNSTIME = 8;
162 const int32_t MAXCONNS = 9;
163 const int32_t TYPESBITMAP = 12;
164 const int32_t P3 = 15;
165 const int32_t COMMAND = 192;
166 const int32_t FILEID = 20272;
167 const int32_t FILEID_SMS = 28476;
168 const int32_t AUTHTYPE_1 = 0;
169 const int32_t BANDWIDTH_HYSTERESIS_MS = 3000;
170 const int32_t BANDWIDTH_HYSTERESIS_KBPS = 50;
171 const int32_t MAX_DOWNLINK_LINK_BANDWIDTH[11] = { 100, // VoIP
172     500, // Web
173     1000, // SD
174     5000, // HD
175     10000, // file
176     20000, // 4K
177     50000, // LTE
178     100000,
179     200000, // 5G
180     500000, 1000000 };
181 const int32_t MAX_UPLINK_LINK_BANDWIDTH[9] = { 100, 500, 1000, 5000, 10000, 20000, 50000, 100000, 200000 };
182 
183 using namespace OHOS;
184 using namespace OHOS::Telephony;
185 using namespace std;
186 
187 class TelRilTest {
188 public:
189     TelRilTest();
190 
191     ~TelRilTest();
192 
193     std::shared_ptr<ITelRilManager> telRilManager_ = nullptr;
194 
195     void OnInitInterface();
196 
197     void OnInitCall();
198 
199     void OnInitSms();
200 
201     void OnInitSim();
202 
203     void OnInitNetwork();
204 
205     void OnInitForRegister(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
206 
207     void OnProcessInput(int32_t slotId, int32_t what, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
208 
209     void OnRequestCallGetCurrentCallsStatusTest(
210         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
211 
212     void OnRequestSimGetSimStatusTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
213 
214     void OnRequestSimIccIoTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
215 
216     void OnRequestOpenLGSimIOTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
217 
218     void OnRequestSimSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
219 
220     void OnRequestTransmitApduLogicalChannelTest(int32_t slotId,
221         const std::shared_ptr<AppExecFwk::EventHandler> &handler);
222 
223     void OnRequestTransmitApduBasicChannelTest(int32_t slotId,
224         const std::shared_ptr<AppExecFwk::EventHandler> &handler);
225 
226     void OnRequestSimAuthenticationTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
227 
228     void OnRequestSendSimMatchedOperatorInfoTest(
229         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
230 
231     void OnRequestCloseLGSimIOTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
232 
233     void OnRequestSimGetImsiTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
234 
235     void OnRequestGetSimLockStatusTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
236 
237     void OnRequestSetSimLockTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
238 
239     void OnRequestChangeSimPasswordTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
240 
241     void OnRequestEnterSimPinTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
242 
243     void OnRequestUnlockSimPinTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
244 
245     void OnRequestEnterSimPin2Test(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
246 
247     void OnRequestUnlockSimPin2Test(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
248 
249     void OnRequestSetActiveSimTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
250 
251     void OnRequestGetRadioProtocolTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
252 
253     void OnRequestSetRadioProtocolTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
254 
255     void OnRequestSendTerminalResponseCmdTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
256 
257     void OnRequestSendEnvelopeCmdTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
258 
259     void OnRequestSendCallSetupRequestResultTest(
260         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
261 
262     void OnRequestNetworkGetRssiTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
263 
264     void OnRequestRefusedCallTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
265 
266     void OnRequestGetCallWaitTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
267 
268     void OnRequestSetCallWaitTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
269 
270     void OnRequestCallHangupTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
271 
272     void OnRequestCallJoinTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
273 
274     void OnRequestSeparateConferenceTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
275 
276     void OnRequestCallAnswerTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
277 
278     void OnRequestCallHoldTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
279 
280     void OnRequestCallDialTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
281 
282     void OnRequestCallActiveTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
283 
284     void OnRequestCallSwapTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
285 
286     void OnRequestGetClipTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
287 
288     void OnRequestSendDtmfTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
289 
290     void OnRequestStartDtmfTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
291 
292     void OnRequestStopDtmfTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
293 
294     void OnRequestSetClipTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
295 
296     void OnRequestGetClirTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
297 
298     void OnRequestSetClirTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
299 
300     void OnRequestGetCallRestrictionTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
301 
302     void OnRequestSetCallRestrictionTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
303 
304     void OnRequestNetworkVoiceRegistrationStateTest(
305         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
306 
307     void OnRequestNetworkDataRegistrationStateTest(
308         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
309 
310     void OnRequestGetCallForwardTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
311 
312     void OnRequestSetCallForwardTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
313 
314     void OnRequestNetworkOperatorTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
315 
316     void OnRequestSendRilCmSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
317 
318     void OnRequestSendRilCmCdmaSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
319 
320     void OnRequestStorageRilCmSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
321 
322     void OnRequestDeleteRilCmSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
323 
324     void OnRequestUpdateRilCmSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
325 
326     void OnRequestSetRilCmSmsCenterAddressTest(
327         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
328 
329     void OnRequestGetRilCmSmsCenterAddressTest(
330         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
331 
332     void OnRequestSetRilCBConfigTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
333 
334     void OnRequestSetRilCdmaCBConfigTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
335 
336     void OnRequestGetRilCBConfigTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
337 
338     void OnRequestGetRilCdmaCBConfigTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
339 
340     void OnRequestSmsSendSmsExpectMoreTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
341 
342     void OnRequestAddRilCmCdmaSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
343 
344     void OnRequestDelRilCmCdmaSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
345 
346     void OnRequestUpdateRilCmCdmaSmsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
347 
348     void OnRequestShutDownTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
349 
350     void OnRequestSetRadioStateTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
351 
352     void OnRequestGetRadioStateTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
353 
354     void OnRequestGetCellInfoListTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
355 
356     void OnRequestGetCurrentCellInfoTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
357 
358     void OnRequestSmsAcknowledgeTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
359 
360     void OnRequestSetInitApnInfoTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
361     void OnRequestDataSetupDataCallTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
362     void OnRequestDataDisableDataCallTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
363     void OnRequestGetDataCallListTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
364     void OnRequestGetLinkBandwidthInfoTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
365     void OnRequestSetLinkBandwidthReportingRuleTest(
366         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
367     void OnRequestSetDataPermittedTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
368     void OnRequestGetLinkCapabilityTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
369     void OnRequestCleanAllConnectionsTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
370     void OnRequestSendUePolicySectionIdentifier(int32_t slotId,
371         const std::shared_ptr<AppExecFwk::EventHandler> &handler);
372     void OnRequestSendUrspDecodeResult(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
373     void OnRequestSendImsRsdList(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
374     void OnRequestGetNetworkSliceAllowedNssai(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
375     void OnRequestGetNetworkSliceEhplmn(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
376 
377     void OnRequestGetNetworkSearchInformationTest(
378         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
379     void OnRequestGetNetworkSelectionModeTest(
380         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
381     void OnRequestSetNetworkSelectionModeTest(
382         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
383     void OnRequestSetPreferredNetworkTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
384     void OnRequestGetPreferredNetworkTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
385     void OnRequestGetImeiTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
386     void OnRequestGetBasebandVersionTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
387     void OnRequestGetMeidTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
388     void OnRequestGetCsRegStatusTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
389     void OnRequestGetPsRegStatusTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
390     void OnRequestGetVoiceRadioTechnology(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
391     void OnRequestGetPhysicalChannelConfig(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
392     void OnRequestSetLocateUpdatesTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
393     void OnRequestSetNotificationFilterTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
394     void OnRequestSetDeviceStateTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
395 
396     void OnRequestSetCallPreferenceModeTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
397     void OnRequestGetCallPreferenceModeTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
398     void OnRequestSetUssdTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
399     void OnRequestGetUssdTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
400     void OnRequestSetMuteTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
401     void OnRequestGetMuteTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
402     void OnRequestGetEmergencyCallListTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
403     void OnRequestGetCallFailReasonTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
404     void OnRequestSetVoNRSwitchTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
405     void OnRequestGetRrcConnectionStateTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
406     void OnRequestGetNrOptionModeTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
407     void OnRequestSetNrOptionModeTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
408     void OnRequestGetNrSsbIdTest(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
409 
410     class DemoHandler : public AppExecFwk::EventHandler {
411     public:
DemoHandler(int32_t slotId,const std::shared_ptr<AppExecFwk::EventRunner> & runner)412         explicit DemoHandler(int32_t slotId, const std::shared_ptr<AppExecFwk::EventRunner> &runner)
413             : AppExecFwk::EventHandler(runner), slotId_(slotId)
414         {}
415 
~DemoHandler()416         ~DemoHandler() {}
417 
418         void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
419 
420     private:
421         int32_t slotId_;
422         void OnRequestGetBasebandVersionTestResponse(const AppExecFwk::InnerEvent::Pointer &event);
423         void OnRequestShutDownTestResponse(const AppExecFwk::InnerEvent::Pointer &event);
424         void ProcessRecordSize(const AppExecFwk::InnerEvent::Pointer &event);
425         void GetFileAndDataSize(const unsigned char *data, int &fileSize, int &dataSize);
426     };
427 
428 private:
429     using RilManagerAndResponseTestFun = void (TelRilTest::*)(
430         int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
431     std::map<DiffInterfaceId, RilManagerAndResponseTestFun> memberFuncMap_;
432 };
433 } // namespace Telephony
434 } // namespace OHOS
435 #endif // OHOS_TEL_RIL_TEST_H
436