1 /*
2 * Copyright (C) 2022-2024 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 #include "ril_callback_test.h"
17
18 #include "telephony_log_wrapper.h"
19
20 namespace OHOS {
21 namespace Telephony {
22 using namespace OHOS::HDI::Ril::V1_5;
NotifyAll()23 void RilCallbackTest::NotifyAll()
24 {
25 std::unique_lock<std::mutex> callbackLock(callbackMutex_);
26 if (resultInfo_.serial != currentSerialId_) {
27 hdiId_ = HdiId::HREQ_NONE;
28 TELEPHONY_LOGI("NotifyAll currentSerialId_ : %{public}d, serial: %{public}d not equal", currentSerialId_,
29 resultInfo_.serial);
30 return;
31 }
32 cv_.notify_all();
33 }
34
WaitFor(int32_t timeoutSecond)35 void RilCallbackTest::WaitFor(int32_t timeoutSecond)
36 {
37 Clean();
38 std::unique_lock<std::mutex> callbackLock(callbackMutex_);
39 cv_.wait_for(callbackLock, std::chrono::seconds(timeoutSecond));
40 }
41
Clean()42 void RilCallbackTest::Clean()
43 {
44 hdiId_ = HdiId::HREQ_NONE;
45 }
46
GetBoolResult(HdiId hdiId)47 bool RilCallbackTest::GetBoolResult(HdiId hdiId)
48 {
49 TELEPHONY_LOGI("GetBoolResult hdiId: %{public}d, error: %{public}d", hdiId, (int32_t)resultInfo_.error);
50 bool ret = false;
51 if (hdiId_ == HdiId::HREQ_NONE) {
52 TELEPHONY_LOGE(
53 "response timeout, not implemented hdiId: %{public}d, current hdiId_: %{public}d", (int32_t)hdiId, hdiId_);
54 ret = true;
55 Clean();
56 return ret;
57 }
58 if (hdiId_ != hdiId) {
59 ret = false;
60 TELEPHONY_LOGE(
61 "GetBoolResult hdiId does not match. hdiId: %{public}d, current hdiId: %{public}d", (int32_t)hdiId, hdiId_);
62 Clean();
63 return ret;
64 }
65 ret = true;
66 Clean();
67 return ret;
68 }
69
70 // SIM
SimStateUpdated(const RilRadioResponseInfo & responseInfo)71 int32_t RilCallbackTest::SimStateUpdated(const RilRadioResponseInfo &responseInfo)
72 {
73 TELEPHONY_LOGI("SimStateUpdated notice : slotId = %{public}d", responseInfo.slotId);
74 auto g_rilInterface = OHOS::HDI::Ril::V1_2::IRil::Get();
75 if (g_rilInterface != nullptr) {
76 g_rilInterface->GetSimStatus(GetSerialId(), responseInfo.slotId);
77 }
78 return 0;
79 }
80
SimStkSessionEndNotify(const RilRadioResponseInfo & responseInfo)81 int32_t RilCallbackTest::SimStkSessionEndNotify(const RilRadioResponseInfo &responseInfo)
82 {
83 TELEPHONY_LOGI("SimStkSessionEndNotify notice : slotId = %{public}d", responseInfo.slotId);
84 return 0;
85 }
86
SimStkProactiveNotify(const RilRadioResponseInfo & responseInfo,const std::string & response)87 int32_t RilCallbackTest::SimStkProactiveNotify(const RilRadioResponseInfo &responseInfo, const std::string &response)
88 {
89 TELEPHONY_LOGI("SimStkProactiveNotify notice : slotId = %{public}d, response = %{public}s", responseInfo.slotId,
90 response.c_str());
91 return 0;
92 }
93
SimStkAlphaNotify(const RilRadioResponseInfo & responseInfo,const std::string & response)94 int32_t RilCallbackTest::SimStkAlphaNotify(const RilRadioResponseInfo &responseInfo, const std::string &response)
95 {
96 TELEPHONY_LOGI(
97 "SimStkAlphaNotify notice : slotId = %{public}d, response = %{public}s", responseInfo.slotId, response.c_str());
98 return 0;
99 }
100
SimStkEventNotify(const RilRadioResponseInfo & responseInfo,const std::string & response)101 int32_t RilCallbackTest::SimStkEventNotify(const RilRadioResponseInfo &responseInfo, const std::string &response)
102 {
103 TELEPHONY_LOGI(
104 "SimStkEventNotify notice : slotId = %{public}d, response = %{public}s", responseInfo.slotId, response.c_str());
105 return 0;
106 }
107
SimStkCallSetupNotify(const RilRadioResponseInfo & responseInfo)108 int32_t RilCallbackTest::SimStkCallSetupNotify(const RilRadioResponseInfo &responseInfo)
109 {
110 TELEPHONY_LOGI("SimStkCallSetupNotify notice : slotId = %{public}d", responseInfo.slotId);
111 return 0;
112 }
113
SimRefreshNotify(const RilRadioResponseInfo & responseInfo)114 int32_t RilCallbackTest::SimRefreshNotify(const RilRadioResponseInfo &responseInfo)
115 {
116 TELEPHONY_LOGI("SimRefreshNotify notice : slotId = %{public}d", responseInfo.slotId);
117 return 0;
118 }
119
GetSimStatusResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::CardStatusInfo & result)120 int32_t RilCallbackTest::GetSimStatusResponse(
121 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const HDI::Ril::V1_1::CardStatusInfo &result)
122 {
123 TELEPHONY_LOGI(
124 "GetBoolResult GetSimStatus result : slotId = %{public}d, simType = %{public}d, simState = %{public}d",
125 responseInfo.slotId, result.simType, result.simState);
126 simState_[responseInfo.slotId] = result.simState;
127 TELEPHONY_LOGI("IsReady %{public}d %{public}d", responseInfo.slotId, simState_[responseInfo.slotId]);
128 hdiId_ = HdiId::HREQ_SIM_GET_SIM_STATUS;
129 resultInfo_ = responseInfo;
130 NotifyAll();
131 return 0;
132 }
133
GetSimCardStatusResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_3::SimCardStatusInfo & result)134 int32_t RilCallbackTest::GetSimCardStatusResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
135 const HDI::Ril::V1_3::SimCardStatusInfo &result)
136 {
137 TELEPHONY_LOGI("GetBoolResult GetSimCardStatus result : slotId = %{public}d, simType = %{public}d,"
138 "simState = %{public}d", responseInfo.slotId, result.simType, result.simState);
139 simState_[responseInfo.slotId] = result.simState;
140 TELEPHONY_LOGI("IsReady %{public}d %{public}d", responseInfo.slotId, simState_[responseInfo.slotId]);
141 hdiId_ = HdiId::HREQ_SIM_GET_SIM_STATUS;
142 resultInfo_ = responseInfo;
143 NotifyAll();
144 return 0;
145 }
146
GetSimIOResponse(const RilRadioResponseInfo & responseInfo,const IccIoResultInfo & result)147 int32_t RilCallbackTest::GetSimIOResponse(const RilRadioResponseInfo &responseInfo, const IccIoResultInfo &result)
148 {
149 TELEPHONY_LOGI("GetBoolResult GetSimIO result : sw1 = %{public}d, sw2 = %{public}d, response = %{public}s",
150 result.sw1, result.sw2, result.response.c_str());
151 hdiId_ = HdiId::HREQ_SIM_GET_SIM_IO;
152 resultInfo_ = responseInfo;
153 NotifyAll();
154 return 0;
155 }
156
GetImsiResponse(const RilRadioResponseInfo & responseInfo,const std::string & response)157 int32_t RilCallbackTest::GetImsiResponse(const RilRadioResponseInfo &responseInfo, const std::string &response)
158 {
159 TELEPHONY_LOGI("GetBoolResult GetImsi result : response = %{public}s", response.c_str());
160 hdiId_ = HdiId::HREQ_SIM_GET_IMSI;
161 resultInfo_ = responseInfo;
162 NotifyAll();
163 return 0;
164 }
165
GetSimLockStatusResponse(const RilRadioResponseInfo & responseInfo,int32_t simLockStatus)166 int32_t RilCallbackTest::GetSimLockStatusResponse(const RilRadioResponseInfo &responseInfo, int32_t simLockStatus)
167 {
168 TELEPHONY_LOGI("GetBoolResult GetSimLockStatus result : simLockStatus = %{public}d", simLockStatus);
169 hdiId_ = HdiId::HREQ_SIM_GET_SIM_LOCK_STATUS;
170 resultInfo_ = responseInfo;
171 NotifyAll();
172 return 0;
173 }
174
SetSimLockResponse(const RilRadioResponseInfo & responseInfo,const LockStatusResp & lockStatus)175 int32_t RilCallbackTest::SetSimLockResponse(const RilRadioResponseInfo &responseInfo, const LockStatusResp &lockStatus)
176 {
177 TELEPHONY_LOGI("GetBoolResult SetSimLock result : result = %{public}d, remain = %{public}d", lockStatus.result,
178 lockStatus.remain);
179 hdiId_ = HdiId::HREQ_SIM_SET_SIM_LOCK;
180 resultInfo_ = responseInfo;
181 NotifyAll();
182 return 0;
183 }
184
ChangeSimPasswordResponse(const RilRadioResponseInfo & responseInfo,const LockStatusResp & lockStatus)185 int32_t RilCallbackTest::ChangeSimPasswordResponse(
186 const RilRadioResponseInfo &responseInfo, const LockStatusResp &lockStatus)
187 {
188 TELEPHONY_LOGI("GetBoolResult ChangeSimPassword result : result = %{public}d, remain = %{public}d",
189 lockStatus.result, lockStatus.remain);
190 hdiId_ = HdiId::HREQ_SIM_CHANGE_SIM_PASSWORD;
191 resultInfo_ = responseInfo;
192 NotifyAll();
193 return 0;
194 }
195
UnlockPinResponse(const RilRadioResponseInfo & responseInfo,const LockStatusResp & lockStatus)196 int32_t RilCallbackTest::UnlockPinResponse(const RilRadioResponseInfo &responseInfo, const LockStatusResp &lockStatus)
197 {
198 TELEPHONY_LOGI("GetBoolResult UnlockPin result : result = %{public}d, remain = %{public}d", lockStatus.result,
199 lockStatus.remain);
200 hdiId_ = HdiId::HREQ_SIM_UNLOCK_PIN;
201 resultInfo_ = responseInfo;
202 NotifyAll();
203 return 0;
204 }
205
UnlockPukResponse(const RilRadioResponseInfo & responseInfo,const LockStatusResp & lockStatus)206 int32_t RilCallbackTest::UnlockPukResponse(const RilRadioResponseInfo &responseInfo, const LockStatusResp &lockStatus)
207 {
208 TELEPHONY_LOGI("GetBoolResult UnlockPuk result : result = %{public}d, remain = %{public}d", lockStatus.result,
209 lockStatus.remain);
210 hdiId_ = HdiId::HREQ_SIM_UNLOCK_PUK;
211 resultInfo_ = responseInfo;
212 NotifyAll();
213 return 0;
214 }
215
UnlockPin2Response(const RilRadioResponseInfo & responseInfo,const LockStatusResp & lockStatus)216 int32_t RilCallbackTest::UnlockPin2Response(const RilRadioResponseInfo &responseInfo, const LockStatusResp &lockStatus)
217 {
218 TELEPHONY_LOGI("GetBoolResult UnlockPin2 result : result = %{public}d, remain = %{public}d", lockStatus.result,
219 lockStatus.remain);
220 hdiId_ = HdiId::HREQ_SIM_UNLOCK_PIN2;
221 resultInfo_ = responseInfo;
222 NotifyAll();
223 return 0;
224 }
225
UnlockPuk2Response(const RilRadioResponseInfo & responseInfo,const LockStatusResp & lockStatus)226 int32_t RilCallbackTest::UnlockPuk2Response(const RilRadioResponseInfo &responseInfo, const LockStatusResp &lockStatus)
227 {
228 TELEPHONY_LOGI("GetBoolResult UnlockPuk2 result : result = %{public}d, remain = %{public}d", lockStatus.result,
229 lockStatus.remain);
230 hdiId_ = HdiId::HREQ_SIM_UNLOCK_PUK2;
231 resultInfo_ = responseInfo;
232 NotifyAll();
233 return 0;
234 }
235
SetActiveSimResponse(const RilRadioResponseInfo & responseInfo)236 int32_t RilCallbackTest::SetActiveSimResponse(const RilRadioResponseInfo &responseInfo)
237 {
238 TELEPHONY_LOGI("GetBoolResult SetActiveSim result");
239 hdiId_ = HdiId::HREQ_SIM_SET_ACTIVE_SIM;
240 resultInfo_ = responseInfo;
241 NotifyAll();
242 return 0;
243 }
244
SimStkSendTerminalResponseResponse(const RilRadioResponseInfo & responseInfo)245 int32_t RilCallbackTest::SimStkSendTerminalResponseResponse(const RilRadioResponseInfo &responseInfo)
246 {
247 TELEPHONY_LOGI("GetBoolResult SimStkSendTerminalResponse result");
248 hdiId_ = HdiId::HREQ_SIM_STK_SEND_TERMINAL_RESPONSE;
249 resultInfo_ = responseInfo;
250 NotifyAll();
251 return 0;
252 }
253
SimStkSendEnvelopeResponse(const RilRadioResponseInfo & responseInfo)254 int32_t RilCallbackTest::SimStkSendEnvelopeResponse(const RilRadioResponseInfo &responseInfo)
255 {
256 TELEPHONY_LOGI("GetBoolResult SimStkSendEnvelope result");
257 hdiId_ = HdiId::HREQ_SIM_STK_SEND_ENVELOPE;
258 resultInfo_ = responseInfo;
259 NotifyAll();
260 return 0;
261 }
262
SimStkSendCallSetupRequestResultResponse(const RilRadioResponseInfo & responseInfo)263 int32_t RilCallbackTest::SimStkSendCallSetupRequestResultResponse(const RilRadioResponseInfo &responseInfo)
264 {
265 TELEPHONY_LOGI("GetBoolResult SimStkSendCallSetupRequestResult result");
266 hdiId_ = HdiId::HREQ_SIM_STK_SEND_CALL_SETUP_REQUEST_RESULT;
267 resultInfo_ = responseInfo;
268 NotifyAll();
269 return 0;
270 }
271
SimStkIsReadyResponse(const RilRadioResponseInfo & responseInfo)272 int32_t RilCallbackTest::SimStkIsReadyResponse(const RilRadioResponseInfo &responseInfo)
273 {
274 TELEPHONY_LOGI("GetBoolResult SimStkIsReady result");
275 hdiId_ = HdiId::HREQ_SIM_STK_IS_READY;
276 resultInfo_ = responseInfo;
277 NotifyAll();
278 return 0;
279 }
280
SetRadioProtocolResponse(const RilRadioResponseInfo & responseInfo,const RadioProtocol & radioProtocol)281 int32_t RilCallbackTest::SetRadioProtocolResponse(
282 const RilRadioResponseInfo &responseInfo, const RadioProtocol &radioProtocol)
283 {
284 TELEPHONY_LOGI("GetBoolResult SetRadioProtocol result : phase = %{public}d, slotId = %{public}d",
285 radioProtocol.phase, radioProtocol.slotId);
286 hdiId_ = HdiId::HREQ_SIM_RADIO_PROTOCOL;
287 resultInfo_ = responseInfo;
288 NotifyAll();
289 return 0;
290 }
291
SimOpenLogicalChannelResponse(const RilRadioResponseInfo & responseInfo,const OpenLogicalChannelResponse & pOpenLogicalChannelResponse)292 int32_t RilCallbackTest::SimOpenLogicalChannelResponse(
293 const RilRadioResponseInfo &responseInfo, const OpenLogicalChannelResponse &pOpenLogicalChannelResponse)
294 {
295 TELEPHONY_LOGI(
296 "GetBoolResult SimOpenLogicalChannel result : sw1 = %{public}d, sw2 = %{public}d, channelId = %{public}d, "
297 "response = %{public}s",
298 pOpenLogicalChannelResponse.sw1, pOpenLogicalChannelResponse.sw2, pOpenLogicalChannelResponse.channelId,
299 pOpenLogicalChannelResponse.response.c_str());
300 currentChannelId_ = pOpenLogicalChannelResponse.channelId;
301 hdiId_ = HdiId::HREQ_SIM_OPEN_LOGICAL_CHANNEL;
302 resultInfo_ = responseInfo;
303 NotifyAll();
304 return 0;
305 }
306
SimCloseLogicalChannelResponse(const RilRadioResponseInfo & responseInfo)307 int32_t RilCallbackTest::SimCloseLogicalChannelResponse(const RilRadioResponseInfo &responseInfo)
308 {
309 TELEPHONY_LOGI("GetBoolResult SimCloseLogicalChannel result");
310 hdiId_ = HdiId::HREQ_SIM_CLOSE_LOGICAL_CHANNEL;
311 resultInfo_ = responseInfo;
312 NotifyAll();
313 return 0;
314 }
315
SimTransmitApduLogicalChannelResponse(const RilRadioResponseInfo & responseInfo,const IccIoResultInfo & result)316 int32_t RilCallbackTest::SimTransmitApduLogicalChannelResponse(
317 const RilRadioResponseInfo &responseInfo, const IccIoResultInfo &result)
318 {
319 TELEPHONY_LOGI(
320 "GetBoolResult SimTransmitApduLogicalChannel result : sw1 = %{public}d, sw2 = %{public}d, response = "
321 "%{public}s",
322 result.sw1, result.sw2, result.response.c_str());
323 hdiId_ = HdiId::HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL;
324 resultInfo_ = responseInfo;
325 NotifyAll();
326 return 0;
327 }
328
SimTransmitApduBasicChannelResponse(const RilRadioResponseInfo & responseInfo,const IccIoResultInfo & result)329 int32_t RilCallbackTest::SimTransmitApduBasicChannelResponse(
330 const RilRadioResponseInfo &responseInfo, const IccIoResultInfo &result)
331 {
332 TELEPHONY_LOGI(
333 "GetBoolResult SimTransmitApduBasicChannel result : sw1 = %{public}d, sw2 = %{public}d, response = %{public}s",
334 result.sw1, result.sw2, result.response.c_str());
335 hdiId_ = HdiId::HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL;
336 resultInfo_ = responseInfo;
337 NotifyAll();
338 return 0;
339 }
340
SimAuthenticationResponse(const RilRadioResponseInfo & responseInfo,const IccIoResultInfo & result)341 int32_t RilCallbackTest::SimAuthenticationResponse(
342 const RilRadioResponseInfo &responseInfo, const IccIoResultInfo &result)
343 {
344 TELEPHONY_LOGI("GetBoolResult SimAuthentication result : sw1 = %{public}d, sw2 = %{public}d, response = %{public}s",
345 result.sw1, result.sw2, result.response.c_str());
346 hdiId_ = HdiId::HREQ_SIM_AUTHENTICATION;
347 resultInfo_ = responseInfo;
348 NotifyAll();
349 return 0;
350 }
351
UnlockSimLockResponse(const RilRadioResponseInfo & responseInfo,const LockStatusResp & lockStatus)352 int32_t RilCallbackTest::UnlockSimLockResponse(
353 const RilRadioResponseInfo &responseInfo, const LockStatusResp &lockStatus)
354 {
355 TELEPHONY_LOGI("GetBoolResult UnlockSimLock result : result = %{public}d, remain = %{public}d", lockStatus.result,
356 lockStatus.remain);
357 hdiId_ = HdiId::HREQ_SIM_UNLOCK_SIM_LOCK;
358 resultInfo_ = responseInfo;
359 NotifyAll();
360 return 0;
361 }
362
SendSimMatchedOperatorInfoResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)363 int32_t RilCallbackTest::SendSimMatchedOperatorInfoResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
364 {
365 TELEPHONY_LOGI("GetBoolResult SendSimMatchedOperatorInfo result");
366 hdiId_ = HdiId::HREQ_SIM_SEND_NCFG_OPER_INFO;
367 resultInfo_ = responseInfo;
368 NotifyAll();
369 return 0;
370 }
371
GetPrimarySlotResponse(const RilRadioResponseInfo & responseInfo,int32_t primarySlot)372 int32_t RilCallbackTest::GetPrimarySlotResponse(const RilRadioResponseInfo &responseInfo, int32_t primarySlot)
373 {
374 TELEPHONY_LOGI("GetBoolResult GetPrimarySlotResponse result : primarySlot = %{public}d", primarySlot);
375 hdiId_ = HdiId::HREQ_SIM_GET_PRIMARY_SLOT;
376 resultInfo_ = responseInfo;
377 NotifyAll();
378 return 0;
379 }
380
SetPrimarySlotResponse(const RilRadioResponseInfo & responseInfo)381 int32_t RilCallbackTest::SetPrimarySlotResponse(const RilRadioResponseInfo &responseInfo)
382 {
383 TELEPHONY_LOGI("GetBoolResult SetPrimarySlotResponse result");
384 hdiId_ = HdiId::HREQ_SIM_SET_PRIMARY_SLOT;
385 resultInfo_ = responseInfo;
386 NotifyAll();
387 return 0;
388 }
389
390 // Network
NetworkCsRegStatusUpdated(const RilRadioResponseInfo & responseInfo,const CsRegStatusInfo & csRegStatusInfo)391 int32_t RilCallbackTest::NetworkCsRegStatusUpdated(
392 const RilRadioResponseInfo &responseInfo, const CsRegStatusInfo &csRegStatusInfo)
393 {
394 TELEPHONY_LOGI("RilCallbackTest::NetworkCsRegStatusUpdated notifyType:%{public}d, regStatus:%{public}d, "
395 "lacCode:%{public}d, cellId:%{public}d, radioTechnology:%{public}d",
396 csRegStatusInfo.notifyType, csRegStatusInfo.regStatus, csRegStatusInfo.lacCode, csRegStatusInfo.cellId,
397 csRegStatusInfo.radioTechnology);
398 return 0;
399 }
400
NetworkPsRegStatusUpdated(const RilRadioResponseInfo & responseInfo,const PsRegStatusInfo & psRegStatusInfo)401 int32_t RilCallbackTest::NetworkPsRegStatusUpdated(
402 const RilRadioResponseInfo &responseInfo, const PsRegStatusInfo &psRegStatusInfo)
403 {
404 TELEPHONY_LOGI(
405 "RilCallbackTest::NetworkPsRegStatusUpdated notifyType:%{public}d, regStatus:%{public}d, lacCode:%{public}d, "
406 "cellId:%{public}d, tech:%{public}d, nrRestricted:%{public}d, nrAvailable:%{public}d, enDcAvailable:%{public}d",
407 psRegStatusInfo.notifyType, psRegStatusInfo.regStatus, psRegStatusInfo.lacCode, psRegStatusInfo.cellId,
408 psRegStatusInfo.radioTechnology, psRegStatusInfo.isDcNrRestricted, psRegStatusInfo.isNrAvailable,
409 psRegStatusInfo.isEnDcAvailable);
410 return 0;
411 }
412
SignalStrengthUpdated(const RilRadioResponseInfo & responseInfo,const Rssi & rssi)413 int32_t RilCallbackTest::SignalStrengthUpdated(const RilRadioResponseInfo &responseInfo, const Rssi &rssi)
414 {
415 TELEPHONY_LOGI(
416 "RilCallbackTest::SignalStrengthUpdated rxlev:%{public}d rsrp:%{public}d", rssi.lte.rxlev, rssi.lte.rsrp);
417 return 0;
418 }
419
NetworkTimeZoneUpdated(const RilRadioResponseInfo & responseInfo,const std::string & timeZoneStr)420 int32_t RilCallbackTest::NetworkTimeZoneUpdated(
421 const RilRadioResponseInfo &responseInfo, const std::string &timeZoneStr)
422 {
423 TELEPHONY_LOGI("RilCallbackTest::NetworkTimeZoneUpdated timeZone:%{public}s", timeZoneStr.c_str());
424 return 0;
425 }
426
NetworkTimeUpdated(const RilRadioResponseInfo & responseInfo,const std::string & timeStr)427 int32_t RilCallbackTest::NetworkTimeUpdated(const RilRadioResponseInfo &responseInfo, const std::string &timeStr)
428 {
429 TELEPHONY_LOGI("RilCallbackTest::NetworkTimeZoneUpdated time:%{public}s", timeStr.c_str());
430 return 0;
431 }
432
NetworkPhyChnlCfgUpdated(const RilRadioResponseInfo & responseInfo,const ChannelConfigInfoList & channelConfigInfoList)433 int32_t RilCallbackTest::NetworkPhyChnlCfgUpdated(
434 const RilRadioResponseInfo &responseInfo, const ChannelConfigInfoList &channelConfigInfoList)
435 {
436 TELEPHONY_LOGI("RilCallbackTest::NetworkPhyChnlCfgUpdated itemNum:%{public}d", channelConfigInfoList.itemNum);
437 for (PhysicalChannelConfig phyChnlCfg : channelConfigInfoList.channelConfigInfos) {
438 TELEPHONY_LOGI(
439 "RilCallbackTest::NetworkPhyChnlCfgUpdated cellConnStatus:%{public}d, "
440 "cellBandwidthDownlinkKhz:%{public}d, cellBandwidthUplinkKhz:%{public}d, physicalCellId:%{public}d, "
441 "ratType:%{public}d, freqRange:%{public}d, downlinkChannelNum:%{public}d, "
442 "uplinkChannelNum:%{public}d, contextIdNum:%{public}d",
443 phyChnlCfg.cellConnStatus, phyChnlCfg.cellBandwidthDownlinkKhz, phyChnlCfg.cellBandwidthUplinkKhz,
444 phyChnlCfg.ratType, phyChnlCfg.freqRange, phyChnlCfg.downlinkChannelNum, phyChnlCfg.uplinkChannelNum,
445 phyChnlCfg.physicalCellId, phyChnlCfg.contextIdNum);
446 for (int32_t j = 0; j < phyChnlCfg.contextIdNum; j++) {
447 TELEPHONY_LOGI("contextIds[%{public}d]:%{public}d", j, phyChnlCfg.contextIds[j]);
448 }
449 }
450 return 0;
451 }
452
NetworkCurrentCellUpdated(const RilRadioResponseInfo & responseInfo,const CellListCurrentInfo & cellListCurrentInfo)453 int32_t RilCallbackTest::NetworkCurrentCellUpdated(
454 const RilRadioResponseInfo &responseInfo, const CellListCurrentInfo &cellListCurrentInfo)
455 {
456 TELEPHONY_LOGI("itemNum:%{public}d", cellListCurrentInfo.itemNum);
457 for (auto info : cellListCurrentInfo.cellCurrentInfo) {
458 TELEPHONY_LOGI("ratType:%{public}d, mcc:%{public}d, mnc:%{public}d", info.ratType, info.mcc, info.mnc);
459 switch (static_cast<RatType>(info.ratType)) {
460 case RatType::NETWORK_TYPE_LTE:
461 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.lte.cellId);
462 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
463 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
464 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
465 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
466 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rssi);
467 break;
468 case RatType::NETWORK_TYPE_GSM:
469 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
470 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
471 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
472 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
473 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
474 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
475 break;
476 case RatType::NETWORK_TYPE_WCDMA:
477 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
478 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
479 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
480 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
481 break;
482 case RatType::NETWORK_TYPE_NR:
483 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
484 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
485 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
486 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.nr.nci);
487 break;
488 default:
489 TELEPHONY_LOGE("invalid ratType");
490 break;
491 }
492 }
493 return 0;
494 }
495
NetworkCurrentCellUpdated_1_1(const RilRadioResponseInfo & responseInfo,const CellListCurrentInfo_1_1 & cellListCurrentInfo)496 int32_t RilCallbackTest::NetworkCurrentCellUpdated_1_1(
497 const RilRadioResponseInfo &responseInfo, const CellListCurrentInfo_1_1 &cellListCurrentInfo)
498 {
499 TELEPHONY_LOGI("itemNum:%{public}d", cellListCurrentInfo.itemNum);
500 for (auto info : cellListCurrentInfo.cellCurrentInfo) {
501 TELEPHONY_LOGI("ratType:%{public}d, mcc:%{public}d, mnc:%{public}d", info.ratType, info.mcc, info.mnc);
502 switch (static_cast<RatType>(info.ratType)) {
503 case RatType::NETWORK_TYPE_LTE:
504 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.lte.cellId);
505 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
506 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
507 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
508 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
509 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rssi);
510 break;
511 case RatType::NETWORK_TYPE_GSM:
512 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
513 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
514 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
515 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
516 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
517 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
518 break;
519 case RatType::NETWORK_TYPE_WCDMA:
520 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
521 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
522 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
523 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
524 break;
525 case RatType::NETWORK_TYPE_NR:
526 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
527 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
528 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
529 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.nr.nci);
530 break;
531 default:
532 TELEPHONY_LOGE("invalid ratType");
533 break;
534 }
535 }
536 return 0;
537 }
538
NetworkCurrentCellUpdated_1_2(const RilRadioResponseInfo & responseInfo,const CellListCurrentInfo_1_2 & cellListCurrentInfo)539 int32_t RilCallbackTest::NetworkCurrentCellUpdated_1_2(
540 const RilRadioResponseInfo &responseInfo, const CellListCurrentInfo_1_2 &cellListCurrentInfo)
541 {
542 TELEPHONY_LOGI("itemNum:%{public}d", cellListCurrentInfo.itemNum);
543 for (auto info : cellListCurrentInfo.cellCurrentInfo) {
544 TELEPHONY_LOGI("ratType:%{public}d, mcc:%{public}d, mnc:%{public}d", info.ratType, info.mcc, info.mnc);
545 switch (static_cast<RatType>(info.ratType)) {
546 case RatType::NETWORK_TYPE_LTE:
547 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.lte.cellId);
548 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
549 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
550 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
551 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
552 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rssi);
553 break;
554 case RatType::NETWORK_TYPE_GSM:
555 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
556 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
557 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
558 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
559 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
560 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
561 break;
562 case RatType::NETWORK_TYPE_WCDMA:
563 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
564 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
565 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
566 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
567 break;
568 case RatType::NETWORK_TYPE_NR:
569 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
570 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
571 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
572 break;
573 default:
574 TELEPHONY_LOGE("invalid ratType");
575 break;
576 }
577 }
578 return 0;
579 }
580
ResidentNetworkUpdated(const RilRadioResponseInfo & responseInfo,const std::string & plmn)581 int32_t RilCallbackTest::ResidentNetworkUpdated(const RilRadioResponseInfo &responseInfo, const std::string &plmn)
582 {
583 TELEPHONY_LOGI("RilCallbackTest::ResidentNetworkUpdated plmn:%{public}s", plmn.c_str());
584 return 0;
585 }
586
GetSignalStrengthResponse(const RilRadioResponseInfo & responseInfo,const Rssi & rssi)587 int32_t RilCallbackTest::GetSignalStrengthResponse(const RilRadioResponseInfo &responseInfo, const Rssi &rssi)
588 {
589 TELEPHONY_LOGI(
590 "RilCallbackTest::GetSignalStrengthResponse rxlev:%{public}d rsrp:%{public}d", rssi.lte.rxlev, rssi.lte.rsrp);
591 hdiId_ = HdiId::HREQ_NETWORK_GET_SIGNAL_STRENGTH;
592 resultInfo_ = responseInfo;
593 NotifyAll();
594 return 0;
595 }
596
GetCsRegStatusResponse(const RilRadioResponseInfo & responseInfo,const CsRegStatusInfo & csRegStatusInfo)597 int32_t RilCallbackTest::GetCsRegStatusResponse(
598 const RilRadioResponseInfo &responseInfo, const CsRegStatusInfo &csRegStatusInfo)
599 {
600 TELEPHONY_LOGI("RilCallbackTest::GetCsRegStatusResponse notifyType:%{public}d, regStatus:%{public}d, "
601 "lacCode:%{public}d, cellId:%{public}d, radioTechnology:%{public}d",
602 csRegStatusInfo.notifyType, csRegStatusInfo.regStatus, csRegStatusInfo.lacCode, csRegStatusInfo.cellId,
603 csRegStatusInfo.radioTechnology);
604 hdiId_ = HdiId::HREQ_NETWORK_GET_CS_REG_STATUS;
605 resultInfo_ = responseInfo;
606 NotifyAll();
607 return 0;
608 }
609
GetPsRegStatusResponse(const RilRadioResponseInfo & responseInfo,const PsRegStatusInfo & psRegStatusInfo)610 int32_t RilCallbackTest::GetPsRegStatusResponse(
611 const RilRadioResponseInfo &responseInfo, const PsRegStatusInfo &psRegStatusInfo)
612 {
613 TELEPHONY_LOGI(
614 "RilCallbackTest::GetPsRegStatusResponse notifyType:%{public}d, regStatus:%{public}d, lacCode:%{public}d, "
615 "cellId:%{public}d, tech:%{public}d, nrRestricted:%{public}d, nrAvailable:%{public}d, enDcAvailable:%{public}d",
616 psRegStatusInfo.notifyType, psRegStatusInfo.regStatus, psRegStatusInfo.lacCode, psRegStatusInfo.cellId,
617 psRegStatusInfo.radioTechnology, psRegStatusInfo.isDcNrRestricted, psRegStatusInfo.isNrAvailable,
618 psRegStatusInfo.isEnDcAvailable);
619 hdiId_ = HdiId::HREQ_NETWORK_GET_PS_REG_STATUS;
620 resultInfo_ = responseInfo;
621 NotifyAll();
622 return 0;
623 }
624
GetOperatorInfoResponse(const RilRadioResponseInfo & responseInfo,const OperatorInfo & operatorInfo)625 int32_t RilCallbackTest::GetOperatorInfoResponse(
626 const RilRadioResponseInfo &responseInfo, const OperatorInfo &operatorInfo)
627 {
628 TELEPHONY_LOGI(
629 "RilCallbackTest::GetOperatorInfoResponse longName:%{public}s, shortName:%{public}s, numeric:%{public}s",
630 operatorInfo.longName.c_str(), operatorInfo.shortName.c_str(), operatorInfo.numeric.c_str());
631 hdiId_ = HdiId::HREQ_NETWORK_GET_OPERATOR_INFO;
632 resultInfo_ = responseInfo;
633 NotifyAll();
634 return 0;
635 }
636
GetNetworkSearchInformationResponse(const RilRadioResponseInfo & responseInfo,const AvailableNetworkList & availableNetworkList)637 int32_t RilCallbackTest::GetNetworkSearchInformationResponse(
638 const RilRadioResponseInfo &responseInfo, const AvailableNetworkList &availableNetworkList)
639 {
640 TELEPHONY_LOGI(
641 "RilCallbackTest::GetNetworkSearchInformationResponse itemNum:%{public}d", availableNetworkList.itemNum);
642 for (auto availableInfo : availableNetworkList.availableNetworkInfo) {
643 TELEPHONY_LOGI("status:%{public}d", availableInfo.status);
644 TELEPHONY_LOGI("numeric:%{public}s", availableInfo.numeric.c_str());
645 TELEPHONY_LOGI("shortName:%{public}s", availableInfo.shortName.c_str());
646 TELEPHONY_LOGI("longName:%{public}s", availableInfo.longName.c_str());
647 TELEPHONY_LOGI("rat:%{public}d", availableInfo.rat);
648 }
649 hdiId_ = HdiId::HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION;
650 resultInfo_ = responseInfo;
651 NotifyAll();
652 return 0;
653 }
654
GetNetworkSelectionModeResponse(const RilRadioResponseInfo & responseInfo,const SetNetworkModeInfo & setNetworkModeInfo)655 int32_t RilCallbackTest::GetNetworkSelectionModeResponse(
656 const RilRadioResponseInfo &responseInfo, const SetNetworkModeInfo &setNetworkModeInfo)
657 {
658 TELEPHONY_LOGI(
659 "RilCallbackTest::GetNetworkSelectionModeResponse selectMode:%{public}d", setNetworkModeInfo.selectMode);
660 hdiId_ = HdiId::HREQ_NETWORK_GET_NETWORK_SELECTION_MODE;
661 resultInfo_ = responseInfo;
662 NotifyAll();
663 return 0;
664 }
665
SetNetworkSelectionModeResponse(const RilRadioResponseInfo & responseInfo)666 int32_t RilCallbackTest::SetNetworkSelectionModeResponse(const RilRadioResponseInfo &responseInfo)
667 {
668 TELEPHONY_LOGI("RilCallbackTest::SetNetworkSelectionModeResponse error:%{public}d", responseInfo.error);
669 hdiId_ = HdiId::HREQ_NETWORK_SET_NETWORK_SELECTION_MODE;
670 resultInfo_ = responseInfo;
671 NotifyAll();
672 return 0;
673 }
674
GetNeighboringCellInfoListResponse(const RilRadioResponseInfo & responseInfo,const CellListNearbyInfo & cellInfoList)675 int32_t RilCallbackTest::GetNeighboringCellInfoListResponse(
676 const RilRadioResponseInfo &responseInfo, const CellListNearbyInfo &cellInfoList)
677 {
678 TELEPHONY_LOGI("RilCallbackTest::GetNeighboringCellInfoListResponse itemNum:%{public}d", cellInfoList.itemNum);
679 for (auto info : cellInfoList.cellNearbyInfo) {
680 TELEPHONY_LOGI("RilCallbackTest::GetNeighboringCellInfoListResponse ratType:%{public}d", info.ratType);
681 switch (static_cast<RatType>(info.ratType)) {
682 case RatType::NETWORK_TYPE_LTE:
683 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
684 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
685 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
686 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
687 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rxlev);
688 break;
689 case RatType::NETWORK_TYPE_GSM:
690 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
691 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
692 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
693 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
694 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
695 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
696 break;
697 case RatType::NETWORK_TYPE_WCDMA:
698 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
699 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
700 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
701 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
702 break;
703 case RatType::NETWORK_TYPE_NR:
704 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
705 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
706 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
707 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.nr.nci);
708 break;
709 default:
710 TELEPHONY_LOGE("invalid ratType");
711 break;
712 }
713 }
714 hdiId_ = HdiId::HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST;
715 resultInfo_ = responseInfo;
716 NotifyAll();
717 return 0;
718 }
719
GetNeighboringCellInfoListResponse_1_2(const RilRadioResponseInfo & responseInfo,const CellListNearbyInfo_1_2 & cellInfoList)720 int32_t RilCallbackTest::GetNeighboringCellInfoListResponse_1_2(
721 const RilRadioResponseInfo &responseInfo, const CellListNearbyInfo_1_2 &cellInfoList)
722 {
723 TELEPHONY_LOGI("itemNum:%{public}d", cellInfoList.itemNum);
724 for (auto info : cellInfoList.cellNearbyInfo) {
725 TELEPHONY_LOGI("ratType:%{public}d", info.ratType);
726 switch (static_cast<RatType>(info.ratType)) {
727 case RatType::NETWORK_TYPE_LTE:
728 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
729 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
730 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
731 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
732 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rxlev);
733 break;
734 case RatType::NETWORK_TYPE_GSM:
735 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
736 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
737 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
738 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
739 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
740 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
741 break;
742 case RatType::NETWORK_TYPE_WCDMA:
743 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
744 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
745 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
746 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
747 break;
748 case RatType::NETWORK_TYPE_NR:
749 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
750 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
751 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
752 break;
753 default:
754 TELEPHONY_LOGE("invalid ratType");
755 break;
756 }
757 }
758 hdiId_ = HdiId::HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST;
759 resultInfo_ = responseInfo;
760 NotifyAll();
761 return 0;
762 }
763
GetCurrentCellInfoResponse(const RilRadioResponseInfo & responseInfo,const CellListCurrentInfo & cellInfoList)764 int32_t RilCallbackTest::GetCurrentCellInfoResponse(
765 const RilRadioResponseInfo &responseInfo, const CellListCurrentInfo &cellInfoList)
766 {
767 TELEPHONY_LOGI("RilCallbackTest::GetCurrentCellInfoResponse itemNum:%{public}d", cellInfoList.itemNum);
768 for (auto info : cellInfoList.cellCurrentInfo) {
769 TELEPHONY_LOGI("RilCallbackTest::GetCurrentCellInfoResponse ratType:%{public}d, mcc:%{public}d, mnc:%{public}d",
770 info.ratType, info.mcc, info.mnc);
771 switch (static_cast<RatType>(info.ratType)) {
772 case RatType::NETWORK_TYPE_LTE:
773 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.lte.cellId);
774 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
775 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
776 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
777 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
778 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rssi);
779 break;
780 case RatType::NETWORK_TYPE_GSM:
781 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
782 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
783 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
784 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
785 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
786 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
787 break;
788 case RatType::NETWORK_TYPE_WCDMA:
789 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
790 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
791 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
792 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
793 break;
794 case RatType::NETWORK_TYPE_NR:
795 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
796 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
797 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
798 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.nr.nci);
799 break;
800 default:
801 TELEPHONY_LOGE("invalid ratType");
802 break;
803 }
804 }
805 hdiId_ = HdiId::HREQ_NETWORK_GET_CURRENT_CELL_INFO;
806 resultInfo_ = responseInfo;
807 NotifyAll();
808 return 0;
809 }
810
GetCurrentCellInfoResponse_1_1(const RilRadioResponseInfo & responseInfo,const CellListCurrentInfo_1_1 & cellListCurrentInfo)811 int32_t RilCallbackTest::GetCurrentCellInfoResponse_1_1(
812 const RilRadioResponseInfo &responseInfo, const CellListCurrentInfo_1_1 &cellListCurrentInfo)
813 {
814 TELEPHONY_LOGI("itemNum:%{public}d", cellListCurrentInfo.itemNum);
815 for (auto info : cellListCurrentInfo.cellCurrentInfo) {
816 TELEPHONY_LOGI("ratType:%{public}d, mcc:%{public}d, mnc:%{public}d", info.ratType, info.mcc, info.mnc);
817 switch (static_cast<RatType>(info.ratType)) {
818 case RatType::NETWORK_TYPE_LTE:
819 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.lte.cellId);
820 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
821 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
822 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
823 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
824 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rssi);
825 break;
826 case RatType::NETWORK_TYPE_GSM:
827 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
828 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
829 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
830 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
831 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
832 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
833 break;
834 case RatType::NETWORK_TYPE_WCDMA:
835 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
836 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
837 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
838 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
839 break;
840 case RatType::NETWORK_TYPE_NR:
841 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
842 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
843 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
844 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.nr.nci);
845 break;
846 default:
847 TELEPHONY_LOGE("invalid ratType");
848 break;
849 }
850 }
851 hdiId_ = HdiId::HREQ_NETWORK_GET_CURRENT_CELL_INFO;
852 resultInfo_ = responseInfo;
853 NotifyAll();
854 return 0;
855 }
856
GetCurrentCellInfoResponse_1_2(const RilRadioResponseInfo & responseInfo,const CellListCurrentInfo_1_2 & cellListCurrentInfo)857 int32_t RilCallbackTest::GetCurrentCellInfoResponse_1_2(
858 const RilRadioResponseInfo &responseInfo, const CellListCurrentInfo_1_2 &cellListCurrentInfo)
859 {
860 TELEPHONY_LOGI("itemNum:%{public}d", cellListCurrentInfo.itemNum);
861 for (auto info : cellListCurrentInfo.cellCurrentInfo) {
862 TELEPHONY_LOGI("ratType:%{public}d, mcc:%{public}d, mnc:%{public}d", info.ratType, info.mcc, info.mnc);
863 switch (static_cast<RatType>(info.ratType)) {
864 case RatType::NETWORK_TYPE_LTE:
865 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.lte.cellId);
866 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.lte.arfcn);
867 TELEPHONY_LOGI("pci:%{public}d", info.serviceCells.lte.pci);
868 TELEPHONY_LOGI("rsrp:%{public}d", info.serviceCells.lte.rsrp);
869 TELEPHONY_LOGI("rsrq:%{public}d", info.serviceCells.lte.rsrq);
870 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.lte.rssi);
871 break;
872 case RatType::NETWORK_TYPE_GSM:
873 TELEPHONY_LOGI("band:%{public}d", info.serviceCells.gsm.band);
874 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.gsm.arfcn);
875 TELEPHONY_LOGI("bsic:%{public}d", info.serviceCells.gsm.bsic);
876 TELEPHONY_LOGI("cellId:%{public}d", info.serviceCells.gsm.cellId);
877 TELEPHONY_LOGI("rxlev:%{public}d", info.serviceCells.gsm.rxlev);
878 TELEPHONY_LOGI("lac:%{public}d", info.serviceCells.gsm.lac);
879 break;
880 case RatType::NETWORK_TYPE_WCDMA:
881 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.wcdma.arfcn);
882 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.wcdma.psc);
883 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.wcdma.rscp);
884 TELEPHONY_LOGI("ecno:%{public}d", info.serviceCells.wcdma.ecno);
885 break;
886 case RatType::NETWORK_TYPE_NR:
887 TELEPHONY_LOGI("arfcn:%{public}d", info.serviceCells.nr.nrArfcn);
888 TELEPHONY_LOGI("psc:%{public}d", info.serviceCells.nr.pci);
889 TELEPHONY_LOGI("rscp:%{public}d", info.serviceCells.nr.tac);
890 break;
891 default:
892 TELEPHONY_LOGE("invalid ratType");
893 break;
894 }
895 }
896 hdiId_ = HdiId::HREQ_NETWORK_GET_CURRENT_CELL_INFO;
897 resultInfo_ = responseInfo;
898 NotifyAll();
899 return 0;
900 }
901
SetPreferredNetworkResponse(const RilRadioResponseInfo & responseInfo)902 int32_t RilCallbackTest::SetPreferredNetworkResponse(const RilRadioResponseInfo &responseInfo)
903 {
904 TELEPHONY_LOGI("RilCallbackTest::SetPreferredNetworkResponse error:%{public}d", responseInfo.error);
905 hdiId_ = HdiId::HREQ_NETWORK_SET_PREFERRED_NETWORK;
906 resultInfo_ = responseInfo;
907 NotifyAll();
908 return 0;
909 }
910
GetPreferredNetworkResponse(const RilRadioResponseInfo & responseInfo,const PreferredNetworkTypeInfo & preferredNetworkTypeInfo)911 int32_t RilCallbackTest::GetPreferredNetworkResponse(
912 const RilRadioResponseInfo &responseInfo, const PreferredNetworkTypeInfo &preferredNetworkTypeInfo)
913 {
914 TELEPHONY_LOGI(
915 "RilCallbackTest::GetPreferredNetworkResponse type:%{public}d", preferredNetworkTypeInfo.preferredNetworkType);
916 hdiId_ = HdiId::HREQ_NETWORK_GET_PREFERRED_NETWORK;
917 resultInfo_ = responseInfo;
918 NotifyAll();
919 return 0;
920 }
921
GetPhysicalChannelConfigResponse(const RilRadioResponseInfo & responseInfo,const ChannelConfigInfoList & channelConfigInfoList)922 int32_t RilCallbackTest::GetPhysicalChannelConfigResponse(
923 const RilRadioResponseInfo &responseInfo, const ChannelConfigInfoList &channelConfigInfoList)
924 {
925 TELEPHONY_LOGI(
926 "RilCallbackTest::GetPhysicalChannelConfigResponse itemNum:%{public}d", channelConfigInfoList.itemNum);
927 for (PhysicalChannelConfig phyChnlCfg : channelConfigInfoList.channelConfigInfos) {
928 TELEPHONY_LOGI(
929 "RilCallbackTest::GetPhysicalChannelConfigResponse cellConnStatus:%{public}d, "
930 "cellBandwidthDownlinkKhz:%{public}d, cellBandwidthUplinkKhz:%{public}d, physicalCellId:%{public}d, "
931 "ratType:%{public}d, freqRange:%{public}d, downlinkChannelNum:%{public}d, "
932 "uplinkChannelNum:%{public}d, contextIdNum:%{public}d",
933 phyChnlCfg.cellConnStatus, phyChnlCfg.cellBandwidthDownlinkKhz, phyChnlCfg.cellBandwidthUplinkKhz,
934 phyChnlCfg.ratType, phyChnlCfg.freqRange, phyChnlCfg.downlinkChannelNum, phyChnlCfg.uplinkChannelNum,
935 phyChnlCfg.physicalCellId, phyChnlCfg.contextIdNum);
936 for (int32_t j = 0; j < phyChnlCfg.contextIdNum; j++) {
937 TELEPHONY_LOGI("contextIds[%{public}d]:%{public}d", j, phyChnlCfg.contextIds[j]);
938 }
939 }
940 hdiId_ = HdiId::HREQ_NETWORK_GET_PHYSICAL_CHANNEL_CONFIG;
941 resultInfo_ = responseInfo;
942 NotifyAll();
943 return 0;
944 }
945
SetLocateUpdatesResponse(const RilRadioResponseInfo & responseInfo)946 int32_t RilCallbackTest::SetLocateUpdatesResponse(const RilRadioResponseInfo &responseInfo)
947 {
948 TELEPHONY_LOGI("RilCallbackTest::SetLocateUpdatesResponse error:%{public}d", responseInfo.error);
949 hdiId_ = HdiId::HREQ_NETWORK_SET_LOCATE_UPDATES;
950 resultInfo_ = responseInfo;
951 NotifyAll();
952 return 0;
953 }
954
SetNotificationFilterResponse(const RilRadioResponseInfo & responseInfo)955 int32_t RilCallbackTest::SetNotificationFilterResponse(const RilRadioResponseInfo &responseInfo)
956 {
957 TELEPHONY_LOGI("RilCallbackTest::SetNotificationFilterResponse error:%{public}d", responseInfo.error);
958 hdiId_ = HdiId::HREQ_NETWORK_SET_NOTIFICATION_FILTER;
959 resultInfo_ = responseInfo;
960 NotifyAll();
961 return 0;
962 }
963
SetDeviceStateResponse(const RilRadioResponseInfo & responseInfo)964 int32_t RilCallbackTest::SetDeviceStateResponse(const RilRadioResponseInfo &responseInfo)
965 {
966 TELEPHONY_LOGI("RilCallbackTest::SetDeviceStateResponse error:%{public}d", responseInfo.error);
967 hdiId_ = HdiId::HREQ_NETWORK_SET_DEVICE_STATE;
968 resultInfo_ = responseInfo;
969 NotifyAll();
970 return 0;
971 }
972
SetNrOptionModeResponse(const RilRadioResponseInfo & responseInfo)973 int32_t RilCallbackTest::SetNrOptionModeResponse(const RilRadioResponseInfo &responseInfo)
974 {
975 TELEPHONY_LOGI("RilCallbackTest::SetNrOptionModeResponse error:%{public}d", responseInfo.error);
976 hdiId_ = HdiId::HREQ_NETWORK_SET_NR_OPTION_MODE;
977 resultInfo_ = responseInfo;
978 NotifyAll();
979 return 0;
980 }
981
GetNrOptionModeResponse(const RilRadioResponseInfo & responseInfo,const int32_t mode)982 int32_t RilCallbackTest::GetNrOptionModeResponse(const RilRadioResponseInfo &responseInfo, const int32_t mode)
983 {
984 TELEPHONY_LOGI("RilCallbackTest::GetNrOptionModeResponse mode:%{public}d", mode);
985 hdiId_ = HdiId::HREQ_NETWORK_GET_NR_OPTION_MODE;
986 resultInfo_ = responseInfo;
987 NotifyAll();
988 return 0;
989 }
990
GetRrcConnectionStateResponse(const RilRadioResponseInfo & responseInfo,int32_t rrcConnectionState)991 int32_t RilCallbackTest::GetRrcConnectionStateResponse(
992 const RilRadioResponseInfo &responseInfo, int32_t rrcConnectionState)
993 {
994 TELEPHONY_LOGI("RilCallbackTest::GetRrcConnectionStateResponse rrcConnectionState:%{public}d", rrcConnectionState);
995 hdiId_ = HdiId::HREQ_NETWORK_GET_RRC_CONNECTION_STATE;
996 resultInfo_ = responseInfo;
997 NotifyAll();
998 return 0;
999 }
1000
GetNrSsbIdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_2::NrCellSsbIds & nrCellSsbIds)1001 int32_t RilCallbackTest::GetNrSsbIdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
1002 const HDI::Ril::V1_2::NrCellSsbIds &nrCellSsbIds)
1003 {
1004 TELEPHONY_LOGI("GetNrSsbIdResponse rsrp:%{public}d", nrCellSsbIds.rsrp);
1005 TELEPHONY_LOGI("GetNrSsbIdResponse sinr:%{public}d", nrCellSsbIds.sinr);
1006 TELEPHONY_LOGI("GetNrSsbIdResponse nbCellCount:%{public}d", nrCellSsbIds.nbCellCount);
1007 hdiId_ = HdiId::HREQ_NETWORK_GET_NR_SSBID_INFO;
1008 resultInfo_ = responseInfo;
1009 NotifyAll();
1010 return 0;
1011 }
1012
1013 // Call
CallEmergencyNotice(const RilRadioResponseInfo & responseInfo,const EmergencyInfoList & emergencyInfoList)1014 int32_t RilCallbackTest::CallEmergencyNotice(
1015 const RilRadioResponseInfo &responseInfo, const EmergencyInfoList &emergencyInfoList)
1016 {
1017 TELEPHONY_LOGI("GetBoolResult CallEmergencyNotice callSize : %{public}d", emergencyInfoList.callSize);
1018 return 0;
1019 }
1020
CallStateUpdated(const RilRadioResponseInfo & responseInfo)1021 int32_t RilCallbackTest::CallStateUpdated(const RilRadioResponseInfo &responseInfo)
1022 {
1023 TELEPHONY_LOGI(
1024 "GetBoolResult CallStateUpdated slotId : %{public}d, type: %{public}d", responseInfo.slotId, responseInfo.type);
1025 return 0;
1026 }
1027
CallRingbackVoiceNotice(const RilRadioResponseInfo & responseInfo,const RingbackVoice & ringbackVoice)1028 int32_t RilCallbackTest::CallRingbackVoiceNotice(
1029 const RilRadioResponseInfo &responseInfo, const RingbackVoice &ringbackVoice)
1030 {
1031 TELEPHONY_LOGI("GetBoolResult CallRingbackVoiceNotice slotId : %{public}d, ringbackVoice: %{public}d",
1032 responseInfo.slotId, ringbackVoice.status);
1033 return 0;
1034 }
1035
CallSrvccStatusNotice(const RilRadioResponseInfo & responseInfo,const SrvccStatus & srvccStatus)1036 int32_t RilCallbackTest::CallSrvccStatusNotice(const RilRadioResponseInfo &responseInfo, const SrvccStatus &srvccStatus)
1037 {
1038 TELEPHONY_LOGI("GetBoolResult CallSrvccStatusNotice slotId : %{public}d, srvccStatus: %{public}d",
1039 responseInfo.slotId, srvccStatus.status);
1040 return 0;
1041 }
1042
CallUssdNotice(const RilRadioResponseInfo & responseInfo,const UssdNoticeInfo & ussdNoticeInfo)1043 int32_t RilCallbackTest::CallUssdNotice(const RilRadioResponseInfo &responseInfo, const UssdNoticeInfo &ussdNoticeInfo)
1044 {
1045 TELEPHONY_LOGI("GetBoolResult CallUssdNotice slotId : %{public}d, ussdNoticeInfo m: %{public}d, str: %{public}s",
1046 responseInfo.slotId, ussdNoticeInfo.type, ussdNoticeInfo.message.c_str());
1047 return 0;
1048 }
1049
CallSsNotice(const RilRadioResponseInfo & responseInfo,const SsNoticeInfo & ssNoticeInfo)1050 int32_t RilCallbackTest::CallSsNotice(const RilRadioResponseInfo &responseInfo, const SsNoticeInfo &ssNoticeInfo)
1051 {
1052 TELEPHONY_LOGI("GetBoolResult CallSsNotice slotId : %{public}d, result: %{public}d, serviceType: %{public}d,"
1053 "requestType: %{public}d, serviceClass: %{public}d",
1054 responseInfo.slotId, ssNoticeInfo.result, ssNoticeInfo.serviceType, ssNoticeInfo.requestType,
1055 ssNoticeInfo.serviceClass);
1056 return 0;
1057 }
1058
CallRsrvccStatusNotify(const RilRadioResponseInfo & responseInfo)1059 int32_t RilCallbackTest::CallRsrvccStatusNotify(const RilRadioResponseInfo &responseInfo)
1060 {
1061 TELEPHONY_LOGI(
1062 "CallRsrvccStatusNotify slotId : %{public}d, type: %{public}d", responseInfo.slotId, responseInfo.type);
1063 return 0;
1064 }
1065
GetEmergencyCallListResponse(const RilRadioResponseInfo & responseInfo,const EmergencyInfoList & emergencyInfoList)1066 int32_t RilCallbackTest::GetEmergencyCallListResponse(
1067 const RilRadioResponseInfo &responseInfo, const EmergencyInfoList &emergencyInfoList)
1068 {
1069 TELEPHONY_LOGI("GetBoolResult emergencyInfoList callSize : %{public}d", emergencyInfoList.callSize);
1070 hdiId_ = HdiId::HREQ_CALL_GET_EMERGENCY_LIST;
1071 resultInfo_ = responseInfo;
1072 NotifyAll();
1073 return 0;
1074 }
1075
SetEmergencyCallListResponse(const RilRadioResponseInfo & responseInfo)1076 int32_t RilCallbackTest::SetEmergencyCallListResponse(const RilRadioResponseInfo &responseInfo)
1077 {
1078 TELEPHONY_LOGI("GetBoolResult SetEmergencyCallListResponse");
1079 hdiId_ = HdiId::HREQ_CALL_SET_EMERGENCY_LIST;
1080 resultInfo_ = responseInfo;
1081 NotifyAll();
1082 return 0;
1083 }
1084
GetCallListResponse(const RilRadioResponseInfo & responseInfo,const CallInfoList & callList)1085 int32_t RilCallbackTest::GetCallListResponse(const RilRadioResponseInfo &responseInfo, const CallInfoList &callList)
1086 {
1087 TELEPHONY_LOGI("GetBoolResult CallInfoList callSize : %{public}d", callList.callSize);
1088 hdiId_ = HdiId::HREQ_CALL_GET_CALL_LIST;
1089 resultInfo_ = responseInfo;
1090 NotifyAll();
1091 return 0;
1092 }
1093
GetCallListResponseExt(const RilRadioResponseInfo & responseInfo,const CallInfoExtList & callList)1094 int32_t RilCallbackTest::GetCallListResponseExt(
1095 const RilRadioResponseInfo &responseInfo, const CallInfoExtList &callList)
1096 {
1097 TELEPHONY_LOGI("GetBoolResult CallInfoList callSize : %{public}d", callList.callSize);
1098 hdiId_ = HdiId::HREQ_CALL_GET_CALL_LIST;
1099 resultInfo_ = responseInfo;
1100 NotifyAll();
1101 return 0;
1102 }
1103
DialResponse(const RilRadioResponseInfo & responseInfo)1104 int32_t RilCallbackTest::DialResponse(const RilRadioResponseInfo &responseInfo)
1105 {
1106 TELEPHONY_LOGI("GetBoolResult DialResponse");
1107 hdiId_ = HdiId::HREQ_CALL_DIAL;
1108 resultInfo_ = responseInfo;
1109 NotifyAll();
1110 return 0;
1111 }
1112
HangupResponse(const RilRadioResponseInfo & responseInfo)1113 int32_t RilCallbackTest::HangupResponse(const RilRadioResponseInfo &responseInfo)
1114 {
1115 TELEPHONY_LOGI("GetBoolResult HangupResponse");
1116 hdiId_ = HdiId::HREQ_CALL_HANGUP;
1117 resultInfo_ = responseInfo;
1118 NotifyAll();
1119 return 0;
1120 }
1121
RejectResponse(const RilRadioResponseInfo & responseInfo)1122 int32_t RilCallbackTest::RejectResponse(const RilRadioResponseInfo &responseInfo)
1123 {
1124 TELEPHONY_LOGI("GetBoolResult RejectResponse");
1125 hdiId_ = HdiId::HREQ_CALL_REJECT;
1126 resultInfo_ = responseInfo;
1127 NotifyAll();
1128 return 0;
1129 }
1130
AnswerResponse(const RilRadioResponseInfo & responseInfo)1131 int32_t RilCallbackTest::AnswerResponse(const RilRadioResponseInfo &responseInfo)
1132 {
1133 TELEPHONY_LOGI("GetBoolResult AnswerResponse");
1134 hdiId_ = HdiId::HREQ_CALL_ANSWER;
1135 resultInfo_ = responseInfo;
1136 NotifyAll();
1137 return 0;
1138 }
1139
HoldCallResponse(const RilRadioResponseInfo & responseInfo)1140 int32_t RilCallbackTest::HoldCallResponse(const RilRadioResponseInfo &responseInfo)
1141 {
1142 TELEPHONY_LOGI("GetBoolResult HoldCallResponse");
1143 hdiId_ = HdiId::HREQ_CALL_HOLD_CALL;
1144 resultInfo_ = responseInfo;
1145 NotifyAll();
1146 return 0;
1147 }
1148
UnHoldCallResponse(const RilRadioResponseInfo & responseInfo)1149 int32_t RilCallbackTest::UnHoldCallResponse(const RilRadioResponseInfo &responseInfo)
1150 {
1151 TELEPHONY_LOGI("GetBoolResult UnHoldCallResponse");
1152 hdiId_ = HdiId::HREQ_CALL_UNHOLD_CALL;
1153 resultInfo_ = responseInfo;
1154 NotifyAll();
1155 return 0;
1156 }
1157
SwitchCallResponse(const RilRadioResponseInfo & responseInfo)1158 int32_t RilCallbackTest::SwitchCallResponse(const RilRadioResponseInfo &responseInfo)
1159 {
1160 TELEPHONY_LOGI("GetBoolResult SwitchCallResponse");
1161 hdiId_ = HdiId::HREQ_CALL_SWITCH_CALL;
1162 resultInfo_ = responseInfo;
1163 NotifyAll();
1164 return 0;
1165 }
1166
GetClipResponse(const RilRadioResponseInfo & responseInfo,const GetClipResult & getClipResult)1167 int32_t RilCallbackTest::GetClipResponse(const RilRadioResponseInfo &responseInfo, const GetClipResult &getClipResult)
1168 {
1169 TELEPHONY_LOGI("GetBoolResult result: %{public}d, action: %{public}d, clipStat: %{public}d", getClipResult.result,
1170 getClipResult.action, getClipResult.clipStat);
1171 hdiId_ = HdiId::HREQ_CALL_GET_CLIP;
1172 resultInfo_ = responseInfo;
1173 NotifyAll();
1174 return 0;
1175 }
1176
SetClipResponse(const RilRadioResponseInfo & responseInfo)1177 int32_t RilCallbackTest::SetClipResponse(const RilRadioResponseInfo &responseInfo)
1178 {
1179 TELEPHONY_LOGI("GetBoolResult SetClipResponse");
1180 hdiId_ = HdiId::HREQ_CALL_SET_CLIP;
1181 resultInfo_ = responseInfo;
1182 NotifyAll();
1183 return 0;
1184 }
1185
CombineConferenceResponse(const RilRadioResponseInfo & responseInfo)1186 int32_t RilCallbackTest::CombineConferenceResponse(const RilRadioResponseInfo &responseInfo)
1187 {
1188 TELEPHONY_LOGI("GetBoolResult CombineConferenceResponse");
1189 hdiId_ = HdiId::HREQ_CALL_COMBINE_CONFERENCE;
1190 resultInfo_ = responseInfo;
1191 NotifyAll();
1192 return 0;
1193 }
1194
SeparateConferenceResponse(const RilRadioResponseInfo & responseInfo)1195 int32_t RilCallbackTest::SeparateConferenceResponse(const RilRadioResponseInfo &responseInfo)
1196 {
1197 TELEPHONY_LOGI("GetBoolResult SeparateConferenceResponse");
1198 hdiId_ = HdiId::HREQ_CALL_SEPARATE_CONFERENCE;
1199 resultInfo_ = responseInfo;
1200 NotifyAll();
1201 return 0;
1202 }
1203
CallSupplementResponse(const RilRadioResponseInfo & responseInfo)1204 int32_t RilCallbackTest::CallSupplementResponse(const RilRadioResponseInfo &responseInfo)
1205 {
1206 TELEPHONY_LOGI("GetBoolResult CallSupplementResponse");
1207 hdiId_ = HdiId::HREQ_CALL_CALL_SUPPLEMENT;
1208 resultInfo_ = responseInfo;
1209 NotifyAll();
1210 return 0;
1211 }
1212
GetCallWaitingResponse(const RilRadioResponseInfo & responseInfo,const CallWaitResult & callWaitResult)1213 int32_t RilCallbackTest::GetCallWaitingResponse(
1214 const RilRadioResponseInfo &responseInfo, const CallWaitResult &callWaitResult)
1215 {
1216 TELEPHONY_LOGI("GetBoolResult GetCallWaitingResponse result: %{public}d, status: %{public}d, classCw: %{public}d",
1217 callWaitResult.result, callWaitResult.status, callWaitResult.classCw);
1218 hdiId_ = HdiId::HREQ_CALL_GET_CALL_WAITING;
1219 resultInfo_ = responseInfo;
1220 NotifyAll();
1221 return 0;
1222 }
1223
SetCallWaitingResponse(const RilRadioResponseInfo & responseInfo)1224 int32_t RilCallbackTest::SetCallWaitingResponse(const RilRadioResponseInfo &responseInfo)
1225 {
1226 TELEPHONY_LOGI("GetBoolResult SetCallWaitingResponse");
1227 hdiId_ = HdiId::HREQ_CALL_SET_CALL_WAITING;
1228 resultInfo_ = responseInfo;
1229 NotifyAll();
1230 return 0;
1231 }
1232
GetCallTransferInfoResponse(const RilRadioResponseInfo & responseInfo,const CallForwardQueryInfoList & cFQueryList)1233 int32_t RilCallbackTest::GetCallTransferInfoResponse(
1234 const RilRadioResponseInfo &responseInfo, const CallForwardQueryInfoList &cFQueryList)
1235 {
1236 TELEPHONY_LOGI("GetBoolResult GetCallTransferInfoResponse cFQueryList: %{public}d", cFQueryList.callSize);
1237 hdiId_ = HdiId::HREQ_CALL_GET_CALL_TRANSFER_INFO;
1238 resultInfo_ = responseInfo;
1239 NotifyAll();
1240 return 0;
1241 }
1242
SetCallTransferInfoResponse(const RilRadioResponseInfo & responseInfo)1243 int32_t RilCallbackTest::SetCallTransferInfoResponse(const RilRadioResponseInfo &responseInfo)
1244 {
1245 TELEPHONY_LOGI("GetBoolResult SetCallTransferInfoResponse");
1246 hdiId_ = HdiId::HREQ_CALL_SET_CALL_TRANSFER_INFO;
1247 resultInfo_ = responseInfo;
1248 NotifyAll();
1249 return 0;
1250 }
1251
GetCallRestrictionResponse(const RilRadioResponseInfo & responseInfo,const CallRestrictionResult & result)1252 int32_t RilCallbackTest::GetCallRestrictionResponse(
1253 const RilRadioResponseInfo &responseInfo, const CallRestrictionResult &result)
1254 {
1255 TELEPHONY_LOGI("GetBoolResult result: %{public}d, status: %{public}d, classCw: %{public}d", result.result,
1256 result.status, result.classCw);
1257 hdiId_ = HdiId::HREQ_CALL_GET_CALL_RESTRICTION;
1258 resultInfo_ = responseInfo;
1259 NotifyAll();
1260 return 0;
1261 }
1262
SetCallRestrictionResponse(const RilRadioResponseInfo & responseInfo)1263 int32_t RilCallbackTest::SetCallRestrictionResponse(const RilRadioResponseInfo &responseInfo)
1264 {
1265 TELEPHONY_LOGI("GetBoolResult SetCallRestrictionResponse");
1266 hdiId_ = HdiId::HREQ_CALL_SET_CALL_RESTRICTION;
1267 resultInfo_ = responseInfo;
1268 NotifyAll();
1269 return 0;
1270 }
1271
GetClirResponse(const RilRadioResponseInfo & responseInfo,const GetClirResult & getClirResult)1272 int32_t RilCallbackTest::GetClirResponse(const RilRadioResponseInfo &responseInfo, const GetClirResult &getClirResult)
1273 {
1274 TELEPHONY_LOGI("GetBoolResult result: %{public}d, action: %{public}d, clirStat: %{public}d", getClirResult.result,
1275 getClirResult.action, getClirResult.clirStat);
1276 hdiId_ = HdiId::HREQ_CALL_GET_CLIR;
1277 resultInfo_ = responseInfo;
1278 NotifyAll();
1279 return 0;
1280 }
1281
SetClirResponse(const RilRadioResponseInfo & responseInfo)1282 int32_t RilCallbackTest::SetClirResponse(const RilRadioResponseInfo &responseInfo)
1283 {
1284 TELEPHONY_LOGI("GetBoolResult SetClirResponse");
1285 hdiId_ = HdiId::HREQ_CALL_SET_CLIR;
1286 resultInfo_ = responseInfo;
1287 NotifyAll();
1288 return 0;
1289 }
1290
StartDtmfResponse(const RilRadioResponseInfo & responseInfo)1291 int32_t RilCallbackTest::StartDtmfResponse(const RilRadioResponseInfo &responseInfo)
1292 {
1293 TELEPHONY_LOGI("GetBoolResult StartDtmfResponse");
1294 hdiId_ = HdiId::HREQ_CALL_START_DTMF;
1295 resultInfo_ = responseInfo;
1296 NotifyAll();
1297 return 0;
1298 }
1299
SendDtmfResponse(const RilRadioResponseInfo & responseInfo)1300 int32_t RilCallbackTest::SendDtmfResponse(const RilRadioResponseInfo &responseInfo)
1301 {
1302 TELEPHONY_LOGI("GetBoolResult SendDtmfResponse");
1303 hdiId_ = HdiId::HREQ_CALL_SEND_DTMF;
1304 resultInfo_ = responseInfo;
1305 NotifyAll();
1306 return 0;
1307 }
1308
StopDtmfResponse(const RilRadioResponseInfo & responseInfo)1309 int32_t RilCallbackTest::StopDtmfResponse(const RilRadioResponseInfo &responseInfo)
1310 {
1311 TELEPHONY_LOGI("GetBoolResult StopDtmfResponse");
1312 hdiId_ = HdiId::HREQ_CALL_STOP_DTMF;
1313 resultInfo_ = responseInfo;
1314 NotifyAll();
1315 return 0;
1316 }
1317
GetCallPreferenceModeResponse(const RilRadioResponseInfo & responseInfo,int32_t mode)1318 int32_t RilCallbackTest::GetCallPreferenceModeResponse(const RilRadioResponseInfo &responseInfo, int32_t mode)
1319 {
1320 TELEPHONY_LOGI("GetBoolResult GetCallPreferenceModeResponse mode: %{public}d", mode);
1321 hdiId_ = HdiId::HREQ_CALL_GET_CALL_PREFERENCE;
1322 resultInfo_ = responseInfo;
1323 NotifyAll();
1324 return 0;
1325 }
1326
SetCallPreferenceModeResponse(const RilRadioResponseInfo & responseInfo)1327 int32_t RilCallbackTest::SetCallPreferenceModeResponse(const RilRadioResponseInfo &responseInfo)
1328 {
1329 TELEPHONY_LOGI("GetBoolResult SetCallPreferenceModeResponse");
1330 hdiId_ = HdiId::HREQ_CALL_SET_CALL_PREFERENCE;
1331 resultInfo_ = responseInfo;
1332 NotifyAll();
1333 return 0;
1334 }
1335
SetUssdResponse(const RilRadioResponseInfo & responseInfo)1336 int32_t RilCallbackTest::SetUssdResponse(const RilRadioResponseInfo &responseInfo)
1337 {
1338 TELEPHONY_LOGI("GetBoolResult SetUssdResponse");
1339 hdiId_ = HdiId::HREQ_CALL_SET_USSD;
1340 resultInfo_ = responseInfo;
1341 NotifyAll();
1342 return 0;
1343 }
1344
GetUssdResponse(const RilRadioResponseInfo & responseInfo,int32_t cusd)1345 int32_t RilCallbackTest::GetUssdResponse(const RilRadioResponseInfo &responseInfo, int32_t cusd)
1346 {
1347 TELEPHONY_LOGI("GetBoolResult GetUssdResponse cusd: %{public}d", cusd);
1348 hdiId_ = HdiId::HREQ_CALL_GET_USSD;
1349 resultInfo_ = responseInfo;
1350 NotifyAll();
1351 return 0;
1352 }
1353
SetMuteResponse(const RilRadioResponseInfo & responseInfo)1354 int32_t RilCallbackTest::SetMuteResponse(const RilRadioResponseInfo &responseInfo)
1355 {
1356 TELEPHONY_LOGI("GetBoolResult SetMuteResponse");
1357 hdiId_ = HdiId::HREQ_CALL_SET_MUTE;
1358 resultInfo_ = responseInfo;
1359 NotifyAll();
1360 return 0;
1361 }
1362
GetMuteResponse(const RilRadioResponseInfo & responseInfo,int32_t mute)1363 int32_t RilCallbackTest::GetMuteResponse(const RilRadioResponseInfo &responseInfo, int32_t mute)
1364 {
1365 TELEPHONY_LOGI("GetBoolResult GetMuteResponse mute: %{public}d", mute);
1366 hdiId_ = HdiId::HREQ_CALL_GET_MUTE;
1367 resultInfo_ = responseInfo;
1368 NotifyAll();
1369 return 0;
1370 }
1371
GetCallFailReasonResponse(const RilRadioResponseInfo & responseInfo,int32_t callFail)1372 int32_t RilCallbackTest::GetCallFailReasonResponse(const RilRadioResponseInfo &responseInfo, int32_t callFail)
1373 {
1374 TELEPHONY_LOGI("GetBoolResult GetCallFailReasonResponse callFail: %{public}d", callFail);
1375 hdiId_ = HdiId::HREQ_CALL_GET_FAIL_REASON;
1376 resultInfo_ = responseInfo;
1377 NotifyAll();
1378 return 0;
1379 }
1380
SetBarringPasswordResponse(const RilRadioResponseInfo & responseInfo)1381 int32_t RilCallbackTest::SetBarringPasswordResponse(const RilRadioResponseInfo &responseInfo)
1382 {
1383 TELEPHONY_LOGI("GetBoolResult SetBarringPasswordResponse");
1384 hdiId_ = HdiId::HREQ_CALL_SET_BARRING_PASSWORD;
1385 resultInfo_ = responseInfo;
1386 NotifyAll();
1387 return 0;
1388 }
1389
CloseUnFinishedUssdResponse(const RilRadioResponseInfo & responseInfo)1390 int32_t RilCallbackTest::CloseUnFinishedUssdResponse(const RilRadioResponseInfo &responseInfo)
1391 {
1392 TELEPHONY_LOGI("GetBoolResult CloseUnFinishedUssdResponse");
1393 hdiId_ = HdiId::HREQ_CALL_CLOSE_UNFINISHED_USSD;
1394 resultInfo_ = responseInfo;
1395 NotifyAll();
1396 return 0;
1397 }
1398
SetVonrSwitchResponse(const RilRadioResponseInfo & responseInfo)1399 int32_t RilCallbackTest::SetVonrSwitchResponse(const RilRadioResponseInfo &responseInfo)
1400 {
1401 TELEPHONY_LOGI("GetBoolResult SetVonrSwitchResponse");
1402 hdiId_ = HdiId::HREQ_SET_VONR_SWITCH;
1403 resultInfo_ = responseInfo;
1404 NotifyAll();
1405 return 0;
1406 }
1407
1408 /**
1409 * modem
1410 **/
RadioStateUpdated(const RilRadioResponseInfo & responseInfo,int32_t state)1411 int32_t RilCallbackTest::RadioStateUpdated(const RilRadioResponseInfo &responseInfo, int32_t state)
1412 {
1413 TELEPHONY_LOGI("RadioStateUpdated state : %{public}d", state);
1414 return 0;
1415 }
1416
VoiceRadioTechUpdated(const RilRadioResponseInfo & responseInfo,const VoiceRadioTechnology & voiceRadioTechnology)1417 int32_t RilCallbackTest::VoiceRadioTechUpdated(
1418 const RilRadioResponseInfo &responseInfo, const VoiceRadioTechnology &voiceRadioTechnology)
1419 {
1420 TELEPHONY_LOGI(
1421 "GetVoiceRadioTechnologyResponse srvStatus : %{public}d srvDomain : %{public}d roamStatus: %{public}d "
1422 "simStatus : %{public}d lockStatus : %{public}d sysMode : %{public}d actType : %{public}d sysModeName : "
1423 "%{public}s actName : %{public}s",
1424 voiceRadioTechnology.srvStatus, voiceRadioTechnology.srvDomain, voiceRadioTechnology.roamStatus,
1425 voiceRadioTechnology.simStatus, voiceRadioTechnology.lockStatus, voiceRadioTechnology.sysMode,
1426 voiceRadioTechnology.actType, voiceRadioTechnology.sysModeName.c_str(), voiceRadioTechnology.actName.c_str());
1427 return 0;
1428 }
1429
DsdsModeUpdated(const RilRadioResponseInfo & responseInfo,int32_t mode)1430 int32_t RilCallbackTest::DsdsModeUpdated(const RilRadioResponseInfo &responseInfo, int32_t mode)
1431 {
1432 TELEPHONY_LOGI("DsdsModeUpdated mode : %{public}d", mode);
1433 return 0;
1434 }
1435
NcfgFinishedResult(const RilRadioResponseInfo & responseInfo,int32_t state)1436 int32_t RilCallbackTest::NcfgFinishedResult(const RilRadioResponseInfo &responseInfo, int32_t state)
1437 {
1438 TELEPHONY_LOGI("NcfgFinishedResult state : %{public}d", state);
1439 return 0;
1440 }
1441
RestartRildNvMatch(const RilRadioResponseInfo & responseInfo,int32_t state)1442 int32_t RilCallbackTest::RestartRildNvMatch(const RilRadioResponseInfo &responseInfo, int32_t state)
1443 {
1444 TELEPHONY_LOGI("RestartRildNvMatch state : %{public}d", state);
1445 return 0;
1446 }
1447
ShutDownResponse(const RilRadioResponseInfo & responseInfo)1448 int32_t RilCallbackTest::ShutDownResponse(const RilRadioResponseInfo &responseInfo)
1449 {
1450 TELEPHONY_LOGI("ShutDownResponse");
1451 hdiId_ = HdiId::HREQ_MODEM_SHUT_DOWN;
1452 resultInfo_ = responseInfo;
1453 NotifyAll();
1454 return 0;
1455 }
1456
SetRadioStateResponse(const RilRadioResponseInfo & responseInfo)1457 int32_t RilCallbackTest::SetRadioStateResponse(const RilRadioResponseInfo &responseInfo)
1458 {
1459 TELEPHONY_LOGI("SetRadioStateResponse");
1460 hdiId_ = HdiId::HREQ_MODEM_SET_RADIO_STATUS;
1461 resultInfo_ = responseInfo;
1462 NotifyAll();
1463 return 0;
1464 }
1465
GetRadioStateResponse(const RilRadioResponseInfo & responseInfo,int32_t state)1466 int32_t RilCallbackTest::GetRadioStateResponse(const RilRadioResponseInfo &responseInfo, int32_t state)
1467 {
1468 TELEPHONY_LOGI("GetRadioStateResponse state : %{public}d", state);
1469 hdiId_ = HdiId::HREQ_MODEM_GET_RADIO_STATUS;
1470 resultInfo_ = responseInfo;
1471 NotifyAll();
1472 return 0;
1473 }
1474
GetImeiResponse(const RilRadioResponseInfo & responseInfo,const std::string & imei)1475 int32_t RilCallbackTest::GetImeiResponse(const RilRadioResponseInfo &responseInfo, const std::string &imei)
1476 {
1477 TELEPHONY_LOGI("GetImeiResponse imei : %{public}s", imei.c_str());
1478 hdiId_ = HdiId::HREQ_MODEM_GET_IMEI;
1479 resultInfo_ = responseInfo;
1480 NotifyAll();
1481 return 0;
1482 }
1483
GetImeiSvResponse(const RilRadioResponseInfo & responseInfo,const std::string & imeiSv)1484 int32_t RilCallbackTest::GetImeiSvResponse(const RilRadioResponseInfo &responseInfo, const std::string &imeiSv)
1485 {
1486 hdiId_ = HdiId::HREQ_MODEM_GET_IMEISV;
1487 resultInfo_ = responseInfo;
1488 NotifyAll();
1489 return 0;
1490 }
1491
GetMeidResponse(const RilRadioResponseInfo & responseInfo,const std::string & meid)1492 int32_t RilCallbackTest::GetMeidResponse(const RilRadioResponseInfo &responseInfo, const std::string &meid)
1493 {
1494 TELEPHONY_LOGI("GetMeidResponse meid : %{public}s", meid.c_str());
1495 hdiId_ = HdiId::HREQ_MODEM_GET_MEID;
1496 resultInfo_ = responseInfo;
1497 NotifyAll();
1498 return 0;
1499 }
1500
GetVoiceRadioTechnologyResponse(const RilRadioResponseInfo & responseInfo,const VoiceRadioTechnology & voiceRadioTechnology)1501 int32_t RilCallbackTest::GetVoiceRadioTechnologyResponse(
1502 const RilRadioResponseInfo &responseInfo, const VoiceRadioTechnology &voiceRadioTechnology)
1503 {
1504 TELEPHONY_LOGI(
1505 "GetVoiceRadioTechnologyResponse srvStatus : %{public}d srvDomain : %{public}d roamStatus: %{public}d "
1506 "simStatus : %{public}d lockStatus : %{public}d sysMode : %{public}d actType : %{public}d sysModeName : "
1507 "%{public}s actName : %{public}s",
1508 voiceRadioTechnology.srvStatus, voiceRadioTechnology.srvDomain, voiceRadioTechnology.roamStatus,
1509 voiceRadioTechnology.simStatus, voiceRadioTechnology.lockStatus, voiceRadioTechnology.sysMode,
1510 voiceRadioTechnology.actType, voiceRadioTechnology.sysModeName.c_str(), voiceRadioTechnology.actName.c_str());
1511 hdiId_ = HdiId::HREQ_MODEM_GET_VOICE_RADIO;
1512 resultInfo_ = responseInfo;
1513 NotifyAll();
1514 return 0;
1515 }
1516
GetBasebandVersionResponse(const RilRadioResponseInfo & responseInfo,const std::string & basebandVersion)1517 int32_t RilCallbackTest::GetBasebandVersionResponse(
1518 const RilRadioResponseInfo &responseInfo, const std::string &basebandVersion)
1519 {
1520 TELEPHONY_LOGI("GetBasebandVersionResponse basebandVersion : %{public}s", basebandVersion.c_str());
1521 hdiId_ = HdiId::HREQ_MODEM_GET_BASEBAND_VERSION;
1522 resultInfo_ = responseInfo;
1523 NotifyAll();
1524 return 0;
1525 }
1526
GetRrcConnectionStateUpdated(const RilRadioResponseInfo & responseInfo,int32_t state)1527 int32_t RilCallbackTest::GetRrcConnectionStateUpdated(const RilRadioResponseInfo &responseInfo, int32_t state)
1528 {
1529 TELEPHONY_LOGI("GetRrcConnectionStateUpdated state : %{public}d", state);
1530 return 0;
1531 }
1532
1533 // Data
PdpContextListUpdated(const RilRadioResponseInfo & responseInfo,const DataCallResultList & dataCallResultList)1534 int32_t RilCallbackTest::PdpContextListUpdated(
1535 const RilRadioResponseInfo &responseInfo, const DataCallResultList &dataCallResultList)
1536 {
1537 TELEPHONY_LOGI("RilCallbackTest::PdpContextListUpdated size:%{public}d", dataCallResultList.size);
1538 for (auto &setupDataCallResultInfo : dataCallResultList.dcList) {
1539 TELEPHONY_LOGI(
1540 "RilCallbackTest::PdpContextListUpdated flag:%{public}d reason:%{public}d retryTime:%{public}d "
1541 "cid:%{public}d active:%{public}d type:%{public}s netPortName:%{public}s address:%{public}s "
1542 "dns:%{public}s dnsSec:%{public}s gateway:%{public}s maxTransferUnit:%{public}d pCscfPrimAddr:%{public}s "
1543 "pCscfSecAddr:%{public}s pduSessionId:%{public}d",
1544 setupDataCallResultInfo.flag, setupDataCallResultInfo.reason, setupDataCallResultInfo.retryTime,
1545 setupDataCallResultInfo.cid, setupDataCallResultInfo.active, setupDataCallResultInfo.type.c_str(),
1546 setupDataCallResultInfo.netPortName.c_str(), setupDataCallResultInfo.address.c_str(),
1547 setupDataCallResultInfo.dns.c_str(), setupDataCallResultInfo.dnsSec.c_str(),
1548 setupDataCallResultInfo.gateway.c_str(), setupDataCallResultInfo.maxTransferUnit,
1549 setupDataCallResultInfo.pCscfPrimAddr.c_str(), setupDataCallResultInfo.pCscfSecAddr.c_str(),
1550 setupDataCallResultInfo.pduSessionId);
1551 }
1552 return 0;
1553 }
1554
DataLinkCapabilityUpdated(const RilRadioResponseInfo & responseInfo,const DataLinkCapability & dataLinkCapability)1555 int32_t RilCallbackTest::DataLinkCapabilityUpdated(
1556 const RilRadioResponseInfo &responseInfo, const DataLinkCapability &dataLinkCapability)
1557 {
1558 TELEPHONY_LOGI(
1559 "RilCallbackTest::DataLinkCapabilityUpdated primaryDownlinkKbps:%{public}d primaryUplinkKbps:%{public}d "
1560 "secondaryDownlinkKbps:%{public}d secondaryUplinkKbps:%{public}d",
1561 dataLinkCapability.primaryDownlinkKbps, dataLinkCapability.primaryUplinkKbps,
1562 dataLinkCapability.secondaryDownlinkKbps, dataLinkCapability.secondaryUplinkKbps);
1563 return 0;
1564 }
1565
ActivatePdpContextResponse(const RilRadioResponseInfo & responseInfo,const SetupDataCallResultInfo & setupDataCallResultInfo)1566 int32_t RilCallbackTest::ActivatePdpContextResponse(
1567 const RilRadioResponseInfo &responseInfo, const SetupDataCallResultInfo &setupDataCallResultInfo)
1568 {
1569 TELEPHONY_LOGI(
1570 "RilCallbackTest::ActivatePdpContextResponse flag:%{public}d reason:%{public}d retryTime:%{public}d "
1571 "cid:%{public}d active:%{public}d type:%{public}s netPortName:%{public}s address:%{public}s "
1572 "dns:%{public}s dnsSec:%{public}s gateway:%{public}s maxTransferUnit:%{public}d pCscfPrimAddr:%{public}s "
1573 "pCscfSecAddr:%{public}s pduSessionId:%{public}d",
1574 setupDataCallResultInfo.flag, setupDataCallResultInfo.reason, setupDataCallResultInfo.retryTime,
1575 setupDataCallResultInfo.cid, setupDataCallResultInfo.active, setupDataCallResultInfo.type.c_str(),
1576 setupDataCallResultInfo.netPortName.c_str(), setupDataCallResultInfo.address.c_str(),
1577 setupDataCallResultInfo.dns.c_str(), setupDataCallResultInfo.dnsSec.c_str(),
1578 setupDataCallResultInfo.gateway.c_str(), setupDataCallResultInfo.maxTransferUnit,
1579 setupDataCallResultInfo.pCscfPrimAddr.c_str(), setupDataCallResultInfo.pCscfSecAddr.c_str(),
1580 setupDataCallResultInfo.pduSessionId);
1581 hdiId_ = HdiId::HREQ_DATA_ACTIVATE_PDP_CONTEXT;
1582 resultInfo_ = responseInfo;
1583 NotifyAll();
1584 return 0;
1585 }
1586
DeactivatePdpContextResponse(const RilRadioResponseInfo & responseInfo)1587 int32_t RilCallbackTest::DeactivatePdpContextResponse(const RilRadioResponseInfo &responseInfo)
1588 {
1589 TELEPHONY_LOGI("RilCallbackTest::DeactivatePdpContextResponse error:%{public}d", responseInfo.error);
1590 hdiId_ = HdiId::HREQ_DATA_DEACTIVATE_PDP_CONTEXT;
1591 resultInfo_ = responseInfo;
1592 NotifyAll();
1593 return 0;
1594 }
1595
GetPdpContextListResponse(const RilRadioResponseInfo & responseInfo,const DataCallResultList & dataCallResultList)1596 int32_t RilCallbackTest::GetPdpContextListResponse(
1597 const RilRadioResponseInfo &responseInfo, const DataCallResultList &dataCallResultList)
1598 {
1599 TELEPHONY_LOGI("RilCallbackTest::GetPdpContextListResponse size:%{public}d", dataCallResultList.size);
1600 for (auto &setupDataCallResultInfo : dataCallResultList.dcList) {
1601 TELEPHONY_LOGI(
1602 "RilCallbackTest::GetPdpContextListResponse flag:%{public}d reason:%{public}d retryTime:%{public}d "
1603 "cid:%{public}d active:%{public}d type:%{public}s netPortName:%{public}s address:%{public}s "
1604 "dns:%{public}s dnsSec:%{public}s gateway:%{public}s maxTransferUnit:%{public}d pCscfPrimAddr:%{public}s "
1605 "pCscfSecAddr:%{public}s pduSessionId:%{public}d",
1606 setupDataCallResultInfo.flag, setupDataCallResultInfo.reason, setupDataCallResultInfo.retryTime,
1607 setupDataCallResultInfo.cid, setupDataCallResultInfo.active, setupDataCallResultInfo.type.c_str(),
1608 setupDataCallResultInfo.netPortName.c_str(), setupDataCallResultInfo.address.c_str(),
1609 setupDataCallResultInfo.dns.c_str(), setupDataCallResultInfo.dnsSec.c_str(),
1610 setupDataCallResultInfo.gateway.c_str(), setupDataCallResultInfo.maxTransferUnit,
1611 setupDataCallResultInfo.pCscfPrimAddr.c_str(), setupDataCallResultInfo.pCscfSecAddr.c_str(),
1612 setupDataCallResultInfo.pduSessionId);
1613 }
1614 hdiId_ = HdiId::HREQ_DATA_GET_PDP_CONTEXT_LIST;
1615 resultInfo_ = responseInfo;
1616 NotifyAll();
1617 return 0;
1618 }
1619
SetInitApnInfoResponse(const RilRadioResponseInfo & responseInfo)1620 int32_t RilCallbackTest::SetInitApnInfoResponse(const RilRadioResponseInfo &responseInfo)
1621 {
1622 TELEPHONY_LOGI("RilCallbackTest::SetInitApnInfoResponse error:%{public}d", responseInfo.error);
1623 hdiId_ = HdiId::HREQ_DATA_SET_INIT_APN_INFO;
1624 resultInfo_ = responseInfo;
1625 NotifyAll();
1626 return 0;
1627 }
1628
SetLinkBandwidthReportingRuleResponse(const RilRadioResponseInfo & responseInfo)1629 int32_t RilCallbackTest::SetLinkBandwidthReportingRuleResponse(const RilRadioResponseInfo &responseInfo)
1630 {
1631 TELEPHONY_LOGI("RilCallbackTest::SetLinkBandwidthReportingRuleResponse error:%{public}d", responseInfo.error);
1632 hdiId_ = HdiId::HREQ_DATA_SET_LINK_BANDWIDTH_REPORTING_RULE;
1633 resultInfo_ = responseInfo;
1634 NotifyAll();
1635 return 0;
1636 }
1637
GetLinkBandwidthInfoResponse(const RilRadioResponseInfo & responseInfo,const DataLinkBandwidthInfo & dataLinkBandwidthInfo)1638 int32_t RilCallbackTest::GetLinkBandwidthInfoResponse(
1639 const RilRadioResponseInfo &responseInfo, const DataLinkBandwidthInfo &dataLinkBandwidthInfo)
1640 {
1641 TELEPHONY_LOGI("RilCallbackTest::GetLinkBandwidthInfoResponse serial:%{public}d cid:%{public}d qi:%{public}d "
1642 "dlGfbr:%{public}d "
1643 "ulGfbr:%{public}d dlMfbr:%{public}d ulMfbr:%{public}d ulSambr:%{public}d dlSambr:%{public}d "
1644 "averagingWindow:%{public}d",
1645 dataLinkBandwidthInfo.serial, dataLinkBandwidthInfo.cid, dataLinkBandwidthInfo.qi, dataLinkBandwidthInfo.dlGfbr,
1646 dataLinkBandwidthInfo.ulGfbr, dataLinkBandwidthInfo.dlMfbr, dataLinkBandwidthInfo.ulMfbr,
1647 dataLinkBandwidthInfo.ulSambr, dataLinkBandwidthInfo.dlSambr, dataLinkBandwidthInfo.averagingWindow);
1648 hdiId_ = HdiId::HREQ_DATA_GET_LINK_BANDWIDTH_INFO;
1649 resultInfo_ = responseInfo;
1650 NotifyAll();
1651 return 0;
1652 }
1653
GetLinkCapabilityResponse(const RilRadioResponseInfo & responseInfo,const DataLinkCapability & dataLinkCapability)1654 int32_t RilCallbackTest::GetLinkCapabilityResponse(
1655 const RilRadioResponseInfo &responseInfo, const DataLinkCapability &dataLinkCapability)
1656 {
1657 TELEPHONY_LOGI("RilCallbackTest::GetLinkCapabilityResponse primaryDownlinkKbps:%{public}d "
1658 "primaryUplinkKbps:%{public}d secondaryDownlinkKbps:%{public}d "
1659 "secondaryUplinkKbps:%{public}d",
1660 dataLinkCapability.primaryDownlinkKbps, dataLinkCapability.primaryUplinkKbps,
1661 dataLinkCapability.secondaryDownlinkKbps, dataLinkCapability.secondaryUplinkKbps);
1662 hdiId_ = HdiId::HREQ_DATA_GET_LINK_CAPABILITY;
1663 resultInfo_ = responseInfo;
1664 NotifyAll();
1665 return 0;
1666 }
1667
SetDataPermittedResponse(const RilRadioResponseInfo & responseInfo)1668 int32_t RilCallbackTest::SetDataPermittedResponse(const RilRadioResponseInfo &responseInfo)
1669 {
1670 TELEPHONY_LOGI("RilCallbackTest::SetDataPermittedResponse error:%{public}d", responseInfo.error);
1671 hdiId_ = HdiId::HREQ_DATA_SET_DATA_PERMITTED;
1672 resultInfo_ = responseInfo;
1673 NotifyAll();
1674 return 0;
1675 }
1676
SetDataProfileInfoResponse(const RilRadioResponseInfo & responseInfo)1677 int32_t RilCallbackTest::SetDataProfileInfoResponse(const RilRadioResponseInfo &responseInfo)
1678 {
1679 TELEPHONY_LOGI("RilCallbackTest::SetDataProfileInfoResponse error:%{public}d", responseInfo.error);
1680 hdiId_ = HdiId::HREQ_DATA_SET_DATA_PROFILE_INFO;
1681 resultInfo_ = responseInfo;
1682 NotifyAll();
1683 return 0;
1684 }
1685
CleanAllConnectionsResponse(const RilRadioResponseInfo & responseInfo)1686 int32_t RilCallbackTest::CleanAllConnectionsResponse(const RilRadioResponseInfo &responseInfo)
1687 {
1688 TELEPHONY_LOGI("RilCallbackTest::CleanAllConnectionsResponse error:%{public}d", responseInfo.error);
1689 hdiId_ = HdiId::HREQ_DATA_CLEAN_ALL_CONNECTIONS;
1690 resultInfo_ = responseInfo;
1691 NotifyAll();
1692 return 0;
1693 }
1694
NetworkSliceUrspRpt(const RilRadioResponseInfo & responseInfo,const NetworkSliceUrspInfo & networkSliceUrspInfo)1695 int32_t RilCallbackTest::NetworkSliceUrspRpt(const RilRadioResponseInfo &responseInfo,
1696 const NetworkSliceUrspInfo &networkSliceUrspInfo)
1697 {
1698 TELEPHONY_LOGI("RilCallbackTest::NetworkSliceUrspRpt:%{public}d", (int)networkSliceUrspInfo.urspInfo.size());
1699 return 0;
1700 }
1701
NetworkSliceAllowedNssaiRpt(const RilRadioResponseInfo & responseInfo,const NetworkSliceAllowedNssaiInfo & networkSliceAllowedNssaiInfo)1702 int32_t RilCallbackTest::NetworkSliceAllowedNssaiRpt(const RilRadioResponseInfo &responseInfo,
1703 const NetworkSliceAllowedNssaiInfo &networkSliceAllowedNssaiInfo)
1704 {
1705 TELEPHONY_LOGI("RilCallbackTest::NetworkSliceAllowedNssaiRpt:%{public}d",
1706 (int)networkSliceAllowedNssaiInfo.allowednssaiInfo.size());
1707 return 0;
1708 }
1709
NetworkSliceEhplmnRpt(const RilRadioResponseInfo & responseInfo,const NetworkSliceEhplmnInfo & networkSliceEhplmnInfo)1710 int32_t RilCallbackTest::NetworkSliceEhplmnRpt(const RilRadioResponseInfo &responseInfo,
1711 const NetworkSliceEhplmnInfo &networkSliceEhplmnInfo)
1712 {
1713 TELEPHONY_LOGI("RilCallbackTest::NetworkSliceEhplmnRpt:%{public}d", (int)networkSliceEhplmnInfo.ehplmnInfo.size());
1714 return 0;
1715 }
1716
SendUrspDecodeResultResponse(const RilRadioResponseInfo & responseInfo)1717 int32_t RilCallbackTest::SendUrspDecodeResultResponse(const RilRadioResponseInfo &responseInfo)
1718 {
1719 TELEPHONY_LOGI("RilCallbackTest::SendUrspDecodeResultResponse error:%{public}d", responseInfo.error);
1720 hdiId_ = HdiId::HREQ_DATA_SEND_UEPOLICY_DECODE_RESULT;
1721 resultInfo_ = responseInfo;
1722 NotifyAll();
1723 return 0;
1724 }
1725
SendUePolicySectionIdentifierResponse(const RilRadioResponseInfo & responseInfo)1726 int32_t RilCallbackTest::SendUePolicySectionIdentifierResponse(const RilRadioResponseInfo &responseInfo)
1727 {
1728 TELEPHONY_LOGI("RilCallbackTest::SendUePolicySectionIdentifierResponse error:%{public}d", responseInfo.error);
1729 hdiId_ = HdiId::HREQ_DATA_SEND_UE_SECTION_IDENTIFIER;
1730 resultInfo_ = responseInfo;
1731 NotifyAll();
1732 return 0;
1733 }
1734
GetNetworkSliceAllowedNssaiResponse(const RilRadioResponseInfo & responseInfo)1735 int32_t RilCallbackTest::GetNetworkSliceAllowedNssaiResponse(const RilRadioResponseInfo &responseInfo)
1736 {
1737 TELEPHONY_LOGI("RilCallbackTest::GetNetworkSliceAllowedNssaiResponse error:%{public}d", responseInfo.error);
1738 hdiId_ = HdiId::HREQ_DATA_SYNC_ALLOWED_NSSAI_WITH_MODEM;
1739 resultInfo_ = responseInfo;
1740 NotifyAll();
1741 return 0;
1742 }
1743
GetNetworkSliceEhplmnResponse(const RilRadioResponseInfo & responseInfo)1744 int32_t RilCallbackTest::GetNetworkSliceEhplmnResponse(const RilRadioResponseInfo &responseInfo)
1745 {
1746 TELEPHONY_LOGI("RilCallbackTest::GetNetworkSliceEhplmnResponse error:%{public}d", responseInfo.error);
1747 hdiId_ = HdiId::HREQ_DATA_SYNC_EHPLMN_WITH_MODEM;
1748 resultInfo_ = responseInfo;
1749 NotifyAll();
1750 return 0;
1751 }
1752
SendImsRsdListResponse(const RilRadioResponseInfo & responseInfo)1753 int32_t RilCallbackTest::SendImsRsdListResponse(const RilRadioResponseInfo &responseInfo)
1754 {
1755 TELEPHONY_LOGI("RilCallbackTest::SendImsRsdListResponse error:%{public}d", responseInfo.error);
1756 hdiId_ = HdiId::HREQ_DATA_SEND_IMS_RSD_LIST;
1757 resultInfo_ = responseInfo;
1758 NotifyAll();
1759 return 0;
1760 }
1761
1762 // Sms
NewSmsNotify(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const SmsMessageInfo & smsMessageInfo)1763 int32_t RilCallbackTest::NewSmsNotify(
1764 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const SmsMessageInfo &smsMessageInfo)
1765 {
1766 TELEPHONY_LOGI("RilCallbackTest::NewSmsNotify smsMessageInfo size : %{public}d", smsMessageInfo.size);
1767 return 0;
1768 }
1769
NewCdmaSmsNotify(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const SmsMessageInfo & smsMessageInfo)1770 int32_t RilCallbackTest::NewCdmaSmsNotify(
1771 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const SmsMessageInfo &smsMessageInfo)
1772 {
1773 TELEPHONY_LOGI("RilCallbackTest::NewCdmaSmsNotify smsMessageInfo size : %{public}d", smsMessageInfo.size);
1774 return 0;
1775 }
1776
SmsStatusReportNotify(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const SmsMessageInfo & smsMessageInfo)1777 int32_t RilCallbackTest::SmsStatusReportNotify(
1778 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const SmsMessageInfo &smsMessageInfo)
1779 {
1780 TELEPHONY_LOGI("RilCallbackTest::SmsStatusReportNotify smsMessageInfo size : %{public}d", smsMessageInfo.size);
1781 return 0;
1782 }
1783
NewSmsStoredOnSimNotify(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,int32_t recordNumber,int32_t indicationType)1784 int32_t RilCallbackTest::NewSmsStoredOnSimNotify(
1785 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, int32_t recordNumber, int32_t indicationType)
1786 {
1787 TELEPHONY_LOGI("RilCallbackTest::NewSmsStoredOnSimNotify recordNumber : %{public}d, indicationType : %{public}d",
1788 recordNumber, indicationType);
1789 return 0;
1790 }
1791
CBConfigNotify(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const CBConfigReportInfo & cellBroadConfigReportInfo)1792 int32_t RilCallbackTest::CBConfigNotify(
1793 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const CBConfigReportInfo &cellBroadConfigReportInfo)
1794 {
1795 TELEPHONY_LOGI("RilCallbackTest::CBConfigNotify cellBroadConfigReportInfo dcs : %{public}s",
1796 cellBroadConfigReportInfo.dcs.c_str());
1797 return 0;
1798 }
1799
SendGsmSmsResponse(const RilRadioResponseInfo & responseInfo,const SendSmsResultInfo & sendSmsResultInfo)1800 int32_t RilCallbackTest::SendGsmSmsResponse(
1801 const RilRadioResponseInfo &responseInfo, const SendSmsResultInfo &sendSmsResultInfo)
1802 {
1803 TELEPHONY_LOGI("RilCallbackTest::SendGsmSmsResponse sendSmsResultInfo pdu : %{public}s, error : %{public}d",
1804 sendSmsResultInfo.pdu.c_str(), sendSmsResultInfo.errCode);
1805 hdiId_ = HdiId::HREQ_SMS_SEND_GSM_SMS;
1806 resultInfo_ = responseInfo;
1807 NotifyAll();
1808 return 0;
1809 }
1810
SendCdmaSmsResponse(const RilRadioResponseInfo & responseInfo,const SendSmsResultInfo & sendSmsResultInfo)1811 int32_t RilCallbackTest::SendCdmaSmsResponse(
1812 const RilRadioResponseInfo &responseInfo, const SendSmsResultInfo &sendSmsResultInfo)
1813 {
1814 TELEPHONY_LOGI("RilCallbackTest::SendCdmaSmsResponse sendSmsResultInfo pdu : %{public}s, error : %{public}d",
1815 sendSmsResultInfo.pdu.c_str(), sendSmsResultInfo.errCode);
1816 hdiId_ = HdiId::HREQ_SMS_SEND_CDMA_SMS;
1817 resultInfo_ = responseInfo;
1818 NotifyAll();
1819 return 0;
1820 }
1821
AddSimMessageResponse(const RilRadioResponseInfo & responseInfo)1822 int32_t RilCallbackTest::AddSimMessageResponse(const RilRadioResponseInfo &responseInfo)
1823 {
1824 TELEPHONY_LOGI("RilCallbackTest::AddSimMessageResponse error : %{public}d", responseInfo.error);
1825 hdiId_ = HdiId::HREQ_SMS_ADD_SIM_MESSAGE;
1826 resultInfo_ = responseInfo;
1827 NotifyAll();
1828 return 0;
1829 }
1830
DelSimMessageResponse(const RilRadioResponseInfo & responseInfo)1831 int32_t RilCallbackTest::DelSimMessageResponse(const RilRadioResponseInfo &responseInfo)
1832 {
1833 TELEPHONY_LOGI("RilCallbackTest::DelSimMessageResponse error : %{public}d", responseInfo.error);
1834 hdiId_ = HdiId::HREQ_SMS_DEL_SIM_MESSAGE;
1835 resultInfo_ = responseInfo;
1836 NotifyAll();
1837 return 0;
1838 }
1839
UpdateSimMessageResponse(const RilRadioResponseInfo & responseInfo)1840 int32_t RilCallbackTest::UpdateSimMessageResponse(const RilRadioResponseInfo &responseInfo)
1841 {
1842 TELEPHONY_LOGI("RilCallbackTest::UpdateSimMessageResponse error : %{public}d", responseInfo.error);
1843 hdiId_ = HdiId::HREQ_SMS_UPDATE_SIM_MESSAGE;
1844 resultInfo_ = responseInfo;
1845 NotifyAll();
1846 return 0;
1847 }
1848
AddCdmaSimMessageResponse(const RilRadioResponseInfo & responseInfo)1849 int32_t RilCallbackTest::AddCdmaSimMessageResponse(const RilRadioResponseInfo &responseInfo)
1850 {
1851 TELEPHONY_LOGI("RilCallbackTest::AddCdmaSimMessageResponse error : %{public}d", responseInfo.error);
1852 hdiId_ = HdiId::HREQ_SMS_ADD_CDMA_SIM_MESSAGE;
1853 resultInfo_ = responseInfo;
1854 NotifyAll();
1855 return 0;
1856 }
1857
DelCdmaSimMessageResponse(const RilRadioResponseInfo & responseInfo)1858 int32_t RilCallbackTest::DelCdmaSimMessageResponse(const RilRadioResponseInfo &responseInfo)
1859 {
1860 TELEPHONY_LOGI("RilCallbackTest::DelCdmaSimMessageResponse error : %{public}d", responseInfo.error);
1861 hdiId_ = HdiId::HREQ_SMS_DEL_CDMA_SIM_MESSAGE;
1862 resultInfo_ = responseInfo;
1863 NotifyAll();
1864 return 0;
1865 }
1866
UpdateCdmaSimMessageResponse(const RilRadioResponseInfo & responseInfo)1867 int32_t RilCallbackTest::UpdateCdmaSimMessageResponse(const RilRadioResponseInfo &responseInfo)
1868 {
1869 TELEPHONY_LOGI("RilCallbackTest::UpdateCdmaSimMessageResponse error : %{public}d", responseInfo.error);
1870 hdiId_ = HdiId::HREQ_SMS_UPDATE_CDMA_SIM_MESSAGE;
1871 resultInfo_ = responseInfo;
1872 NotifyAll();
1873 return 0;
1874 }
1875
SetSmscAddrResponse(const RilRadioResponseInfo & responseInfo)1876 int32_t RilCallbackTest::SetSmscAddrResponse(const RilRadioResponseInfo &responseInfo)
1877 {
1878 TELEPHONY_LOGI("RilCallbackTest::SetSmscAddrResponse error : %{public}d", responseInfo.error);
1879 hdiId_ = HdiId::HREQ_SMS_SET_SMSC_ADDR;
1880 resultInfo_ = responseInfo;
1881 NotifyAll();
1882 return 0;
1883 }
1884
GetSmscAddrResponse(const RilRadioResponseInfo & responseInfo,const ServiceCenterAddress & serviceCenterAddress)1885 int32_t RilCallbackTest::GetSmscAddrResponse(
1886 const RilRadioResponseInfo &responseInfo, const ServiceCenterAddress &serviceCenterAddress)
1887 {
1888 TELEPHONY_LOGI("RilCallbackTest::GetSmscAddrResponse serviceCenterAddress tosca : %{public}d, address : %{public}s",
1889 serviceCenterAddress.tosca, serviceCenterAddress.address.c_str());
1890 smscAddr_ = serviceCenterAddress.address;
1891 hdiId_ = HdiId::HREQ_SMS_GET_SMSC_ADDR;
1892 resultInfo_ = responseInfo;
1893 NotifyAll();
1894 return 0;
1895 }
1896
SetCBConfigResponse(const RilRadioResponseInfo & responseInfo)1897 int32_t RilCallbackTest::SetCBConfigResponse(const RilRadioResponseInfo &responseInfo)
1898 {
1899 TELEPHONY_LOGI("RilCallbackTest::SetCBConfigResponse error : %{public}d", responseInfo.error);
1900 hdiId_ = HdiId::HREQ_SMS_SET_CB_CONFIG;
1901 resultInfo_ = responseInfo;
1902 NotifyAll();
1903 return 0;
1904 }
1905
GetCBConfigResponse(const RilRadioResponseInfo & responseInfo,const CBConfigInfo & cellBroadcastInfo)1906 int32_t RilCallbackTest::GetCBConfigResponse(
1907 const RilRadioResponseInfo &responseInfo, const CBConfigInfo &cellBroadcastInfo)
1908 {
1909 TELEPHONY_LOGI("RilCallbackTest::GetCBConfigResponse cellBroadcastInfo mids : %{public}s, dcss: %{public}s",
1910 cellBroadcastInfo.mids.c_str(), cellBroadcastInfo.dcss.c_str());
1911 hdiId_ = HdiId::HREQ_SMS_GET_CB_CONFIG;
1912 resultInfo_ = responseInfo;
1913 NotifyAll();
1914 return 0;
1915 }
1916
SetCdmaCBConfigResponse(const RilRadioResponseInfo & responseInfo)1917 int32_t RilCallbackTest::SetCdmaCBConfigResponse(const RilRadioResponseInfo &responseInfo)
1918 {
1919 TELEPHONY_LOGI("RilCallbackTest::SetCdmaCBConfigResponse error : %{public}d", responseInfo.error);
1920 hdiId_ = HdiId::HREQ_SMS_SET_CDMA_CB_CONFIG;
1921 resultInfo_ = responseInfo;
1922 NotifyAll();
1923 return 0;
1924 }
1925
GetCdmaCBConfigResponse(const RilRadioResponseInfo & responseInfo,const CdmaCBConfigInfo & cdmaCBConfigInfo)1926 int32_t RilCallbackTest::GetCdmaCBConfigResponse(
1927 const RilRadioResponseInfo &responseInfo, const CdmaCBConfigInfo &cdmaCBConfigInfo)
1928 {
1929 TELEPHONY_LOGI(
1930 "RilCallbackTest::GetCdmaCBConfigResponse cdmaCBConfigInfo service : %{public}d, language : %{public}d, "
1931 "checked: %{public}d",
1932 cdmaCBConfigInfo.service, cdmaCBConfigInfo.language, cdmaCBConfigInfo.checked);
1933 hdiId_ = HdiId::HREQ_SMS_GET_CDMA_CB_CONFIG;
1934 resultInfo_ = responseInfo;
1935 NotifyAll();
1936 return 0;
1937 }
1938
SendSmsMoreModeResponse(const RilRadioResponseInfo & responseInfo,const SendSmsResultInfo & sendSmsResultInfo)1939 int32_t RilCallbackTest::SendSmsMoreModeResponse(
1940 const RilRadioResponseInfo &responseInfo, const SendSmsResultInfo &sendSmsResultInfo)
1941 {
1942 TELEPHONY_LOGI("RilCallbackTest::SendSmsMoreModeResponse sendSmsResultInfo pdu : %{public}s, error : %{public}d",
1943 sendSmsResultInfo.pdu.c_str(), sendSmsResultInfo.errCode);
1944 hdiId_ = HdiId::HREQ_SMS_SEND_SMS_MORE_MODE;
1945 resultInfo_ = responseInfo;
1946 NotifyAll();
1947 return 0;
1948 }
1949
SendSmsAckResponse(const RilRadioResponseInfo & responseInfo)1950 int32_t RilCallbackTest::SendSmsAckResponse(const RilRadioResponseInfo &responseInfo)
1951 {
1952 TELEPHONY_LOGI("RilCallbackTest::SendSmsAckResponse error: %{public}d", responseInfo.error);
1953 hdiId_ = HdiId::HREQ_SMS_SEND_SMS_ACK;
1954 resultInfo_ = responseInfo;
1955 NotifyAll();
1956 return 0;
1957 }
1958
CommonErrorResponse(const RilRadioResponseInfo & responseInfo)1959 int32_t RilCallbackTest::CommonErrorResponse(const RilRadioResponseInfo &responseInfo)
1960 {
1961 TELEPHONY_LOGI("RilCallbackTest::CommonErrorResponse type:%{public}d error: %{public}d",
1962 responseInfo.type, responseInfo.error);
1963 return 0;
1964 }
1965
1966 } // namespace Telephony
1967 } // namespace OHOS
1968