1 /*
2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "tel_ril_call.h"
17
18 #include "core_service_hisysevent.h"
19 #include "radio_event.h"
20 #include "tel_ril_call_parcel.h"
21
22 namespace OHOS {
23 namespace Telephony {
24 static const int32_t TYPE_CS = 0;
25 static const int32_t DTMF_ON_LENGTH = 150;
26 static const int32_t DTMF_OFF_LENGTH = 70;
27 static const int32_t DTMF_STRING_LENGTH = 1;
28
TelRilCall(int32_t slotId,sptr<HDI::Ril::V1_3::IRil> rilInterface,std::shared_ptr<ObserverHandler> observerHandler,std::shared_ptr<TelRilHandler> handler)29 TelRilCall::TelRilCall(int32_t slotId, sptr<HDI::Ril::V1_3::IRil> rilInterface,
30 std::shared_ptr<ObserverHandler> observerHandler, std::shared_ptr<TelRilHandler> handler)
31 : TelRilBase(slotId, rilInterface, observerHandler, handler)
32 {}
33
AnswerResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)34 int32_t TelRilCall::AnswerResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
35 {
36 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
37 }
38
HoldCallResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)39 int32_t TelRilCall::HoldCallResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
40 {
41 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
42 }
43
UnHoldCallResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)44 int32_t TelRilCall::UnHoldCallResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
45 {
46 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
47 }
48
SwitchCallResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)49 int32_t TelRilCall::SwitchCallResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
50 {
51 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
52 }
53
GetCallListResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::CallInfoList & callInfoList)54 int32_t TelRilCall::GetCallListResponse(
55 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const HDI::Ril::V1_1::CallInfoList &callInfoList)
56 {
57 std::shared_ptr<CallInfoList> callInfo = std::make_shared<CallInfoList>();
58 if (callInfo == nullptr) {
59 TELEPHONY_LOGE("ERROR : callInfo == nullptr !!!");
60 return TELEPHONY_ERR_LOCAL_PTR_NULL;
61 }
62 BuildCallInfoList(callInfo, callInfoList);
63 return Response<CallInfoList>(TELEPHONY_LOG_FUNC_NAME, responseInfo, callInfo);
64 }
65
DialResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)66 int32_t TelRilCall::DialResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
67 {
68 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
69 }
70
HangupResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)71 int32_t TelRilCall::HangupResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
72 {
73 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
74 }
75
RejectResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)76 int32_t TelRilCall::RejectResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
77 {
78 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
79 }
80
CombineConferenceResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)81 int32_t TelRilCall::CombineConferenceResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
82 {
83 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
84 }
85
SeparateConferenceResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)86 int32_t TelRilCall::SeparateConferenceResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
87 {
88 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
89 }
90
CallSupplementResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)91 int32_t TelRilCall::CallSupplementResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
92 {
93 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
94 }
95
GetCallWaitingResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::CallWaitResult & callWaitResult)96 int32_t TelRilCall::GetCallWaitingResponse(
97 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const HDI::Ril::V1_1::CallWaitResult &callWaitResult)
98 {
99 std::shared_ptr<CallWaitResult> callWaitInfoResult = std::make_shared<CallWaitResult>();
100 if (callWaitInfoResult == nullptr) {
101 TELEPHONY_LOGE("ERROR : callWaitInfoResult == nullptr !!!");
102 return TELEPHONY_ERR_LOCAL_PTR_NULL;
103 }
104 callWaitInfoResult->result.result = callWaitResult.result;
105 callWaitInfoResult->status = callWaitResult.status;
106 callWaitInfoResult->classCw = callWaitResult.classCw;
107 const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
108 std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
109 int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
110 if (ret != TELEPHONY_SUCCESS) {
111 return ret;
112 } else if (radioResponseInfo.error != ErrType::NONE) {
113 callWaitInfoResult->result.result = TELEPHONY_ERR_FAIL;
114 }
115 callWaitInfoResult->result.index = telRilRequest->pointer_->GetParam();
116 return TelEventHandler::SendTelEvent(
117 telRilRequest->pointer_->GetOwner(), telRilRequest->pointer_->GetInnerEventId(), callWaitInfoResult);
118 }
119
SetCallWaitingResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)120 int32_t TelRilCall::SetCallWaitingResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
121 {
122 return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
123 }
124
SetCallTransferInfoResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)125 int32_t TelRilCall::SetCallTransferInfoResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
126 {
127 return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
128 }
129
GetCallTransferInfoResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::CallForwardQueryInfoList & cFQueryList)130 int32_t TelRilCall::GetCallTransferInfoResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
131 const HDI::Ril::V1_1::CallForwardQueryInfoList &cFQueryList)
132 {
133 std::shared_ptr<CallForwardQueryInfoList> cFQueryInfoList = std::make_shared<CallForwardQueryInfoList>();
134 if (cFQueryInfoList == nullptr) {
135 TELEPHONY_LOGE("ERROR : cFQueryInfoList == nullptr !!!");
136 return TELEPHONY_ERR_LOCAL_PTR_NULL;
137 }
138 const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
139 BuildCFQueryInfoList(cFQueryInfoList, cFQueryList);
140 cFQueryInfoList->result.result = TELEPHONY_SUCCESS;
141 std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
142 int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
143 if (ret != TELEPHONY_SUCCESS) {
144 return ret;
145 } else if (radioResponseInfo.error != ErrType::NONE) {
146 cFQueryInfoList->result.result = TELEPHONY_ERR_FAIL;
147 }
148 cFQueryInfoList->result.index = telRilRequest->pointer_->GetParam();
149 return TelEventHandler::SendTelEvent(
150 telRilRequest->pointer_->GetOwner(), telRilRequest->pointer_->GetInnerEventId(), cFQueryInfoList);
151 }
152
GetClipResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::GetClipResult & getClipResult)153 int32_t TelRilCall::GetClipResponse(
154 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const HDI::Ril::V1_1::GetClipResult &getClipResult)
155 {
156 std::shared_ptr<GetClipResult> clipResult = std::make_shared<GetClipResult>();
157 if (clipResult == nullptr) {
158 TELEPHONY_LOGE("ERROR : clipResult == nullptr !!!");
159 return TELEPHONY_ERR_LOCAL_PTR_NULL;
160 }
161 clipResult->result.result = getClipResult.result;
162 clipResult->action = getClipResult.action;
163 clipResult->clipStat = getClipResult.clipStat;
164 const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
165 std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
166 int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
167 if (ret != TELEPHONY_SUCCESS) {
168 return ret;
169 } else if (radioResponseInfo.error != ErrType::NONE) {
170 clipResult->result.result = TELEPHONY_ERR_FAIL;
171 }
172 clipResult->result.index = telRilRequest->pointer_->GetParam();
173 return TelEventHandler::SendTelEvent(
174 telRilRequest->pointer_->GetOwner(), telRilRequest->pointer_->GetInnerEventId(), clipResult);
175 }
176
SetClipResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)177 int32_t TelRilCall::SetClipResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
178 {
179 return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
180 }
181
GetClirResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::GetClirResult & getClirResult)182 int32_t TelRilCall::GetClirResponse(
183 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const HDI::Ril::V1_1::GetClirResult &getClirResult)
184 {
185 std::shared_ptr<GetClirResult> result = std::make_shared<GetClirResult>();
186 if (result == nullptr) {
187 TELEPHONY_LOGE("ERROR : result == nullptr !!!");
188 return TELEPHONY_ERR_LOCAL_PTR_NULL;
189 }
190 result->result.result = getClirResult.result;
191 result->action = getClirResult.action;
192 result->clirStat = getClirResult.clirStat;
193 const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
194 std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
195 int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
196 if (ret != TELEPHONY_SUCCESS) {
197 return ret;
198 } else if (radioResponseInfo.error != ErrType::NONE) {
199 result->result.result = TELEPHONY_ERR_FAIL;
200 }
201 result->result.index = telRilRequest->pointer_->GetParam();
202 return TelEventHandler::SendTelEvent(
203 telRilRequest->pointer_->GetOwner(), telRilRequest->pointer_->GetInnerEventId(), result);
204 }
205
SetClirResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)206 int32_t TelRilCall::SetClirResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
207 {
208 return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
209 }
210
GetCallRestrictionResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::CallRestrictionResult & result)211 int32_t TelRilCall::GetCallRestrictionResponse(
212 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const HDI::Ril::V1_1::CallRestrictionResult &result)
213 {
214 std::shared_ptr<CallRestrictionResult> callRestrictionResult = std::make_shared<CallRestrictionResult>();
215 if (callRestrictionResult == nullptr) {
216 TELEPHONY_LOGE("ERROR : callRestrictionResult == nullptr !!!");
217 return TELEPHONY_ERR_LOCAL_PTR_NULL;
218 }
219 callRestrictionResult->result.result = result.result;
220 callRestrictionResult->status = result.status;
221 callRestrictionResult->classCw = result.classCw;
222 const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
223 std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
224 int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
225 if (ret != TELEPHONY_SUCCESS) {
226 return ret;
227 } else if (radioResponseInfo.error != ErrType::NONE) {
228 callRestrictionResult->result.result = TELEPHONY_ERR_FAIL;
229 }
230 callRestrictionResult->result.index = telRilRequest->pointer_->GetParam();
231 return TelEventHandler::SendTelEvent(
232 telRilRequest->pointer_->GetOwner(), telRilRequest->pointer_->GetInnerEventId(), callRestrictionResult);
233 }
234
SetCallRestrictionResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)235 int32_t TelRilCall::SetCallRestrictionResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
236 {
237 return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
238 }
239
SendDtmfResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)240 int32_t TelRilCall::SendDtmfResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
241 {
242 const auto &info = BuildHRilRadioResponseInfo(responseInfo);
243 std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(info);
244 if (telRilRequest == nullptr || telRilRequest->pointer_ == nullptr) {
245 TELEPHONY_LOGE("telRilRequest or pointer_ is nullptr!");
246 return TELEPHONY_ERR_LOCAL_PTR_NULL;
247 }
248 std::shared_ptr<RadioResponseInfo> radioResponseInfo = std::make_shared<RadioResponseInfo>();
249 radioResponseInfo->serial = responseInfo.serial;
250 radioResponseInfo->flag = telRilRequest->pointer_->GetParam();
251 radioResponseInfo->error = static_cast<ErrType>(responseInfo.error);
252 AppExecFwk::InnerEvent::Pointer response =
253 AppExecFwk::InnerEvent::Get(RadioEvent::RADIO_SEND_DTMF, radioResponseInfo, TYPE_CS);
254 const std::shared_ptr<OHOS::AppExecFwk::EventHandler> &handler = telRilRequest->pointer_->GetOwner();
255 if (handler == nullptr) {
256 TELEPHONY_LOGE("ERROR : ErrorResponse --> handler == nullptr !!!");
257 return TELEPHONY_ERR_LOCAL_PTR_NULL;
258 }
259 return TelEventHandler::SendTelEvent(handler, response);
260 }
261
StartDtmfResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)262 int32_t TelRilCall::StartDtmfResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
263 {
264 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
265 }
266
StopDtmfResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)267 int32_t TelRilCall::StopDtmfResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
268 {
269 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
270 }
271
SetCallPreferenceModeResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)272 int32_t TelRilCall::SetCallPreferenceModeResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
273 {
274 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
275 }
276
GetCallPreferenceModeResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,int32_t mode)277 int32_t TelRilCall::GetCallPreferenceModeResponse(
278 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, int32_t mode)
279 {
280 std::shared_ptr<int32_t> result = std::make_shared<int32_t>();
281 *result = mode;
282 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo, result);
283 }
284
SetUssdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)285 int32_t TelRilCall::SetUssdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
286 {
287 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
288 }
289
GetUssdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,int32_t cusd)290 int32_t TelRilCall::GetUssdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, int32_t cusd)
291 {
292 std::shared_ptr<int32_t> usdResult = std::make_shared<int32_t>();
293 *usdResult = cusd;
294 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo, usdResult);
295 }
296
SetMuteResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)297 int32_t TelRilCall::SetMuteResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
298 {
299 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
300 }
301
GetMuteResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,int32_t mute)302 int32_t TelRilCall::GetMuteResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, int32_t mute)
303 {
304 std::shared_ptr<int32_t> muteResult = std::make_shared<int32_t>();
305 *muteResult = mute;
306 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo, muteResult);
307 }
308
GetCallFailReasonResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,int32_t callFail)309 int32_t TelRilCall::GetCallFailReasonResponse(
310 const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, int32_t callFail)
311 {
312 std::shared_ptr<int32_t> failCause = std::make_shared<int32_t>();
313 *failCause = callFail;
314 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo, failCause);
315 }
316
SetBarringPasswordResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)317 int32_t TelRilCall::SetBarringPasswordResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
318 {
319 return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
320 }
321
CloseUnFinishedUssdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)322 int32_t TelRilCall::CloseUnFinishedUssdResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
323 {
324 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
325 }
326
SetVoNRSwitchResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)327 int32_t TelRilCall::SetVoNRSwitchResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
328 {
329 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
330 }
331
GetCallList(const AppExecFwk::InnerEvent::Pointer & result)332 int32_t TelRilCall::GetCallList(const AppExecFwk::InnerEvent::Pointer &result)
333 {
334 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetCallList);
335 }
336
Dial(const std::string address,int32_t clirMode,const AppExecFwk::InnerEvent::Pointer & result)337 int32_t TelRilCall::Dial(const std::string address, int32_t clirMode, const AppExecFwk::InnerEvent::Pointer &result)
338 {
339 HDI::Ril::V1_1::DialInfo dialInfo = {};
340 dialInfo.address = address;
341 dialInfo.clir = clirMode;
342 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::Dial, dialInfo);
343 }
344
Reject(const AppExecFwk::InnerEvent::Pointer & result)345 int32_t TelRilCall::Reject(const AppExecFwk::InnerEvent::Pointer &result)
346 {
347 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::Reject);
348 }
349
Hangup(int32_t gsmIndex,const AppExecFwk::InnerEvent::Pointer & result)350 int32_t TelRilCall::Hangup(int32_t gsmIndex, const AppExecFwk::InnerEvent::Pointer &result)
351 {
352 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::Hangup, gsmIndex);
353 }
354
Answer(const AppExecFwk::InnerEvent::Pointer & result)355 int32_t TelRilCall::Answer(const AppExecFwk::InnerEvent::Pointer &result)
356 {
357 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::Answer);
358 }
359
HoldCall(const AppExecFwk::InnerEvent::Pointer & result)360 int32_t TelRilCall::HoldCall(const AppExecFwk::InnerEvent::Pointer &result)
361 {
362 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::HoldCall);
363 }
364
UnHoldCall(const AppExecFwk::InnerEvent::Pointer & result)365 int32_t TelRilCall::UnHoldCall(const AppExecFwk::InnerEvent::Pointer &result)
366 {
367 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::UnHoldCall);
368 }
369
SwitchCall(const AppExecFwk::InnerEvent::Pointer & result)370 int32_t TelRilCall::SwitchCall(const AppExecFwk::InnerEvent::Pointer &result)
371 {
372 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SwitchCall);
373 }
374
CombineConference(int32_t callType,const AppExecFwk::InnerEvent::Pointer & result)375 int32_t TelRilCall::CombineConference(int32_t callType, const AppExecFwk::InnerEvent::Pointer &result)
376 {
377 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::CombineConference, callType);
378 }
379
GetCallWaiting(const AppExecFwk::InnerEvent::Pointer & result)380 int32_t TelRilCall::GetCallWaiting(const AppExecFwk::InnerEvent::Pointer &result)
381 {
382 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetCallWaiting);
383 }
384
SetCallWaiting(int32_t activate,const AppExecFwk::InnerEvent::Pointer & result)385 int32_t TelRilCall::SetCallWaiting(int32_t activate, const AppExecFwk::InnerEvent::Pointer &result)
386 {
387 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetCallWaiting, activate);
388 }
389
SeparateConference(int32_t callIndex,int32_t callType,const AppExecFwk::InnerEvent::Pointer & result)390 int32_t TelRilCall::SeparateConference(
391 int32_t callIndex, int32_t callType, const AppExecFwk::InnerEvent::Pointer &result)
392 {
393 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SeparateConference, callIndex, callType);
394 }
395
CallSupplement(int32_t type,const AppExecFwk::InnerEvent::Pointer & result)396 int32_t TelRilCall::CallSupplement(int32_t type, const AppExecFwk::InnerEvent::Pointer &result)
397 {
398 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::CallSupplement, type);
399 }
400
GetCallTransferInfo(int32_t reason,const AppExecFwk::InnerEvent::Pointer & result)401 int32_t TelRilCall::GetCallTransferInfo(int32_t reason, const AppExecFwk::InnerEvent::Pointer &result)
402 {
403 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetCallTransferInfo, reason);
404 }
405
SetCallTransferInfo(int32_t reason,int32_t mode,std::string number,int32_t classx,const AppExecFwk::InnerEvent::Pointer & result)406 int32_t TelRilCall::SetCallTransferInfo(
407 int32_t reason, int32_t mode, std::string number, int32_t classx, const AppExecFwk::InnerEvent::Pointer &result)
408 {
409 HDI::Ril::V1_1::CallForwardSetInfo callForwardSetInfo = {};
410 callForwardSetInfo.reason = reason;
411 callForwardSetInfo.mode = mode;
412 callForwardSetInfo.classx = classx;
413 callForwardSetInfo.number = number;
414 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetCallTransferInfo, callForwardSetInfo);
415 }
416
GetClip(const AppExecFwk::InnerEvent::Pointer & result)417 int32_t TelRilCall::GetClip(const AppExecFwk::InnerEvent::Pointer &result)
418 {
419 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetClip);
420 }
421
SetClip(const int32_t action,const AppExecFwk::InnerEvent::Pointer & result)422 int32_t TelRilCall::SetClip(const int32_t action, const AppExecFwk::InnerEvent::Pointer &result)
423 {
424 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetClip, action);
425 }
426
GetClir(const AppExecFwk::InnerEvent::Pointer & result)427 int32_t TelRilCall::GetClir(const AppExecFwk::InnerEvent::Pointer &result)
428 {
429 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetClir);
430 }
431
SetClir(const int32_t action,const AppExecFwk::InnerEvent::Pointer & result)432 int32_t TelRilCall::SetClir(const int32_t action, const AppExecFwk::InnerEvent::Pointer &result)
433 {
434 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetClir, action);
435 }
436
GetCallRestriction(std::string fac,const AppExecFwk::InnerEvent::Pointer & result)437 int32_t TelRilCall::GetCallRestriction(std::string fac, const AppExecFwk::InnerEvent::Pointer &result)
438 {
439 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetCallRestriction, fac);
440 }
441
SetCallRestriction(std::string restrictionType,int32_t mode,std::string password,const AppExecFwk::InnerEvent::Pointer & result)442 int32_t TelRilCall::SetCallRestriction(
443 std::string restrictionType, int32_t mode, std::string password, const AppExecFwk::InnerEvent::Pointer &result)
444 {
445 HDI::Ril::V1_1::CallRestrictionInfo callRestrictionInfo = {};
446 callRestrictionInfo.fac = restrictionType;
447 callRestrictionInfo.mode = mode;
448 callRestrictionInfo.password = password;
449 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetCallRestriction, callRestrictionInfo);
450 }
451
SendDtmfString(const std::string & sDTMFCode,int32_t index,int32_t switchOn,int32_t switchOff,const AppExecFwk::InnerEvent::Pointer & result)452 int32_t TelRilCall::SendDtmfString(const std::string &sDTMFCode, int32_t index, int32_t switchOn, int32_t switchOff,
453 const AppExecFwk::InnerEvent::Pointer &result)
454 {
455 HDI::Ril::V1_1::DtmfInfo dtmfInfo = {};
456 dtmfInfo.callId = index;
457 dtmfInfo.dtmfKey = sDTMFCode;
458 dtmfInfo.onLength = switchOn;
459 dtmfInfo.offLength = switchOff;
460 dtmfInfo.stringLength = sDTMFCode.length();
461 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SendDtmf, dtmfInfo);
462 }
463
SendDtmf(char cDTMFCode,int32_t index,const AppExecFwk::InnerEvent::Pointer & result)464 int32_t TelRilCall::SendDtmf(char cDTMFCode, int32_t index, const AppExecFwk::InnerEvent::Pointer &result)
465 {
466 char dtmfKey[2];
467 dtmfKey[0] = cDTMFCode;
468 dtmfKey[1] = '\0';
469
470 HDI::Ril::V1_1::DtmfInfo dtmfInfo = {};
471 dtmfInfo.callId = index;
472 dtmfInfo.dtmfKey = dtmfKey;
473 dtmfInfo.onLength = DTMF_ON_LENGTH;
474 dtmfInfo.offLength = DTMF_OFF_LENGTH;
475 dtmfInfo.stringLength = DTMF_STRING_LENGTH;
476 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SendDtmf, dtmfInfo);
477 }
478
StartDtmf(char cDTMFCode,int32_t index,const AppExecFwk::InnerEvent::Pointer & result)479 int32_t TelRilCall::StartDtmf(char cDTMFCode, int32_t index, const AppExecFwk::InnerEvent::Pointer &result)
480 {
481 char dtmfKey[2];
482 dtmfKey[0] = cDTMFCode;
483 dtmfKey[1] = '\0';
484
485 HDI::Ril::V1_1::DtmfInfo dtmfInfo = {};
486 dtmfInfo.callId = index;
487 dtmfInfo.dtmfKey = dtmfKey;
488 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::StartDtmf, dtmfInfo);
489 }
490
StopDtmf(int32_t index,const AppExecFwk::InnerEvent::Pointer & result)491 int32_t TelRilCall::StopDtmf(int32_t index, const AppExecFwk::InnerEvent::Pointer &result)
492 {
493 char dtmfKey[2];
494 dtmfKey[0] = 'A';
495 dtmfKey[1] = '\0';
496
497 HDI::Ril::V1_1::DtmfInfo dtmfInfo = {};
498 dtmfInfo.callId = index;
499 dtmfInfo.dtmfKey = dtmfKey;
500 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::StopDtmf, dtmfInfo);
501 }
502
SetCallPreferenceMode(const int32_t mode,const AppExecFwk::InnerEvent::Pointer & result)503 int32_t TelRilCall::SetCallPreferenceMode(const int32_t mode, const AppExecFwk::InnerEvent::Pointer &result)
504 {
505 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetCallPreferenceMode, mode);
506 }
507
GetCallPreferenceMode(const AppExecFwk::InnerEvent::Pointer & result)508 int32_t TelRilCall::GetCallPreferenceMode(const AppExecFwk::InnerEvent::Pointer &result)
509 {
510 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetCallPreferenceMode);
511 }
512
SetUssd(const std::string str,const AppExecFwk::InnerEvent::Pointer & result)513 int32_t TelRilCall::SetUssd(const std::string str, const AppExecFwk::InnerEvent::Pointer &result)
514 {
515 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetUssd, str);
516 }
517
GetUssd(const AppExecFwk::InnerEvent::Pointer & result)518 int32_t TelRilCall::GetUssd(const AppExecFwk::InnerEvent::Pointer &result)
519 {
520 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetUssd);
521 }
522
SetBarringPassword(std::string fac,const char * oldPassword,const char * newPassword,const AppExecFwk::InnerEvent::Pointer & result)523 int32_t TelRilCall::SetBarringPassword(
524 std::string fac, const char *oldPassword, const char *newPassword, const AppExecFwk::InnerEvent::Pointer &result)
525 {
526 HDI::Ril::V1_1::SetBarringInfo setBarringInfo = {};
527 setBarringInfo.fac = fac;
528 setBarringInfo.oldPassword = oldPassword;
529 setBarringInfo.newPassword = newPassword;
530 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetBarringPassword, setBarringInfo);
531 }
532
CloseUnFinishedUssd(const AppExecFwk::InnerEvent::Pointer & result)533 int32_t TelRilCall::CloseUnFinishedUssd(const AppExecFwk::InnerEvent::Pointer &result)
534 {
535 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::CloseUnFinishedUssd);
536 }
537
SetVoNRSwitch(int32_t state,const AppExecFwk::InnerEvent::Pointer & result)538 int32_t TelRilCall::SetVoNRSwitch(int32_t state, const AppExecFwk::InnerEvent::Pointer &result)
539 {
540 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetVonrSwitch, state);
541 }
542
CallStateUpdated()543 int32_t TelRilCall::CallStateUpdated()
544 {
545 return Notify(TELEPHONY_LOG_FUNC_NAME, RadioEvent::RADIO_CALL_STATUS_INFO);
546 }
547
CallUssdNotice(const HDI::Ril::V1_1::UssdNoticeInfo & ussdNoticeInfo)548 int32_t TelRilCall::CallUssdNotice(const HDI::Ril::V1_1::UssdNoticeInfo &ussdNoticeInfo)
549 {
550 std::shared_ptr<UssdNoticeInfo> ussdNotice = std::make_shared<UssdNoticeInfo>();
551 if (ussdNotice == nullptr) {
552 TELEPHONY_LOGE("ERROR : ussdNotice == nullptr !!!");
553 return TELEPHONY_ERR_LOCAL_PTR_NULL;
554 }
555 ussdNotice->m = ussdNoticeInfo.type;
556 ussdNotice->str = ussdNoticeInfo.message;
557 return Notify<UssdNoticeInfo>(TELEPHONY_LOG_FUNC_NAME, ussdNotice, RadioEvent::RADIO_CALL_USSD_NOTICE);
558 }
559
CallSsNotice(const HDI::Ril::V1_1::SsNoticeInfo & ssNoticeInfo)560 int32_t TelRilCall::CallSsNotice(const HDI::Ril::V1_1::SsNoticeInfo &ssNoticeInfo)
561 {
562 std::shared_ptr<SsNoticeInfo> ssNotice = std::make_shared<SsNoticeInfo>();
563 if (ssNotice == nullptr) {
564 TELEPHONY_LOGE("ERROR : ssNotice == nullptr !!!");
565 return TELEPHONY_ERR_LOCAL_PTR_NULL;
566 }
567 ssNotice->serviceType = ssNoticeInfo.serviceType;
568 ssNotice->requestType = ssNoticeInfo.requestType;
569 ssNotice->serviceClass = ssNoticeInfo.serviceClass;
570 ssNotice->result = ssNoticeInfo.result;
571 return Notify<SsNoticeInfo>(TELEPHONY_LOG_FUNC_NAME, ssNotice, RadioEvent::RADIO_CALL_SS_NOTICE);
572 }
573
CallRingbackVoiceNotice(const HDI::Ril::V1_1::RingbackVoice & ringbackVoice)574 int32_t TelRilCall::CallRingbackVoiceNotice(const HDI::Ril::V1_1::RingbackVoice &ringbackVoice)
575 {
576 std::shared_ptr<RingbackVoice> ringbackVoiceInfo = std::make_shared<RingbackVoice>();
577 if (ringbackVoiceInfo == nullptr) {
578 TELEPHONY_LOGE("ERROR : ringbackVoiceInfo == nullptr !!!");
579 return TELEPHONY_ERR_LOCAL_PTR_NULL;
580 }
581 ringbackVoiceInfo->status = !ringbackVoice.status;
582 return Notify<RingbackVoice>(TELEPHONY_LOG_FUNC_NAME, ringbackVoiceInfo, RadioEvent::RADIO_CALL_RINGBACK_VOICE);
583 }
584
CallSrvccStatusNotice(const HDI::Ril::V1_1::SrvccStatus & srvccStatus)585 int32_t TelRilCall::CallSrvccStatusNotice(const HDI::Ril::V1_1::SrvccStatus &srvccStatus)
586 {
587 std::shared_ptr<SrvccStatus> srvccStatusInfo = std::make_shared<SrvccStatus>();
588 if (srvccStatusInfo == nullptr) {
589 TELEPHONY_LOGE("ERROR : srvccStatusInfo == nullptr !!!");
590 return TELEPHONY_ERR_LOCAL_PTR_NULL;
591 }
592 srvccStatusInfo->status = srvccStatus.status;
593 return Notify<SrvccStatus>(TELEPHONY_LOG_FUNC_NAME, srvccStatusInfo, RadioEvent::RADIO_CALL_SRVCC_STATUS);
594 }
595
CallRsrvccStatusNotify()596 int32_t TelRilCall::CallRsrvccStatusNotify()
597 {
598 return Notify(TELEPHONY_LOG_FUNC_NAME, RadioEvent::RADIO_CALL_RSRVCC_STATUS);
599 }
600
SetMute(const int32_t mute,const AppExecFwk::InnerEvent::Pointer & result)601 int32_t TelRilCall::SetMute(const int32_t mute, const AppExecFwk::InnerEvent::Pointer &result)
602 {
603 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetMute, mute);
604 }
605
GetMute(const AppExecFwk::InnerEvent::Pointer & result)606 int32_t TelRilCall::GetMute(const AppExecFwk::InnerEvent::Pointer &result)
607 {
608 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetMute);
609 }
610
GetEmergencyCallList(const AppExecFwk::InnerEvent::Pointer & result)611 int32_t TelRilCall::GetEmergencyCallList(const AppExecFwk::InnerEvent::Pointer &result)
612 {
613 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetEmergencyCallList);
614 }
615
SetEmergencyCallList(const std::vector<EmergencyCall> & eccVec,const AppExecFwk::InnerEvent::Pointer & result)616 int32_t TelRilCall::SetEmergencyCallList(
617 const std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &result)
618 {
619 HDI::Ril::V1_1::EmergencyInfoList emergencyInfoList;
620 emergencyInfoList.callSize = static_cast<int32_t>(eccVec.size());
621 int index = 1;
622 for (EmergencyCall ecc : eccVec) {
623 HDI::Ril::V1_1::EmergencyCall emergencyCall = {};
624 emergencyCall.index = index;
625 emergencyCall.total = eccVec.size();
626 emergencyCall.eccNum = ecc.eccNum;
627 emergencyCall.eccType = (HDI::Ril::V1_1::EccType)(ecc.eccType);
628 emergencyCall.simpresent = (HDI::Ril::V1_1::SimpresentType)(ecc.simpresent);
629 emergencyCall.mcc = ecc.mcc;
630 emergencyCall.abnormalService = (HDI::Ril::V1_1::AbnormalServiceType)(ecc.abnormalService);
631 index++;
632 emergencyInfoList.calls.push_back(emergencyCall);
633 }
634 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::SetEmergencyCallList, emergencyInfoList);
635 }
636
SetEmergencyCallListResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo)637 int32_t TelRilCall::SetEmergencyCallListResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo)
638 {
639 return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
640 }
641
GetEmergencyCallListResponse(const HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo,const HDI::Ril::V1_1::EmergencyInfoList & emergencyInfoList)642 int32_t TelRilCall::GetEmergencyCallListResponse(const HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo,
643 const HDI::Ril::V1_1::EmergencyInfoList &emergencyInfoList)
644 {
645 std::shared_ptr<EmergencyInfoList> emergencyCallList = std::make_shared<EmergencyInfoList>();
646 if (emergencyCallList == nullptr) {
647 TELEPHONY_LOGE("ERROR : callInfo == nullptr !!!");
648 return TELEPHONY_ERR_LOCAL_PTR_NULL;
649 }
650 BuildEmergencyInfoList(emergencyCallList, emergencyInfoList);
651 return Response<EmergencyInfoList>(TELEPHONY_LOG_FUNC_NAME, responseInfo, emergencyCallList);
652 }
653
GetCallFailReason(const AppExecFwk::InnerEvent::Pointer & result)654 int32_t TelRilCall::GetCallFailReason(const AppExecFwk::InnerEvent::Pointer &result)
655 {
656 return Request(TELEPHONY_LOG_FUNC_NAME, result, &HDI::Ril::V1_1::IRil::GetCallFailReason);
657 }
658
CallEmergencyNotice(const HDI::Ril::V1_1::EmergencyInfoList & emergencyInfoList)659 int32_t TelRilCall::CallEmergencyNotice(const HDI::Ril::V1_1::EmergencyInfoList &emergencyInfoList)
660 {
661 std::shared_ptr<EmergencyInfoList> emergencyCallInfoList = std::make_shared<EmergencyInfoList>();
662 BuildEmergencyInfoList(emergencyCallInfoList, emergencyInfoList);
663 return Notify<EmergencyInfoList>(
664 TELEPHONY_LOG_FUNC_NAME, emergencyCallInfoList, RadioEvent::RADIO_CALL_EMERGENCY_NUMBER_REPORT);
665 }
666
BuildEmergencyInfoList(std::shared_ptr<EmergencyInfoList> emergencyCallList,const HDI::Ril::V1_1::EmergencyInfoList & emergencyInfoList)667 void TelRilCall::BuildEmergencyInfoList(
668 std::shared_ptr<EmergencyInfoList> emergencyCallList, const HDI::Ril::V1_1::EmergencyInfoList &emergencyInfoList)
669 {
670 emergencyCallList->callSize = emergencyInfoList.callSize;
671 for (auto ecc : emergencyInfoList.calls) {
672 EmergencyInfo call;
673 call.index = ecc.index;
674 call.total = ecc.total;
675 call.eccNum = ecc.eccNum;
676 call.category = ecc.simpresent;
677 call.mcc = ecc.mcc;
678 call.abnormalService = ecc.abnormalService;
679 emergencyCallList->calls.push_back(call);
680 }
681 }
682
BuildCallInfoList(std::shared_ptr<CallInfoList> callInfoList,const HDI::Ril::V1_1::CallInfoList & iCallInfoList)683 void TelRilCall::BuildCallInfoList(
684 std::shared_ptr<CallInfoList> callInfoList, const HDI::Ril::V1_1::CallInfoList &iCallInfoList)
685 {
686 callInfoList->callSize = iCallInfoList.callSize;
687 for (auto info : iCallInfoList.calls) {
688 CallInfo call;
689 call.index = info.index;
690 call.dir = info.dir;
691 call.state = info.state;
692 call.mode = info.mode;
693 call.mpty = info.mpty;
694 call.voiceDomain = info.voiceDomain;
695 call.callType = info.callType;
696 call.number = info.number;
697 call.type = info.type;
698 call.alpha = info.alpha;
699 callInfoList->calls.push_back(call);
700 }
701 }
702
BuildCFQueryInfoList(std::shared_ptr<CallForwardQueryInfoList> cFQueryInfoList,const HDI::Ril::V1_1::CallForwardQueryInfoList & cFQueryList)703 void TelRilCall::BuildCFQueryInfoList(std::shared_ptr<CallForwardQueryInfoList> cFQueryInfoList,
704 const HDI::Ril::V1_1::CallForwardQueryInfoList &cFQueryList)
705 {
706 cFQueryInfoList->callSize = cFQueryList.callSize;
707 for (auto info : cFQueryList.calls) {
708 CallForwardQueryResult call;
709 call.serial = info.serial;
710 call.result = info.result;
711 call.status = info.status;
712 call.classx = info.classx;
713 call.number = info.number;
714 call.type = info.type;
715 call.reason = info.reason;
716 call.time = info.time;
717 cFQueryInfoList->calls.push_back(call);
718 }
719 }
720
ResponseSupplement(const char * funcName,const HDI::Ril::V1_1::RilRadioResponseInfo & iResponseInfo)721 int32_t TelRilCall::ResponseSupplement(const char *funcName, const HDI::Ril::V1_1::RilRadioResponseInfo &iResponseInfo)
722 {
723 const auto &radioResponseInfo = BuildHRilRadioResponseInfo(iResponseInfo);
724 auto telRilRequest = FindTelRilRequest(radioResponseInfo);
725 int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
726 if (ret != TELEPHONY_SUCCESS) {
727 return ret;
728 }
729 auto resultInfo = std::make_shared<SsBaseResult>();
730 resultInfo->index = telRilRequest->pointer_->GetParam();
731 resultInfo->result = TELEPHONY_SUCCESS;
732 if (radioResponseInfo.error != ErrType::NONE) {
733 resultInfo->result = TELEPHONY_ERR_FAIL;
734 }
735 return TelEventHandler::SendTelEvent(
736 telRilRequest->pointer_->GetOwner(), telRilRequest->pointer_->GetInnerEventId(), resultInfo);
737 }
738 } // namespace Telephony
739 } // namespace OHOS
740