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