1 /*
2 * Copyright (C) 2021 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 "ims_callback_stub.h"
17
18 #include "cellular_call_register.h"
19 #include "cellular_call_service.h"
20 #include "radio_event.h"
21 #include "telephony_log_wrapper.h"
22 #include "telephony_errors.h"
23
24 namespace OHOS {
25 namespace Telephony {
ImsCallbackStub()26 ImsCallbackStub::ImsCallbackStub()
27 {
28 TELEPHONY_LOGI("ImsCallbackStub");
29 InitBasicCallFuncMap();
30 InitSupportCallFuncMap();
31 }
32
InitBasicCallFuncMap()33 void ImsCallbackStub::InitBasicCallFuncMap()
34 {
35 requestFuncMap_[UPDATE_IMS_DIAL] = &ImsCallbackStub::OnUpdateDialResponseInner;
36 requestFuncMap_[UPDATE_IMS_HANG_UP] = &ImsCallbackStub::OnUpdateHangUpResponseInner;
37 requestFuncMap_[UPDATE_IMS_REJECT] = &ImsCallbackStub::OnUpdateRejectResponseInner;
38 requestFuncMap_[UPDATE_IMS_ANSWER] = &ImsCallbackStub::OnUpdateAnswerResponseInner;
39 requestFuncMap_[UPDATE_IMS_HOLD] = &ImsCallbackStub::OnUpdateHoldResponseInner;
40 requestFuncMap_[UPDATE_IMS_UN_HOLD] = &ImsCallbackStub::OnUpdateUnHoldResponseInner;
41 requestFuncMap_[UPDATE_IMS_SWITCH] = &ImsCallbackStub::OnUpdateSwitchResponseInner;
42 requestFuncMap_[UPDATE_IMS_COMBINE_CONFERENCE] = &ImsCallbackStub::OnUpdateCombineConferenceResponseInner;
43 requestFuncMap_[UPDATE_IMS_INVITE_TO_CONFERENCE] = &ImsCallbackStub::OnUpdateInviteToConferenceResponseInner;
44 requestFuncMap_[UPDATE_IMS_KICK_OUT_CONFERENCE] = &ImsCallbackStub::OnUpdateKickOutFromConferenceResponseInner;
45 requestFuncMap_[UPDATE_IMS_UPDATE_CALL_MEDIA_MODE] = &ImsCallbackStub::OnUpdateCallMediaModeResponseInner;
46 requestFuncMap_[UPDATE_IMS_EMERGENCY_CALL] = &ImsCallbackStub::OnUpdateIsEmergencyNumberResponseInner;
47 requestFuncMap_[UPDATE_IMS_START_DTMF] = &ImsCallbackStub::OnUpdateStartDtmfResponseInner;
48 requestFuncMap_[UPDATE_IMS_SEND_DTMF] = &ImsCallbackStub::OnUpdateSendDtmfResponseInner;
49 requestFuncMap_[UPDATE_IMS_STOP_DTMF] = &ImsCallbackStub::OnUpdateStopDtmfResponseInner;
50 requestFuncMap_[UPDATE_START_RTT] = &ImsCallbackStub::OnUpdateStartRttResponseInner;
51 requestFuncMap_[UPDATE_STOP_RTT] = &ImsCallbackStub::OnUpdateStopRttResponseInner;
52 requestFuncMap_[UPDATE_IMS_CALL_STATUS] = &ImsCallbackStub::OnUpdateCallStatusResponseInner;
53 requestFuncMap_[UPDATE_IMS_SERVICE_STATUS] = &ImsCallbackStub::OnUpdateServiceStatusResponseInner;
54 }
55
InitSupportCallFuncMap()56 void ImsCallbackStub::InitSupportCallFuncMap()
57 {
58 requestFuncMap_[UPDATE_IMS_SET_PRE_MODE] = &ImsCallbackStub::OnUpdateSetPreModeResponseInner;
59 requestFuncMap_[UPDATE_IMS_GET_PRE_MODE] = &ImsCallbackStub::OnUpdateGetPreModeResponseInner;
60 requestFuncMap_[UPDATE_IMS_SET_LTE_SWITCH] = &ImsCallbackStub::OnUpdateSetImsSwitchResponseInner;
61 requestFuncMap_[UPDATE_IMS_GET_LTE_SWITCH] = &ImsCallbackStub::OnUpdateGetImsSwitchResponseInner;
62 requestFuncMap_[UPDATE_IMS_GET_CALLS_DATA] = &ImsCallbackStub::OnUpdateImsCallsDataResponseInner;
63 requestFuncMap_[UPDATE_SET_CONFIG] = &ImsCallbackStub::OnUpdateSetImsConfigResponseInner;
64 requestFuncMap_[UPDATE_GET_CONFIG] = &ImsCallbackStub::OnUpdateGetImsConfigResponseInner;
65 requestFuncMap_[UPDATE_SET_FEATURE] = &ImsCallbackStub::OnUpdateSetImsFeatureResponseInner;
66 requestFuncMap_[UPDATE_GET_FEATURE] = &ImsCallbackStub::OnUpdateGetImsFeatureResponseInner;
67 requestFuncMap_[UPDATE_SET_IMS_SWITCH_ENHANCE] = &ImsCallbackStub::OnUpdateSetImsSwitchEnhanceModeResponseInner;
68 requestFuncMap_[UPDATE_GET_IMS_SWITCH_ENHANCE] = &ImsCallbackStub::OnUpdateGetImsSwitchEnhanceModeResponseInner;
69 requestFuncMap_[UPDATE_CONTROL_CAMERA] = &ImsCallbackStub::OnUpdateCtrlCameraResponseInner;
70 requestFuncMap_[UPDATE_SET_PREVIEW_WINDOW] = &ImsCallbackStub::OnUpdateSetPreviewWindowResponseInner;
71 requestFuncMap_[UPDATE_SET_DISPLAY_WINDOW] = &ImsCallbackStub::OnUpdateSetDisplayWindowResponseInner;
72 requestFuncMap_[UPDATE_SET_CAMERA_ZOOM] = &ImsCallbackStub::OnUpdateSetCameraZoomResponseInner;
73 requestFuncMap_[UPDATE_SET_PAUSE_IMAGE] = &ImsCallbackStub::OnUpdateSetPauseImageResponseInner;
74 requestFuncMap_[UPDATE_SET_DEVICE_DIRECTION] = &ImsCallbackStub::OnUpdateSetDeviceDirectionResponseInner;
75 requestFuncMap_[UPDATE_SRVCC_STATE] = &ImsCallbackStub::OnUpdateSrvccStateReportInner;
76 requestFuncMap_[UPDATE_VT_OR_WFC] = &ImsCallbackStub::OnUpdateVtWfcReportInner;
77 requestFuncMap_[UPDATE_CALL_CRING] = &ImsCallbackStub::OnUpdateCallRingBackResponseInner;
78 requestFuncMap_[UPDATE_SET_MUTE] = &ImsCallbackStub::OnUpdateSetMuteResponseInner;
79 requestFuncMap_[UPDATE_GET_MUTE] = &ImsCallbackStub::OnUpdateGetMuteResponseInner;
80 requestFuncMap_[UPDATE_GET_EMERGENCY_CALL_LIST] = &ImsCallbackStub::OnUpdateGetEccListResponseInner;
81 requestFuncMap_[UPDATE_CALL_FAIL_REASON] = &ImsCallbackStub::OnUpdateCallFailReasonResponseInner;
82 requestFuncMap_[UPDATE_GET_CALL_CLIP] = &ImsCallbackStub::OnUpdateGetClipResponseInner;
83 requestFuncMap_[UPDATE_GET_CALL_CLIR] = &ImsCallbackStub::OnUpdateGetClirResponseInner;
84 requestFuncMap_[UPDATE_SET_CALL_CLIR] = &ImsCallbackStub::OnUpdateSetClirResponseInner;
85 requestFuncMap_[UPDATE_GET_CALL_FORWARD] = &ImsCallbackStub::OnUpdateGetCallTransferResponseInner;
86 requestFuncMap_[UPDATE_SET_CALL_FORWARD] = &ImsCallbackStub::OnUpdateSetCallTransferResponseInner;
87 requestFuncMap_[UPDATE_GET_CALL_RESTRICTION] = &ImsCallbackStub::OnUpdateGetCallRestrictionResponseInner;
88 requestFuncMap_[UPDATE_SET_CALL_RESTRICTION] = &ImsCallbackStub::OnUpdateSetCallRestrictionResponseInner;
89 requestFuncMap_[UPDATE_GET_CALL_WAIT] = &ImsCallbackStub::OnUpdateGetCallWaitingResponseInner;
90 requestFuncMap_[UPDATE_SET_CALL_WAIT] = &ImsCallbackStub::OnUpdateSetCallWaitingResponseInner;
91 }
92
~ImsCallbackStub()93 ImsCallbackStub::~ImsCallbackStub()
94 {
95 requestFuncMap_.clear();
96 }
97
OnRemoteRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)98 int32_t ImsCallbackStub::OnRemoteRequest(
99 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
100 {
101 std::u16string myDescriptor = ImsCallbackStub::GetDescriptor();
102 std::u16string remoteDescriptor = data.ReadInterfaceToken();
103 if (myDescriptor != remoteDescriptor) {
104 TELEPHONY_LOGE("OnRemoteRequest return, descriptor checked fail");
105 return TELEPHONY_ERR_DESCRIPTOR_MISMATCH;
106 }
107 auto itFunc = requestFuncMap_.find(code);
108 if (itFunc != requestFuncMap_.end()) {
109 auto requestFunc = itFunc->second;
110 if (requestFunc != nullptr) {
111 return (this->*requestFunc)(data, reply);
112 }
113 }
114 TELEPHONY_LOGI("ImsCallbackStub::OnRemoteRequest, default case, need check.");
115 return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
116 }
117
OnUpdateDialResponseInner(MessageParcel & data,MessageParcel & reply)118 int32_t ImsCallbackStub::OnUpdateDialResponseInner(MessageParcel &data, MessageParcel &reply)
119 {
120 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateDialResponseInner entry");
121 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
122 if (info == nullptr) {
123 TELEPHONY_LOGE("OnUpdateDialResponseInner return, info is nullptr.");
124 return TELEPHONY_ERR_ARGUMENT_INVALID;
125 }
126 reply.WriteInt32(UpdateDialResponse(*info));
127 return TELEPHONY_SUCCESS;
128 }
129
OnUpdateHangUpResponseInner(MessageParcel & data,MessageParcel & reply)130 int32_t ImsCallbackStub::OnUpdateHangUpResponseInner(MessageParcel &data, MessageParcel &reply)
131 {
132 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateHangUpResponseInner entry");
133 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
134 if (info == nullptr) {
135 TELEPHONY_LOGE("OnUpdateHangUpResponseInner return, info is nullptr.");
136 return TELEPHONY_ERR_ARGUMENT_INVALID;
137 }
138 reply.WriteInt32(UpdateHangUpResponse(*info));
139 return TELEPHONY_SUCCESS;
140 }
141
OnUpdateRejectResponseInner(MessageParcel & data,MessageParcel & reply)142 int32_t ImsCallbackStub::OnUpdateRejectResponseInner(MessageParcel &data, MessageParcel &reply)
143 {
144 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateRejectResponseInner entry");
145 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
146 if (info == nullptr) {
147 TELEPHONY_LOGE("OnUpdateRejectResponseInner return, info is nullptr.");
148 return TELEPHONY_ERR_ARGUMENT_INVALID;
149 }
150 reply.WriteInt32(UpdateRejectResponse(*info));
151 return TELEPHONY_SUCCESS;
152 }
153
OnUpdateAnswerResponseInner(MessageParcel & data,MessageParcel & reply)154 int32_t ImsCallbackStub::OnUpdateAnswerResponseInner(MessageParcel &data, MessageParcel &reply)
155 {
156 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateAnswerResponseInner entry");
157 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
158 if (info == nullptr) {
159 TELEPHONY_LOGE("OnUpdateAnswerResponseInner return, info is nullptr.");
160 return TELEPHONY_ERR_ARGUMENT_INVALID;
161 }
162 reply.WriteInt32(UpdateAnswerResponse(*info));
163 return TELEPHONY_SUCCESS;
164 }
165
OnUpdateHoldResponseInner(MessageParcel & data,MessageParcel & reply)166 int32_t ImsCallbackStub::OnUpdateHoldResponseInner(MessageParcel &data, MessageParcel &reply)
167 {
168 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateHoldResponseInner entry");
169 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
170 if (info == nullptr) {
171 TELEPHONY_LOGE("OnUpdateHoldResponseInner return, info is nullptr.");
172 return TELEPHONY_ERR_ARGUMENT_INVALID;
173 }
174 reply.WriteInt32(UpdateHoldResponse(*info));
175 return TELEPHONY_SUCCESS;
176 }
177
OnUpdateUnHoldResponseInner(MessageParcel & data,MessageParcel & reply)178 int32_t ImsCallbackStub::OnUpdateUnHoldResponseInner(MessageParcel &data, MessageParcel &reply)
179 {
180 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateUnHoldResponseInner entry");
181 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
182 if (info == nullptr) {
183 TELEPHONY_LOGE("OnUpdateUnHoldResponseInner return, info is nullptr.");
184 return TELEPHONY_ERR_ARGUMENT_INVALID;
185 }
186 reply.WriteInt32(UpdateUnHoldResponse(*info));
187 return TELEPHONY_SUCCESS;
188 }
189
OnUpdateSwitchResponseInner(MessageParcel & data,MessageParcel & reply)190 int32_t ImsCallbackStub::OnUpdateSwitchResponseInner(MessageParcel &data, MessageParcel &reply)
191 {
192 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSwitchResponseInner entry");
193 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
194 if (info == nullptr) {
195 TELEPHONY_LOGE("OnUpdateSwitchResponseInner return, info is nullptr.");
196 return TELEPHONY_ERR_ARGUMENT_INVALID;
197 }
198 reply.WriteInt32(UpdateSwitchResponse(*info));
199 return TELEPHONY_SUCCESS;
200 }
201
OnUpdateCombineConferenceResponseInner(MessageParcel & data,MessageParcel & reply)202 int32_t ImsCallbackStub::OnUpdateCombineConferenceResponseInner(MessageParcel &data, MessageParcel &reply)
203 {
204 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateCombineConferenceResponseInner entry");
205 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
206 if (info == nullptr) {
207 TELEPHONY_LOGE("OnUpdateCombineConferenceResponseInner return, info is nullptr.");
208 return TELEPHONY_ERR_ARGUMENT_INVALID;
209 }
210 reply.WriteInt32(UpdateCombineConferenceResponse(*info));
211 return TELEPHONY_SUCCESS;
212 }
213
OnUpdateInviteToConferenceResponseInner(MessageParcel & data,MessageParcel & reply)214 int32_t ImsCallbackStub::OnUpdateInviteToConferenceResponseInner(MessageParcel &data, MessageParcel &reply)
215 {
216 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateInviteToConferenceResponseInner entry");
217 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
218 if (info == nullptr) {
219 TELEPHONY_LOGE("OnUpdateInviteToConferenceResponseInner return, info is nullptr.");
220 return TELEPHONY_ERR_ARGUMENT_INVALID;
221 }
222 reply.WriteInt32(UpdateInviteToConferenceResponse(*info));
223 return TELEPHONY_SUCCESS;
224 }
225
OnUpdateKickOutFromConferenceResponseInner(MessageParcel & data,MessageParcel & reply)226 int32_t ImsCallbackStub::OnUpdateKickOutFromConferenceResponseInner(MessageParcel &data, MessageParcel &reply)
227 {
228 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateKickOutFromConferenceResponseInner entry");
229 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
230 if (info == nullptr) {
231 TELEPHONY_LOGE("OnUpdateKickOutFromConferenceResponseInner return, info is nullptr.");
232 return TELEPHONY_ERR_ARGUMENT_INVALID;
233 }
234 reply.WriteInt32(UpdateKickOutFromConferenceResponse(*info));
235 return TELEPHONY_SUCCESS;
236 }
237
OnUpdateCallMediaModeResponseInner(MessageParcel & data,MessageParcel & reply)238 int32_t ImsCallbackStub::OnUpdateCallMediaModeResponseInner(MessageParcel &data, MessageParcel &reply)
239 {
240 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateCallMediaModeResponseInner entry");
241 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
242 if (info == nullptr) {
243 TELEPHONY_LOGE("OnUpdateCallMediaModeResponseInner return, info is nullptr.");
244 return TELEPHONY_ERR_ARGUMENT_INVALID;
245 }
246 reply.WriteInt32(UpdateCallMediaModeResponse(*info));
247 return TELEPHONY_SUCCESS;
248 }
249
OnUpdateIsEmergencyNumberResponseInner(MessageParcel & data,MessageParcel & reply)250 int32_t ImsCallbackStub::OnUpdateIsEmergencyNumberResponseInner(MessageParcel &data, MessageParcel &reply)
251 {
252 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateIsEmergencyNumberResponseInner entry");
253 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
254 if (info == nullptr) {
255 TELEPHONY_LOGI("OnUpdateIsEmergencyNumberResponseInner, can not to get info.");
256 bool value = data.ReadBool();
257 reply.WriteInt32(UpdateIsEmergencyPhoneNumberResponse(value));
258 return TELEPHONY_SUCCESS;
259 }
260 reply.WriteInt32(UpdateIsEmergencyPhoneNumberResponse(*info));
261 return TELEPHONY_SUCCESS;
262 }
263
OnUpdateStartDtmfResponseInner(MessageParcel & data,MessageParcel & reply)264 int32_t ImsCallbackStub::OnUpdateStartDtmfResponseInner(MessageParcel &data, MessageParcel &reply)
265 {
266 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateStartDtmfResponseInner entry");
267 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
268 if (info == nullptr) {
269 TELEPHONY_LOGE("OnUpdateStartDtmfResponseInner return, info is nullptr.");
270 return TELEPHONY_ERR_ARGUMENT_INVALID;
271 }
272 reply.WriteInt32(UpdateStartDtmfResponse(*info));
273 return TELEPHONY_SUCCESS;
274 }
275
OnUpdateSendDtmfResponseInner(MessageParcel & data,MessageParcel & reply)276 int32_t ImsCallbackStub::OnUpdateSendDtmfResponseInner(MessageParcel &data, MessageParcel &reply)
277 {
278 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSendDtmfResponseInner entry");
279 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
280 if (info == nullptr) {
281 TELEPHONY_LOGE("OnUpdateSendDtmfResponseInner return, info is nullptr.");
282 return TELEPHONY_ERR_ARGUMENT_INVALID;
283 }
284 reply.WriteInt32(UpdateSendDtmfResponse(*info));
285 return TELEPHONY_SUCCESS;
286 }
287
OnUpdateStopDtmfResponseInner(MessageParcel & data,MessageParcel & reply)288 int32_t ImsCallbackStub::OnUpdateStopDtmfResponseInner(MessageParcel &data, MessageParcel &reply)
289 {
290 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateStopDtmfResponseInner entry");
291 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
292 if (info == nullptr) {
293 TELEPHONY_LOGE("OnUpdateStopDtmfResponseInner return, info is nullptr.");
294 return TELEPHONY_ERR_ARGUMENT_INVALID;
295 }
296 reply.WriteInt32(UpdateStopDtmfResponse(*info));
297 return TELEPHONY_SUCCESS;
298 }
299
OnUpdateStartRttResponseInner(MessageParcel & data,MessageParcel & reply)300 int32_t ImsCallbackStub::OnUpdateStartRttResponseInner(MessageParcel &data, MessageParcel &reply)
301 {
302 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateStartRttResponseInner entry");
303 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
304 if (info == nullptr) {
305 TELEPHONY_LOGE("OnUpdateStartRttResponseInner return, info is nullptr.");
306 return TELEPHONY_ERR_ARGUMENT_INVALID;
307 }
308 reply.WriteInt32(UpdateStartRttResponse(*info));
309 return TELEPHONY_SUCCESS;
310 }
311
OnUpdateStopRttResponseInner(MessageParcel & data,MessageParcel & reply)312 int32_t ImsCallbackStub::OnUpdateStopRttResponseInner(MessageParcel &data, MessageParcel &reply)
313 {
314 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateStopRttResponseInner entry");
315 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
316 if (info == nullptr) {
317 TELEPHONY_LOGE("OnUpdateStopRttResponseInner return, info is nullptr.");
318 return TELEPHONY_ERR_ARGUMENT_INVALID;
319 }
320 reply.WriteInt32(UpdateStopRttResponse(*info));
321 return TELEPHONY_SUCCESS;
322 }
323
OnUpdateCallStatusResponseInner(MessageParcel & data,MessageParcel & reply)324 int32_t ImsCallbackStub::OnUpdateCallStatusResponseInner(MessageParcel &data, MessageParcel &reply)
325 {
326 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateCallStatusResponseInner entry");
327 int32_t slotId = data.ReadInt32();
328 reply.WriteInt32(UpdateCallStatusResponse(slotId));
329 return TELEPHONY_SUCCESS;
330 }
331
OnUpdateServiceStatusResponseInner(MessageParcel & data,MessageParcel & reply)332 int32_t ImsCallbackStub::OnUpdateServiceStatusResponseInner(MessageParcel &data, MessageParcel &reply)
333 {
334 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateServiceStatusResponseInner entry");
335 int32_t slotId = data.ReadInt32();
336 auto info = (CallImsServiceStatus *)data.ReadRawData(sizeof(CallImsServiceStatus));
337 if (info == nullptr) {
338 TELEPHONY_LOGE("OnUpdateServiceStatusResponseInner return, info is nullptr.");
339 return TELEPHONY_ERR_ARGUMENT_INVALID;
340 }
341 reply.WriteInt32(UpdateServiceStatusResponse(slotId, *info));
342 return TELEPHONY_SUCCESS;
343 }
344
OnUpdateSetPreModeResponseInner(MessageParcel & data,MessageParcel & reply)345 int32_t ImsCallbackStub::OnUpdateSetPreModeResponseInner(MessageParcel &data, MessageParcel &reply)
346 {
347 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetPreModeResponseInner entry");
348 int32_t slotId = data.ReadInt32();
349 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
350 if (info == nullptr) {
351 TELEPHONY_LOGE("OnUpdateSetPreModeResponseInner return, info is nullptr.");
352 return TELEPHONY_ERR_ARGUMENT_INVALID;
353 }
354 reply.WriteInt32(UpdateSetPreModeResponse(slotId, *info));
355 return TELEPHONY_SUCCESS;
356 }
357
OnUpdateGetPreModeResponseInner(MessageParcel & data,MessageParcel & reply)358 int32_t ImsCallbackStub::OnUpdateGetPreModeResponseInner(MessageParcel &data, MessageParcel &reply)
359 {
360 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetPreModeResponseInner entry");
361 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
362 if (info == nullptr) {
363 TELEPHONY_LOGE("OnUpdateGetPreModeResponseInner, info is nullptr.");
364 int32_t slotId = data.ReadInt32();
365 int32_t mode = data.ReadInt32();
366 reply.WriteInt32(UpdateGetPreModeResponse(slotId, mode));
367 return TELEPHONY_SUCCESS;
368 }
369 reply.WriteInt32(UpdateGetPreModeResponse(*info));
370 return TELEPHONY_SUCCESS;
371 }
372
OnUpdateSetImsSwitchResponseInner(MessageParcel & data,MessageParcel & reply)373 int32_t ImsCallbackStub::OnUpdateSetImsSwitchResponseInner(MessageParcel &data, MessageParcel &reply)
374 {
375 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetImsSwitchResponseInner entry");
376 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
377 if (info == nullptr) {
378 TELEPHONY_LOGE("OnUpdateSetImsSwitchResponseInner return, info is nullptr.");
379 return TELEPHONY_ERR_ARGUMENT_INVALID;
380 }
381 reply.WriteInt32(UpdateSetImsSwitchResponse(*info));
382 return TELEPHONY_SUCCESS;
383 }
384
OnUpdateGetImsSwitchResponseInner(MessageParcel & data,MessageParcel & reply)385 int32_t ImsCallbackStub::OnUpdateGetImsSwitchResponseInner(MessageParcel &data, MessageParcel &reply)
386 {
387 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetImsSwitchResponseInner entry");
388 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
389 if (info == nullptr) {
390 TELEPHONY_LOGE("OnUpdateGetImsSwitchResponseInner, info is nullptr.");
391 int32_t slotId = data.ReadInt32();
392 int32_t active = data.ReadInt32();
393 reply.WriteInt32(UpdateGetImsSwitchResponse(slotId, active));
394 return TELEPHONY_SUCCESS;
395 }
396 reply.WriteInt32(UpdateGetImsSwitchResponse(*info));
397 return TELEPHONY_SUCCESS;
398 }
399
OnUpdateImsCallsDataResponseInner(MessageParcel & data,MessageParcel & reply)400 int32_t ImsCallbackStub::OnUpdateImsCallsDataResponseInner(MessageParcel &data, MessageParcel &reply)
401 {
402 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateImsCallsDataResponseInner entry");
403 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
404 if (info == nullptr) {
405 TELEPHONY_LOGE("OnUpdateImsCallsDataResponseInner, info is nullptr.");
406 int32_t slotId = data.ReadInt32();
407 auto callList = (CallInfoList *)data.ReadRawData(sizeof(CallInfoList));
408 if (callList == nullptr) {
409 TELEPHONY_LOGE("OnUpdateImsCallsDataResponseInner, callList is nullptr.");
410 return TELEPHONY_ERR_ARGUMENT_INVALID;
411 }
412 reply.WriteInt32(UpdateImsCallsDataResponse(slotId, *callList));
413 return TELEPHONY_SUCCESS;
414 }
415 reply.WriteInt32(UpdateImsCallsDataResponse(*info));
416 return TELEPHONY_SUCCESS;
417 }
418
OnUpdateSetImsConfigResponseInner(MessageParcel & data,MessageParcel & reply)419 int32_t ImsCallbackStub::OnUpdateSetImsConfigResponseInner(MessageParcel &data, MessageParcel &reply)
420 {
421 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetImsConfigResponseInner entry");
422 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
423 if (info == nullptr) {
424 TELEPHONY_LOGE("OnUpdateSetImsConfigResponseInner return, info is nullptr.");
425 return TELEPHONY_ERR_ARGUMENT_INVALID;
426 }
427 reply.WriteInt32(UpdateSetImsConfigResponse(*info));
428 return TELEPHONY_SUCCESS;
429 }
430
OnUpdateGetImsConfigResponseInner(MessageParcel & data,MessageParcel & reply)431 int32_t ImsCallbackStub::OnUpdateGetImsConfigResponseInner(MessageParcel &data, MessageParcel &reply)
432 {
433 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetImsConfigResponseInner entry");
434 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
435 if (info == nullptr) {
436 TELEPHONY_LOGE("OnUpdateGetImsConfigResponseInner, info is nullptr.");
437 int32_t value = data.ReadInt32();
438 reply.WriteInt32(UpdateGetImsConfigResponse(value));
439 return TELEPHONY_SUCCESS;
440 }
441 reply.WriteInt32(UpdateGetImsConfigResponse(*info));
442 return TELEPHONY_SUCCESS;
443 }
444
OnUpdateSetImsFeatureResponseInner(MessageParcel & data,MessageParcel & reply)445 int32_t ImsCallbackStub::OnUpdateSetImsFeatureResponseInner(MessageParcel &data, MessageParcel &reply)
446 {
447 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetImsFeatureResponseInner entry");
448 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
449 if (info == nullptr) {
450 TELEPHONY_LOGE("OnUpdateSetImsFeatureResponseInner return, info is nullptr.");
451 return TELEPHONY_ERR_ARGUMENT_INVALID;
452 }
453 reply.WriteInt32(UpdateSetImsFeatureValueResponse(*info));
454 return TELEPHONY_SUCCESS;
455 }
456
OnUpdateGetImsFeatureResponseInner(MessageParcel & data,MessageParcel & reply)457 int32_t ImsCallbackStub::OnUpdateGetImsFeatureResponseInner(MessageParcel &data, MessageParcel &reply)
458 {
459 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetImsFeatureResponseInner entry");
460 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
461 if (info == nullptr) {
462 TELEPHONY_LOGE("OnUpdateGetImsFeatureResponseInner, info is nullptr.");
463 int32_t value = data.ReadInt32();
464 reply.WriteInt32(UpdateGetImsFeatureValueResponse(value));
465 return TELEPHONY_SUCCESS;
466 }
467 reply.WriteInt32(UpdateGetImsFeatureValueResponse(*info));
468 return TELEPHONY_SUCCESS;
469 }
470
OnUpdateSetImsSwitchEnhanceModeResponseInner(MessageParcel & data,MessageParcel & reply)471 int32_t ImsCallbackStub::OnUpdateSetImsSwitchEnhanceModeResponseInner(MessageParcel &data, MessageParcel &reply)
472 {
473 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetImsSwitchEnhanceModeResponseInner entry");
474 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
475 if (info == nullptr) {
476 TELEPHONY_LOGE("OnUpdateSetImsSwitchEnhanceModeResponseInner return, info is nullptr.");
477 return TELEPHONY_ERR_ARGUMENT_INVALID;
478 }
479 reply.WriteInt32(UpdateSetImsSwitchEnhanceModeResponse(*info));
480 return TELEPHONY_SUCCESS;
481 }
482
OnUpdateGetImsSwitchEnhanceModeResponseInner(MessageParcel & data,MessageParcel & reply)483 int32_t ImsCallbackStub::OnUpdateGetImsSwitchEnhanceModeResponseInner(MessageParcel &data, MessageParcel &reply)
484 {
485 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetImsSwitchEnhanceModeResponseInner entry");
486 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
487 if (info == nullptr) {
488 TELEPHONY_LOGE("OnUpdateGetImsSwitchEnhanceModeResponseInner, info is nullptr.");
489 int32_t value = data.ReadInt32();
490 reply.WriteInt32(UpdateGetImsSwitchEnhanceModeResponse(value));
491 return TELEPHONY_SUCCESS;
492 }
493 reply.WriteInt32(UpdateGetImsSwitchEnhanceModeResponse(*info));
494 return TELEPHONY_SUCCESS;
495 }
496
OnUpdateCtrlCameraResponseInner(MessageParcel & data,MessageParcel & reply)497 int32_t ImsCallbackStub::OnUpdateCtrlCameraResponseInner(MessageParcel &data, MessageParcel &reply)
498 {
499 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateCtrlCameraResponseInner entry");
500 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
501 if (info == nullptr) {
502 TELEPHONY_LOGE("OnUpdateCtrlCameraResponseInner return, info is nullptr.");
503 return TELEPHONY_ERR_ARGUMENT_INVALID;
504 }
505 reply.WriteInt32(UpdateCtrlCameraResponse(*info));
506 return TELEPHONY_SUCCESS;
507 }
508
OnUpdateSetPreviewWindowResponseInner(MessageParcel & data,MessageParcel & reply)509 int32_t ImsCallbackStub::OnUpdateSetPreviewWindowResponseInner(MessageParcel &data, MessageParcel &reply)
510 {
511 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetPreviewWindowResponseInner entry");
512 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
513 if (info == nullptr) {
514 TELEPHONY_LOGE("OnUpdateSetPreviewWindowResponseInner return, info is nullptr.");
515 return TELEPHONY_ERR_ARGUMENT_INVALID;
516 }
517 reply.WriteInt32(UpdateSetPreviewWindowResponse(*info));
518 return TELEPHONY_SUCCESS;
519 }
520
OnUpdateSetDisplayWindowResponseInner(MessageParcel & data,MessageParcel & reply)521 int32_t ImsCallbackStub::OnUpdateSetDisplayWindowResponseInner(MessageParcel &data, MessageParcel &reply)
522 {
523 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetDisplayWindowResponseInner entry");
524 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
525 if (info == nullptr) {
526 TELEPHONY_LOGE("OnUpdateSetDisplayWindowResponseInner return, info is nullptr.");
527 return TELEPHONY_ERR_ARGUMENT_INVALID;
528 }
529 reply.WriteInt32(UpdateSetDisplayWindowResponse(*info));
530 return TELEPHONY_SUCCESS;
531 }
532
OnUpdateSetCameraZoomResponseInner(MessageParcel & data,MessageParcel & reply)533 int32_t ImsCallbackStub::OnUpdateSetCameraZoomResponseInner(MessageParcel &data, MessageParcel &reply)
534 {
535 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetCameraZoomResponseInner entry");
536 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
537 if (info == nullptr) {
538 TELEPHONY_LOGE("OnUpdateSetCameraZoomResponseInner return, info is nullptr.");
539 return TELEPHONY_ERR_ARGUMENT_INVALID;
540 }
541 reply.WriteInt32(UpdateSetCameraZoomResponse(*info));
542 return TELEPHONY_SUCCESS;
543 }
544
OnUpdateSetPauseImageResponseInner(MessageParcel & data,MessageParcel & reply)545 int32_t ImsCallbackStub::OnUpdateSetPauseImageResponseInner(MessageParcel &data, MessageParcel &reply)
546 {
547 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetPauseImageResponseInner entry");
548 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
549 if (info == nullptr) {
550 TELEPHONY_LOGE("OnUpdateSetPauseImageResponseInner return, info is nullptr.");
551 return TELEPHONY_ERR_ARGUMENT_INVALID;
552 }
553 reply.WriteInt32(UpdateSetPauseImageResponse(*info));
554 return TELEPHONY_SUCCESS;
555 }
556
OnUpdateSetDeviceDirectionResponseInner(MessageParcel & data,MessageParcel & reply)557 int32_t ImsCallbackStub::OnUpdateSetDeviceDirectionResponseInner(MessageParcel &data, MessageParcel &reply)
558 {
559 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetDeviceDirectionResponseInner entry");
560 auto info = (ImsResponseInfo *)data.ReadRawData(sizeof(ImsResponseInfo));
561 if (info == nullptr) {
562 TELEPHONY_LOGE("OnUpdateSetDeviceDirectionResponseInner return, info is nullptr.");
563 return TELEPHONY_ERR_ARGUMENT_INVALID;
564 }
565 reply.WriteInt32(UpdateSetDeviceDirectionResponse(*info));
566 return TELEPHONY_SUCCESS;
567 }
568
OnUpdateSrvccStateReportInner(MessageParcel & data,MessageParcel & reply)569 int32_t ImsCallbackStub::OnUpdateSrvccStateReportInner(MessageParcel &data, MessageParcel &reply)
570 {
571 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSrvccStateReportInner entry");
572 int32_t slotId = data.ReadInt32();
573 auto srvccState = static_cast<SrvccState>(data.ReadInt32());
574 reply.WriteInt32(UpdateSrvccStateReport(slotId, srvccState));
575 return TELEPHONY_SUCCESS;
576 }
577
OnUpdateVtWfcReportInner(MessageParcel & data,MessageParcel & reply)578 int32_t ImsCallbackStub::OnUpdateVtWfcReportInner(MessageParcel &data, MessageParcel &reply)
579 {
580 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateVtWfcReportInner entry");
581 int32_t slotId = data.ReadInt32();
582 auto transferState = static_cast<TransferState>(data.ReadInt32());
583 reply.WriteInt32(UpdateVtWfcReport(slotId, transferState));
584 return TELEPHONY_SUCCESS;
585 }
586
OnUpdateSetMuteResponseInner(MessageParcel & data,MessageParcel & reply)587 int32_t ImsCallbackStub::OnUpdateSetMuteResponseInner(MessageParcel &data, MessageParcel &reply)
588 {
589 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetMuteResponseInner entry");
590 auto info = (MuteControlResponse *)data.ReadRawData(sizeof(MuteControlResponse));
591 if (info == nullptr) {
592 TELEPHONY_LOGE("OnUpdateSetMuteResponseInner return, info is nullptr.");
593 return TELEPHONY_ERR_ARGUMENT_INVALID;
594 }
595 reply.WriteInt32(UpdateSetMuteResponse(*info));
596 return TELEPHONY_SUCCESS;
597 }
598
OnUpdateGetMuteResponseInner(MessageParcel & data,MessageParcel & reply)599 int32_t ImsCallbackStub::OnUpdateGetMuteResponseInner(MessageParcel &data, MessageParcel &reply)
600 {
601 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetMuteResponseInner entry");
602 auto info = (MuteControlResponse *)data.ReadRawData(sizeof(MuteControlResponse));
603 if (info == nullptr) {
604 TELEPHONY_LOGE("OnUpdateGetMuteResponseInner return, info is nullptr.");
605 return TELEPHONY_ERR_ARGUMENT_INVALID;
606 }
607 reply.WriteInt32(UpdateGetMuteResponse(*info));
608 return TELEPHONY_SUCCESS;
609 }
610
OnUpdateCallRingBackResponseInner(MessageParcel & data,MessageParcel & reply)611 int32_t ImsCallbackStub::OnUpdateCallRingBackResponseInner(MessageParcel &data, MessageParcel &reply)
612 {
613 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateCallRingBackResponseInner entry");
614 auto info = (RingbackVoice *)data.ReadRawData(sizeof(RingbackVoice));
615 if (info == nullptr) {
616 TELEPHONY_LOGE("OnUpdateCallRingBackResponseInner return, info is nullptr.");
617 return TELEPHONY_ERR_ARGUMENT_INVALID;
618 }
619 reply.WriteInt32(UpdateCallRingBackResponse(*info));
620 return TELEPHONY_SUCCESS;
621 }
622
OnUpdateGetEccListResponseInner(MessageParcel & data,MessageParcel & reply)623 int32_t ImsCallbackStub::OnUpdateGetEccListResponseInner(MessageParcel &data, MessageParcel &reply)
624 {
625 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetEccListResponseInner entry");
626 auto list = (EmergencyInfoList *)data.ReadRawData(sizeof(EmergencyInfoList));
627 if (list == nullptr) {
628 TELEPHONY_LOGE("OnUpdateGetEccListResponseInner return, list is nullptr.");
629 return TELEPHONY_ERR_ARGUMENT_INVALID;
630 }
631 reply.WriteInt32(UpdateGetEccCallListResponse(*list));
632 return TELEPHONY_SUCCESS;
633 }
634
OnUpdateCallFailReasonResponseInner(MessageParcel & data,MessageParcel & reply)635 int32_t ImsCallbackStub::OnUpdateCallFailReasonResponseInner(MessageParcel &data, MessageParcel &reply)
636 {
637 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateCallFailReasonResponseInner entry");
638 int32_t reason = data.ReadInt32();
639 reply.WriteInt32(UpdateCallFailReasonResponse(reason));
640 return TELEPHONY_SUCCESS;
641 }
642
OnUpdateGetClipResponseInner(MessageParcel & data,MessageParcel & reply)643 int32_t ImsCallbackStub::OnUpdateGetClipResponseInner(MessageParcel &data, MessageParcel &reply)
644 {
645 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetClipResponseInner entry");
646 auto response = (ClipResponse *)data.ReadRawData(sizeof(ClipResponse));
647 if (response == nullptr) {
648 TELEPHONY_LOGE("OnUpdateGetClipResponseInner return, response is nullptr.");
649 return TELEPHONY_ERR_ARGUMENT_INVALID;
650 }
651 reply.WriteInt32(UpdateGetClipResponse(*response));
652 return TELEPHONY_SUCCESS;
653 }
654
OnUpdateGetClirResponseInner(MessageParcel & data,MessageParcel & reply)655 int32_t ImsCallbackStub::OnUpdateGetClirResponseInner(MessageParcel &data, MessageParcel &reply)
656 {
657 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetClirResponseInner entry");
658 auto response = (ClirResponse *)data.ReadRawData(sizeof(ClirResponse));
659 if (response == nullptr) {
660 TELEPHONY_LOGE("OnUpdateGetClirResponseInner return, response is nullptr.");
661 return TELEPHONY_ERR_ARGUMENT_INVALID;
662 }
663 reply.WriteInt32(UpdateGetClirResponse(*response));
664 return TELEPHONY_SUCCESS;
665 }
666
OnUpdateSetClirResponseInner(MessageParcel & data,MessageParcel & reply)667 int32_t ImsCallbackStub::OnUpdateSetClirResponseInner(MessageParcel &data, MessageParcel &reply)
668 {
669 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetClirResponseInner entry");
670 auto errType = static_cast<HRilErrType>(data.ReadInt32());
671 reply.WriteInt32(UpdateSetClirResponse(errType));
672 return TELEPHONY_SUCCESS;
673 }
674
OnUpdateGetCallTransferResponseInner(MessageParcel & data,MessageParcel & reply)675 int32_t ImsCallbackStub::OnUpdateGetCallTransferResponseInner(MessageParcel &data, MessageParcel &reply)
676 {
677 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetCallTransferResponseInner entry");
678 auto response = (CallTransferResponse *)data.ReadRawData(sizeof(CallTransferResponse));
679 if (response == nullptr) {
680 TELEPHONY_LOGE("OnUpdateGetCallTransferResponseInner return, response is nullptr.");
681 return TELEPHONY_ERR_ARGUMENT_INVALID;
682 }
683 reply.WriteInt32(UpdateGetCallTransferResponse(*response));
684 return TELEPHONY_SUCCESS;
685 }
686
OnUpdateSetCallTransferResponseInner(MessageParcel & data,MessageParcel & reply)687 int32_t ImsCallbackStub::OnUpdateSetCallTransferResponseInner(MessageParcel &data, MessageParcel &reply)
688 {
689 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetCallTransferResponseInner entry");
690 auto errType = static_cast<HRilErrType>(data.ReadInt32());
691 reply.WriteInt32(UpdateSetCallTransferResponse(errType));
692 return TELEPHONY_SUCCESS;
693 }
694
OnUpdateGetCallRestrictionResponseInner(MessageParcel & data,MessageParcel & reply)695 int32_t ImsCallbackStub::OnUpdateGetCallRestrictionResponseInner(MessageParcel &data, MessageParcel &reply)
696 {
697 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetCallRestrictionResponseInner entry");
698 auto response = (CallRestrictionResponse *)data.ReadRawData(sizeof(CallRestrictionResponse));
699 if (response == nullptr) {
700 TELEPHONY_LOGE("OnUpdateGetCallRestrictionResponseInner return, response is nullptr.");
701 return TELEPHONY_ERR_ARGUMENT_INVALID;
702 }
703 reply.WriteInt32(UpdateGetCallRestrictionResponse(*response));
704 return TELEPHONY_SUCCESS;
705 }
706
OnUpdateSetCallRestrictionResponseInner(MessageParcel & data,MessageParcel & reply)707 int32_t ImsCallbackStub::OnUpdateSetCallRestrictionResponseInner(MessageParcel &data, MessageParcel &reply)
708 {
709 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetCallRestrictionResponseInner entry");
710 auto errType = static_cast<HRilErrType>(data.ReadInt32());
711 reply.WriteInt32(UpdateSetCallRestrictionResponse(errType));
712 return TELEPHONY_SUCCESS;
713 }
714
OnUpdateGetCallWaitingResponseInner(MessageParcel & data,MessageParcel & reply)715 int32_t ImsCallbackStub::OnUpdateGetCallWaitingResponseInner(MessageParcel &data, MessageParcel &reply)
716 {
717 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateGetCallWaitingResponseInner entry");
718 auto response = (CallWaitResponse *)data.ReadRawData(sizeof(CallWaitResponse));
719 if (response == nullptr) {
720 TELEPHONY_LOGE("OnUpdateGetCallWaitingResponseInner return, response is nullptr.");
721 return TELEPHONY_ERR_ARGUMENT_INVALID;
722 }
723 reply.WriteInt32(UpdateGetCallWaitingResponse(*response));
724 return TELEPHONY_SUCCESS;
725 }
726
OnUpdateSetCallWaitingResponseInner(MessageParcel & data,MessageParcel & reply)727 int32_t ImsCallbackStub::OnUpdateSetCallWaitingResponseInner(MessageParcel &data, MessageParcel &reply)
728 {
729 TELEPHONY_LOGI("ImsCallbackStub::OnUpdateSetCallWaitingResponseInner entry");
730 auto errType = static_cast<HRilErrType>(data.ReadInt32());
731 reply.WriteInt32(UpdateSetCallWaitingResponse(errType));
732 return TELEPHONY_SUCCESS;
733 }
734
UpdateDialResponse(const ImsResponseInfo & info)735 int32_t ImsCallbackStub::UpdateDialResponse(const ImsResponseInfo &info)
736 {
737 TELEPHONY_LOGI("ImsCallbackStub::UpdateDialResponse entry");
738 if (info.error != ImsErrType::IMS_SUCCESS) {
739 TELEPHONY_LOGI("UpdateDialResponse, dial return error, report to call_manager");
740 CellularCallEventInfo eventInfo;
741 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
742 eventInfo.eventId = RequestResultEventId::RESULT_DIAL_SEND_FAILED;
743
744 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
745 TELEPHONY_LOGE("UpdateDialResponse return, GetInstance is nullptr");
746 return TELEPHONY_ERR_LOCAL_PTR_NULL;
747 }
748 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
749 }
750 return TELEPHONY_SUCCESS;
751 }
752
UpdateHangUpResponse(const ImsResponseInfo & info)753 int32_t ImsCallbackStub::UpdateHangUpResponse(const ImsResponseInfo &info)
754 {
755 TELEPHONY_LOGI("ImsCallbackStub::UpdateHangUpResponse entry");
756 if (info.error != ImsErrType::IMS_SUCCESS) {
757 TELEPHONY_LOGI("UpdateHangUpResponse, HangUp return error, report to call_manager");
758 CellularCallEventInfo eventInfo;
759 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
760 eventInfo.eventId = RequestResultEventId::RESULT_END_SEND_FAILED;
761
762 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
763 TELEPHONY_LOGE("UpdateHangUpResponse return, GetInstance is nullptr");
764 return TELEPHONY_ERR_LOCAL_PTR_NULL;
765 }
766 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
767 }
768 return TELEPHONY_SUCCESS;
769 }
770
UpdateRejectResponse(const ImsResponseInfo & info)771 int32_t ImsCallbackStub::UpdateRejectResponse(const ImsResponseInfo &info)
772 {
773 TELEPHONY_LOGI("ImsCallbackStub::UpdateRejectResponse entry");
774 if (info.error != ImsErrType::IMS_SUCCESS) {
775 TELEPHONY_LOGI("UpdateRejectResponse, return error, report to call_manager");
776 CellularCallEventInfo eventInfo;
777 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
778 eventInfo.eventId = RequestResultEventId::RESULT_REJECT_SEND_FAILED;
779
780 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
781 TELEPHONY_LOGE("UpdateRejectResponse return, GetInstance is nullptr");
782 return TELEPHONY_ERR_LOCAL_PTR_NULL;
783 }
784 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
785 }
786 return TELEPHONY_SUCCESS;
787 }
788
UpdateAnswerResponse(const ImsResponseInfo & info)789 int32_t ImsCallbackStub::UpdateAnswerResponse(const ImsResponseInfo &info)
790 {
791 TELEPHONY_LOGI("ImsCallbackStub::UpdateAnswerResponse entry");
792 if (info.error != ImsErrType::IMS_SUCCESS) {
793 TELEPHONY_LOGI("UpdateAnswerResponse, return error, report to call_manager");
794 CellularCallEventInfo eventInfo;
795 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
796 eventInfo.eventId = RequestResultEventId::RESULT_ACCEPT_SEND_FAILED;
797
798 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
799 TELEPHONY_LOGE("UpdateAnswerResponse return, GetInstance is nullptr");
800 return TELEPHONY_ERR_LOCAL_PTR_NULL;
801 }
802 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
803 }
804 return TELEPHONY_SUCCESS;
805 }
806
UpdateHoldResponse(const ImsResponseInfo & info)807 int32_t ImsCallbackStub::UpdateHoldResponse(const ImsResponseInfo &info)
808 {
809 TELEPHONY_LOGI("ImsCallbackStub::UpdateHoldResponse entry");
810 if (info.error != ImsErrType::IMS_SUCCESS) {
811 TELEPHONY_LOGI("UpdateHoldResponse, return error, report to call_manager");
812 CellularCallEventInfo eventInfo;
813 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
814 eventInfo.eventId = RequestResultEventId::RESULT_HOLD_SEND_FAILED;
815
816 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
817 TELEPHONY_LOGE("UpdateHoldResponse return, GetInstance is nullptr");
818 return TELEPHONY_ERR_LOCAL_PTR_NULL;
819 }
820 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
821 }
822 return TELEPHONY_SUCCESS;
823 }
824
UpdateUnHoldResponse(const ImsResponseInfo & info)825 int32_t ImsCallbackStub::UpdateUnHoldResponse(const ImsResponseInfo &info)
826 {
827 TELEPHONY_LOGI("ImsCallbackStub::UpdateUnHoldResponse entry");
828 if (info.error != ImsErrType::IMS_SUCCESS) {
829 TELEPHONY_LOGI("UpdateUnHoldResponse, return error, report to call_manager");
830 CellularCallEventInfo eventInfo;
831 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
832 eventInfo.eventId = RequestResultEventId::RESULT_ACTIVE_SEND_FAILED;
833
834 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
835 TELEPHONY_LOGE("UpdateUnHoldResponse return, GetInstance is nullptr");
836 return TELEPHONY_ERR_LOCAL_PTR_NULL;
837 }
838 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
839 }
840 return TELEPHONY_SUCCESS;
841 }
842
UpdateSwitchResponse(const ImsResponseInfo & info)843 int32_t ImsCallbackStub::UpdateSwitchResponse(const ImsResponseInfo &info)
844 {
845 TELEPHONY_LOGI("ImsCallbackStub::UpdateSwitchResponse entry");
846 if (info.error != ImsErrType::IMS_SUCCESS) {
847 TELEPHONY_LOGI("UpdateSwitchResponse, return error, report to call_manager");
848 CellularCallEventInfo eventInfo;
849 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
850 eventInfo.eventId = RequestResultEventId::RESULT_SWAP_SEND_FAILED;
851
852 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
853 TELEPHONY_LOGE("UpdateSwitchResponse return, GetInstance is nullptr");
854 return TELEPHONY_ERR_LOCAL_PTR_NULL;
855 }
856 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
857 }
858 return TELEPHONY_SUCCESS;
859 }
860
UpdateCombineConferenceResponse(const ImsResponseInfo & info)861 int32_t ImsCallbackStub::UpdateCombineConferenceResponse(const ImsResponseInfo &info)
862 {
863 TELEPHONY_LOGI("ImsCallbackStub::UpdateCombineConferenceResponse entry");
864 if (info.error != ImsErrType::IMS_SUCCESS) {
865 TELEPHONY_LOGI("UpdateCombineConferenceResponse, return error, report to call_manager");
866 CellularCallEventInfo eventInfo;
867 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
868 eventInfo.eventId = RequestResultEventId::RESULT_JOIN_SEND_FAILED;
869
870 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
871 TELEPHONY_LOGE("UpdateCombineConferenceResponse return, GetInstance is nullptr");
872 return TELEPHONY_ERR_LOCAL_PTR_NULL;
873 }
874 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
875 }
876 return TELEPHONY_SUCCESS;
877 }
878
UpdateInviteToConferenceResponse(const ImsResponseInfo & info)879 int32_t ImsCallbackStub::UpdateInviteToConferenceResponse(const ImsResponseInfo &info)
880 {
881 TELEPHONY_LOGI("ImsCallbackStub::UpdateInviteToConferenceResponse entry");
882 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
883 TELEPHONY_LOGE("UpdateInviteToConferenceResponse return, GetInstance is nullptr");
884 return TELEPHONY_ERR_LOCAL_PTR_NULL;
885 }
886 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportInviteToConferenceResult(info.error);
887 return TELEPHONY_SUCCESS;
888 }
889
UpdateKickOutFromConferenceResponse(const ImsResponseInfo & info)890 int32_t ImsCallbackStub::UpdateKickOutFromConferenceResponse(const ImsResponseInfo &info)
891 {
892 TELEPHONY_LOGI("ImsCallbackStub::UpdateKickOutFromConferenceResponse entry");
893 CellularCallEventInfo eventInfo;
894 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
895 if (info.error != ImsErrType::IMS_SUCCESS) {
896 eventInfo.eventId = RequestResultEventId::RESULT_KICK_OUT_FROM_CONFERENCE_FAILED;
897 } else {
898 eventInfo.eventId = RequestResultEventId::RESULT_KICK_OUT_FROM_CONFERENCE_SUCCESS;
899 }
900 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
901 TELEPHONY_LOGE("UpdateKickOutFromConferenceResponse return, GetInstance is nullptr");
902 return TELEPHONY_ERR_LOCAL_PTR_NULL;
903 }
904 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
905 return TELEPHONY_SUCCESS;
906 }
907
UpdateCallMediaModeResponse(const ImsResponseInfo & info)908 int32_t ImsCallbackStub::UpdateCallMediaModeResponse(const ImsResponseInfo &info)
909 {
910 TELEPHONY_LOGI("ImsCallbackStub::UpdateCallMediaModeResponse entry");
911 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
912 TELEPHONY_LOGE("UpdateCallMediaModeResponse return, GetInstance is nullptr");
913 return TELEPHONY_ERR_LOCAL_PTR_NULL;
914 }
915 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportUpdateCallMediaModeResult(info.error);
916 return TELEPHONY_SUCCESS;
917 }
918
UpdateIsEmergencyPhoneNumberResponse(const ImsResponseInfo & info)919 int32_t ImsCallbackStub::UpdateIsEmergencyPhoneNumberResponse(const ImsResponseInfo &info)
920 {
921 TELEPHONY_LOGI("ImsCallbackStub::UpdateIsEmergencyPhoneNumberResponse entry");
922 return TELEPHONY_SUCCESS;
923 }
924
UpdateIsEmergencyPhoneNumberResponse(bool value)925 int32_t ImsCallbackStub::UpdateIsEmergencyPhoneNumberResponse(bool value)
926 {
927 TELEPHONY_LOGI("ImsCallbackStub::UpdateIsEmergencyPhoneNumberResponse entry");
928 return TELEPHONY_SUCCESS;
929 }
930
UpdateStartDtmfResponse(const ImsResponseInfo & info)931 int32_t ImsCallbackStub::UpdateStartDtmfResponse(const ImsResponseInfo &info)
932 {
933 TELEPHONY_LOGI("ImsCallbackStub::UpdateStartDtmfResponse entry");
934 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
935 TELEPHONY_LOGE("UpdateStartDtmfResponse return, GetInstance is nullptr");
936 return TELEPHONY_ERR_LOCAL_PTR_NULL;
937 }
938 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportStartDtmfResult(static_cast<int32_t>(info.error));
939 return TELEPHONY_SUCCESS;
940 }
941
UpdateSendDtmfResponse(const ImsResponseInfo & info)942 int32_t ImsCallbackStub::UpdateSendDtmfResponse(const ImsResponseInfo &info)
943 {
944 TELEPHONY_LOGI("ImsCallbackStub::UpdateSendDtmfResponse entry");
945 CellularCallEventInfo eventInfo;
946 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
947 if (info.error != ImsErrType::IMS_SUCCESS) {
948 eventInfo.eventId = RequestResultEventId::RESULT_SEND_DTMF_FAILED;
949 } else {
950 eventInfo.eventId = RequestResultEventId::RESULT_SEND_DTMF_SUCCESS;
951 }
952 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
953 TELEPHONY_LOGE("UpdateSendDtmfResponse return, GetInstance is nullptr");
954 return TELEPHONY_ERR_LOCAL_PTR_NULL;
955 }
956 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
957 return TELEPHONY_SUCCESS;
958 }
959
UpdateStopDtmfResponse(const ImsResponseInfo & info)960 int32_t ImsCallbackStub::UpdateStopDtmfResponse(const ImsResponseInfo &info)
961 {
962 TELEPHONY_LOGI("ImsCallbackStub::UpdateStopDtmfResponse entry");
963 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
964 TELEPHONY_LOGE("UpdateStopDtmfResponse return, GetInstance is nullptr");
965 return TELEPHONY_ERR_LOCAL_PTR_NULL;
966 }
967 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportStopDtmfResult(static_cast<int32_t>(info.error));
968 return TELEPHONY_SUCCESS;
969 }
970
UpdateStartRttResponse(const ImsResponseInfo & info)971 int32_t ImsCallbackStub::UpdateStartRttResponse(const ImsResponseInfo &info)
972 {
973 TELEPHONY_LOGI("ImsCallbackStub::UpdateStartRttResponse entry");
974 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
975 TELEPHONY_LOGE("UpdateStartRttResponse return, GetInstance is nullptr");
976 return TELEPHONY_ERR_LOCAL_PTR_NULL;
977 }
978 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportStartRttResult(info.error);
979 return TELEPHONY_SUCCESS;
980 }
981
UpdateStopRttResponse(const ImsResponseInfo & info)982 int32_t ImsCallbackStub::UpdateStopRttResponse(const ImsResponseInfo &info)
983 {
984 TELEPHONY_LOGI("ImsCallbackStub::UpdateStopRttResponse entry");
985 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
986 TELEPHONY_LOGE("UpdateStopRttResponse return, GetInstance is nullptr");
987 return TELEPHONY_ERR_LOCAL_PTR_NULL;
988 }
989 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportStopRttResult(info.error);
990 return TELEPHONY_SUCCESS;
991 }
992
UpdateCallStatusResponse(int32_t slotId)993 int32_t ImsCallbackStub::UpdateCallStatusResponse(int32_t slotId)
994 {
995 TELEPHONY_LOGI("ImsCallbackStub::UpdateCallStatusResponse entry");
996 return TELEPHONY_SUCCESS;
997 }
998
UpdateServiceStatusResponse(int32_t slotId,const CallImsServiceStatus & callImsServiceStatus)999 int32_t ImsCallbackStub::UpdateServiceStatusResponse(int32_t slotId, const CallImsServiceStatus &callImsServiceStatus)
1000 {
1001 TELEPHONY_LOGI("ImsCallbackStub::UpdateServiceStatusResponse entry");
1002 return TELEPHONY_SUCCESS;
1003 }
1004
UpdateSetPreModeResponse(int32_t slotId,const ImsResponseInfo & info)1005 int32_t ImsCallbackStub::UpdateSetPreModeResponse(int32_t slotId, const ImsResponseInfo &info)
1006 {
1007 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetPreModeResponse entry");
1008
1009 auto responseInfo = std::make_shared<HRilRadioResponseInfo>();
1010 if (responseInfo == nullptr) {
1011 TELEPHONY_LOGE("ImsCallbackStub::UpdateSetPreModeResponse, UpdateSetPreModeResponse == nullptr");
1012 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1013 }
1014 responseInfo->error = static_cast<HRilErrType>(info.error);
1015 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1016 TELEPHONY_LOGE("UpdateSetPreModeResponse return, GetInstance is nullptr");
1017 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1018 }
1019 if (DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId) == nullptr) {
1020 TELEPHONY_LOGE("UpdateSetPreModeResponse return, GetHandler is nullptr");
1021 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1022 }
1023 auto event = AppExecFwk::InnerEvent::Get(RadioEvent::RADIO_SET_CALL_PREFERENCE_MODE, responseInfo);
1024 DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId)->SetDomainPreferenceModeResponse(event);
1025
1026 CellularCallEventInfo eventInfo;
1027 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
1028 if (info.error != ImsErrType::IMS_SUCCESS) {
1029 eventInfo.eventId = RequestResultEventId::RESULT_SET_CALL_PREFERENCE_MODE_FAILED;
1030 } else {
1031 eventInfo.eventId = RequestResultEventId::RESULT_SET_CALL_PREFERENCE_MODE_SUCCESS;
1032 }
1033 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
1034 return TELEPHONY_SUCCESS;
1035 }
1036
UpdateGetPreModeResponse(const ImsResponseInfo & info)1037 int32_t ImsCallbackStub::UpdateGetPreModeResponse(const ImsResponseInfo &info)
1038 {
1039 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetPreModeResponse entry");
1040 TELEPHONY_LOGI("UpdateGetPreModeResponse return ImsResponseInfo");
1041 return TELEPHONY_SUCCESS;
1042 }
1043
UpdateGetPreModeResponse(int32_t slotId,int32_t mode)1044 int32_t ImsCallbackStub::UpdateGetPreModeResponse(int32_t slotId, int32_t mode)
1045 {
1046 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetPreModeResponse entry mode:%{public}d", mode);
1047 std::shared_ptr<int32_t> preferenceMode = std::make_shared<int32_t>(mode);
1048 if (preferenceMode == nullptr) {
1049 TELEPHONY_LOGE("ImsCallbackStub::UpdateGetPreModeResponse, preferenceMode == nullptr !!!");
1050 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1051 }
1052 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1053 TELEPHONY_LOGE("UpdateGetPreModeResponse return, GetInstance is nullptr");
1054 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1055 }
1056 if (DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId) == nullptr) {
1057 TELEPHONY_LOGE("UpdateGetPreModeResponse return, GetHandler is nullptr");
1058 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1059 }
1060 auto event = AppExecFwk::InnerEvent::Get(RadioEvent::RADIO_GET_CALL_PREFERENCE_MODE, preferenceMode);
1061 DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId)->GetDomainPreferenceModeResponse(event);
1062 return TELEPHONY_SUCCESS;
1063 }
1064
UpdateSetImsSwitchResponse(const ImsResponseInfo & info)1065 int32_t ImsCallbackStub::UpdateSetImsSwitchResponse(const ImsResponseInfo &info)
1066 {
1067 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetImsSwitchResponse entry");
1068 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1069 TELEPHONY_LOGE("UpdateSetImsSwitchResponse return, GetInstance is nullptr");
1070 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1071 }
1072 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetLteImsSwitchResult(info.error);
1073 return TELEPHONY_SUCCESS;
1074 }
1075
UpdateGetImsSwitchResponse(const ImsResponseInfo & info)1076 int32_t ImsCallbackStub::UpdateGetImsSwitchResponse(const ImsResponseInfo &info)
1077 {
1078 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsSwitchResponse entry");
1079 if (info.error != ImsErrType::IMS_SUCCESS) {
1080 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1081 TELEPHONY_LOGE("UpdateGetImsSwitchResponse return, GetInstance is nullptr");
1082 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1083 }
1084 LteImsSwitchResponse response;
1085 response.result = info.error;
1086 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetLteImsSwitchResult(response);
1087 } else {
1088 TELEPHONY_LOGI("UpdateGetImsSwitchResponse, result error");
1089 }
1090 return TELEPHONY_SUCCESS;
1091 }
1092
UpdateGetImsSwitchResponse(int32_t slotId,int32_t active)1093 int32_t ImsCallbackStub::UpdateGetImsSwitchResponse(int32_t slotId, int32_t active)
1094 {
1095 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsSwitchResponse entry active:%{public}d", active);
1096 // report to cellular call
1097 std::shared_ptr<int32_t> imsSwitch = std::make_shared<int32_t>(active);
1098 if (imsSwitch == nullptr) {
1099 TELEPHONY_LOGE("ImsCallbackStub::UpdateGetImsSwitchResponse, imsSwitch == nullptr !!!");
1100 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1101 }
1102 if (DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId) == nullptr) {
1103 TELEPHONY_LOGE("UpdateGetImsSwitchResponse return, GetHandler is nullptr");
1104 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1105 }
1106 auto event = AppExecFwk::InnerEvent::Get(RadioEvent::RADIO_GET_LTE_IMS_SWITCH_STATUS, imsSwitch);
1107 DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId)->GetLteImsSwitchStatusResponse(event);
1108
1109 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1110 TELEPHONY_LOGE("UpdateGetImsSwitchResponse return, GetInstance is nullptr");
1111 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1112 }
1113 LteImsSwitchResponse response;
1114 response.result = IMS_SUCCESS;
1115 response.active = active;
1116 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetLteImsSwitchResult(response);
1117 return TELEPHONY_SUCCESS;
1118 }
1119
UpdateImsCallsDataResponse(const ImsResponseInfo & info)1120 int32_t ImsCallbackStub::UpdateImsCallsDataResponse(const ImsResponseInfo &info)
1121 {
1122 TELEPHONY_LOGI("ImsCallbackStub::UpdateImsCallsDataResponse entry");
1123 if (info.error != ImsErrType::IMS_SUCCESS) {
1124 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1125 TELEPHONY_LOGE("UpdateImsCallsDataResponse return, GetInstance is nullptr");
1126 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1127 }
1128 TELEPHONY_LOGI("UpdateImsCallsDataResponse, return error, report to call_manager");
1129 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetCallDataResult(IMS_FAILED);
1130 } else {
1131 TELEPHONY_LOGI("UpdateImsCallsDataResponse, result error");
1132 }
1133 return TELEPHONY_SUCCESS;
1134 }
1135
UpdateImsCallsDataResponse(int32_t slotId,const CallInfoList & callList)1136 int32_t ImsCallbackStub::UpdateImsCallsDataResponse(int32_t slotId, const CallInfoList &callList)
1137 {
1138 TELEPHONY_LOGI("ImsCallbackStub::UpdateImsCallsDataResponse entry");
1139 std::shared_ptr<CallInfoList> callInfoList = std::make_shared<CallInfoList>(callList);
1140 if (callInfoList == nullptr) {
1141 TELEPHONY_LOGE("ImsCallbackStub::UpdateImsCallsDataResponse, callInfoList == nullptr !!!");
1142 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1143 }
1144 auto event = AppExecFwk::InnerEvent::Get(RadioEvent::RADIO_GET_IMS_CALL_LIST, callInfoList);
1145 if (DelayedSingleton<CellularCallService>::GetInstance() == nullptr) {
1146 TELEPHONY_LOGE("UpdateImsCallsDataResponse return, GetInstance is nullptr");
1147 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1148 }
1149 if (DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId) == nullptr) {
1150 TELEPHONY_LOGE("UpdateImsCallsDataResponse return, GetHandler is nullptr");
1151 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1152 }
1153 DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId)->GetImsCallsDataResponse(event);
1154 return TELEPHONY_SUCCESS;
1155 }
1156
UpdateSetImsConfigResponse(const ImsResponseInfo & info)1157 int32_t ImsCallbackStub::UpdateSetImsConfigResponse(const ImsResponseInfo &info)
1158 {
1159 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetImsConfigResponse entry");
1160 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1161 TELEPHONY_LOGE("UpdateSetImsConfigResponse return, GetInstance is nullptr");
1162 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1163 }
1164 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetImsConfigResult(info.error);
1165 return TELEPHONY_SUCCESS;
1166 }
1167
UpdateGetImsConfigResponse(int32_t value)1168 int32_t ImsCallbackStub::UpdateGetImsConfigResponse(int32_t value)
1169 {
1170 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsConfigResponse entry");
1171 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1172 TELEPHONY_LOGE("UpdateGetImsConfigResponse return, GetInstance is nullptr");
1173 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1174 }
1175 GetImsConfigResponse response;
1176 response.result = TELEPHONY_SUCCESS;
1177 response.value = value;
1178 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetImsConfigResult(response);
1179 return TELEPHONY_SUCCESS;
1180 }
1181
UpdateGetImsConfigResponse(const ImsResponseInfo & info)1182 int32_t ImsCallbackStub::UpdateGetImsConfigResponse(const ImsResponseInfo &info)
1183 {
1184 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsConfigResponse entry");
1185 if (info.error != ImsErrType::IMS_SUCCESS) {
1186 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1187 TELEPHONY_LOGE("UpdateGetImsConfigResponse return, GetInstance is nullptr");
1188 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1189 }
1190 GetImsConfigResponse response;
1191 response.result = IMS_FAILED;
1192 TELEPHONY_LOGI("UpdateGetImsConfigResponse, return error, report to call_manager");
1193 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetImsConfigResult(response);
1194 } else {
1195 TELEPHONY_LOGI("UpdateGetImsConfigResponse, result error");
1196 }
1197 return TELEPHONY_SUCCESS;
1198 }
1199
UpdateSetImsFeatureValueResponse(const ImsResponseInfo & info)1200 int32_t ImsCallbackStub::UpdateSetImsFeatureValueResponse(const ImsResponseInfo &info)
1201 {
1202 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetImsFeatureValueResponse entry");
1203 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1204 TELEPHONY_LOGE("UpdateSetImsFeatureValueResponse return, GetInstance is nullptr");
1205 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1206 }
1207 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetImsFeatureResult(info.error);
1208 return TELEPHONY_SUCCESS;
1209 }
1210
UpdateGetImsFeatureValueResponse(int32_t value)1211 int32_t ImsCallbackStub::UpdateGetImsFeatureValueResponse(int32_t value)
1212 {
1213 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsFeatureValueResponse entry");
1214 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1215 TELEPHONY_LOGE("UpdateGetImsFeatureValueResponse return, GetInstance is nullptr");
1216 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1217 }
1218 GetImsFeatureValueResponse response;
1219 response.result = TELEPHONY_SUCCESS;
1220 response.value = value;
1221 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetImsFeatureResult(response);
1222 return TELEPHONY_SUCCESS;
1223 }
1224
UpdateGetImsFeatureValueResponse(const ImsResponseInfo & info)1225 int32_t ImsCallbackStub::UpdateGetImsFeatureValueResponse(const ImsResponseInfo &info)
1226 {
1227 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsFeatureValueResponse entry");
1228 if (info.error != ImsErrType::IMS_SUCCESS) {
1229 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1230 TELEPHONY_LOGE("UpdateGetImsFeatureValueResponse return, GetInstance is nullptr");
1231 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1232 }
1233 GetImsFeatureValueResponse response;
1234 response.result = IMS_FAILED;
1235 TELEPHONY_LOGI("UpdateGetImsFeatureValueResponse, return error, report to call_manager");
1236 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetImsFeatureResult(response);
1237 } else {
1238 TELEPHONY_LOGI("UpdateGetImsFeatureValueResponse, result error");
1239 }
1240 return TELEPHONY_SUCCESS;
1241 }
1242
UpdateSetImsSwitchEnhanceModeResponse(const ImsResponseInfo & info)1243 int32_t ImsCallbackStub::UpdateSetImsSwitchEnhanceModeResponse(const ImsResponseInfo &info)
1244 {
1245 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetImsSwitchEnhanceModeResponse entry");
1246 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1247 TELEPHONY_LOGE("UpdateSetImsSwitchEnhanceModeResponse return, GetInstance is nullptr");
1248 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1249 }
1250 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetImsSwitchEnhanceModeResult(info.error);
1251 return TELEPHONY_SUCCESS;
1252 }
1253
UpdateGetImsSwitchEnhanceModeResponse(int32_t value)1254 int32_t ImsCallbackStub::UpdateGetImsSwitchEnhanceModeResponse(int32_t value)
1255 {
1256 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsSwitchEnhanceModeResponse entry");
1257 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1258 TELEPHONY_LOGE("UpdateGetImsSwitchEnhanceModeResponse return, GetInstance is nullptr");
1259 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1260 }
1261 GetLteEnhanceModeResponse response;
1262 response.result = TELEPHONY_SUCCESS;
1263 response.value = value;
1264 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetImsSwitchEnhanceModeResult(response);
1265 return TELEPHONY_SUCCESS;
1266 }
1267
UpdateGetImsSwitchEnhanceModeResponse(const ImsResponseInfo & info)1268 int32_t ImsCallbackStub::UpdateGetImsSwitchEnhanceModeResponse(const ImsResponseInfo &info)
1269 {
1270 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetImsSwitchEnhanceModeResponse entry");
1271 if (info.error != ImsErrType::IMS_SUCCESS) {
1272 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1273 TELEPHONY_LOGE("UpdateGetImsSwitchEnhanceModeResponse return, GetInstance is nullptr");
1274 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1275 }
1276 GetLteEnhanceModeResponse response;
1277 response.result = IMS_FAILED;
1278 TELEPHONY_LOGI("UpdateGetImsSwitchEnhanceModeResponse, return error, report to call_manager");
1279 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetImsSwitchEnhanceModeResult(response);
1280 } else {
1281 TELEPHONY_LOGI("UpdateGetImsSwitchEnhanceModeResponse, result error");
1282 }
1283 return TELEPHONY_SUCCESS;
1284 }
1285
UpdateCtrlCameraResponse(const ImsResponseInfo & info)1286 int32_t ImsCallbackStub::UpdateCtrlCameraResponse(const ImsResponseInfo &info)
1287 {
1288 TELEPHONY_LOGI("ImsCallbackStub::UpdateCtrlCameraResponse entry");
1289 CellularCallEventInfo eventInfo;
1290 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
1291 if (info.error != ImsErrType::IMS_SUCCESS) {
1292 eventInfo.eventId = RequestResultEventId::RESULT_CTRL_CAMERA_FAILED;
1293 } else {
1294 eventInfo.eventId = RequestResultEventId::RESULT_CTRL_CAMERA_SUCCESS;
1295 }
1296 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1297 TELEPHONY_LOGE("UpdateCtrlCameraResponse return, GetInstance is nullptr");
1298 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1299 }
1300 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
1301 return TELEPHONY_SUCCESS;
1302 }
1303
UpdateSetPreviewWindowResponse(const ImsResponseInfo & info)1304 int32_t ImsCallbackStub::UpdateSetPreviewWindowResponse(const ImsResponseInfo &info)
1305 {
1306 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetPreviewWindowResponse entry");
1307 CellularCallEventInfo eventInfo;
1308 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
1309 if (info.error != ImsErrType::IMS_SUCCESS) {
1310 eventInfo.eventId = RequestResultEventId::RESULT_SET_PREVIEW_WINDOW_FAILED;
1311 } else {
1312 eventInfo.eventId = RequestResultEventId::RESULT_SET_PREVIEW_WINDOW_SUCCESS;
1313 }
1314 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1315 TELEPHONY_LOGE("UpdateSetPreviewWindowResponse return, GetInstance is nullptr");
1316 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1317 }
1318 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
1319 return TELEPHONY_SUCCESS;
1320 }
1321
UpdateSetDisplayWindowResponse(const ImsResponseInfo & info)1322 int32_t ImsCallbackStub::UpdateSetDisplayWindowResponse(const ImsResponseInfo &info)
1323 {
1324 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetDisplayWindowResponse entry");
1325 CellularCallEventInfo eventInfo;
1326 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
1327 if (info.error != ImsErrType::IMS_SUCCESS) {
1328 eventInfo.eventId = RequestResultEventId::RESULT_SET_DISPLAY_WINDOW_FAILED;
1329 } else {
1330 eventInfo.eventId = RequestResultEventId::RESULT_SET_DISPLAY_WINDOW_SUCCESS;
1331 }
1332 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1333 TELEPHONY_LOGE("UpdateSetDisplayWindowResponse return, GetInstance is nullptr");
1334 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1335 }
1336 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
1337 return TELEPHONY_SUCCESS;
1338 }
1339
UpdateSetCameraZoomResponse(const ImsResponseInfo & info)1340 int32_t ImsCallbackStub::UpdateSetCameraZoomResponse(const ImsResponseInfo &info)
1341 {
1342 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetCameraZoomResponse entry");
1343 CellularCallEventInfo eventInfo;
1344 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
1345 if (info.error != ImsErrType::IMS_SUCCESS) {
1346 eventInfo.eventId = RequestResultEventId::RESULT_SET_CAMERA_ZOOM_FAILED;
1347 } else {
1348 eventInfo.eventId = RequestResultEventId::RESULT_SET_CAMERA_ZOOM_SUCCESS;
1349 }
1350 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1351 TELEPHONY_LOGE("UpdateSetCameraZoomResponse return, GetInstance is nullptr");
1352 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1353 }
1354 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
1355 return TELEPHONY_SUCCESS;
1356 }
1357
UpdateSetPauseImageResponse(const ImsResponseInfo & info)1358 int32_t ImsCallbackStub::UpdateSetPauseImageResponse(const ImsResponseInfo &info)
1359 {
1360 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetPauseImageResponse entry");
1361 CellularCallEventInfo eventInfo;
1362 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
1363 if (info.error != ImsErrType::IMS_SUCCESS) {
1364 eventInfo.eventId = RequestResultEventId::RESULT_SET_PAUSE_IMAGE_FAILED;
1365 } else {
1366 eventInfo.eventId = RequestResultEventId::RESULT_SET_PAUSE_IMAGE_SUCCESS;
1367 }
1368 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1369 TELEPHONY_LOGE("UpdateSetPauseImageResponse return, GetInstance is nullptr");
1370 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1371 }
1372 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
1373 return TELEPHONY_SUCCESS;
1374 }
1375
UpdateSetDeviceDirectionResponse(const ImsResponseInfo & info)1376 int32_t ImsCallbackStub::UpdateSetDeviceDirectionResponse(const ImsResponseInfo &info)
1377 {
1378 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetDeviceDirectionResponse entry");
1379 CellularCallEventInfo eventInfo;
1380 eventInfo.eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE;
1381 if (info.error != ImsErrType::IMS_SUCCESS) {
1382 eventInfo.eventId = RequestResultEventId::RESULT_SET_DEVICE_DIRECTION_FAILED;
1383 } else {
1384 eventInfo.eventId = RequestResultEventId::RESULT_SET_DEVICE_DIRECTION_SUCCESS;
1385 }
1386 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1387 TELEPHONY_LOGE("UpdateSetDeviceDirectionResponse return, GetInstance is nullptr");
1388 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1389 }
1390 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportEventResultInfo(eventInfo);
1391 return TELEPHONY_SUCCESS;
1392 }
1393
UpdateSrvccStateReport(int32_t slotId,SrvccState srvccState)1394 int32_t ImsCallbackStub::UpdateSrvccStateReport(int32_t slotId, SrvccState srvccState)
1395 {
1396 TELEPHONY_LOGI("ImsCallbackStub::UpdateSrvccStateReport entry");
1397 return TELEPHONY_SUCCESS;
1398 }
1399
UpdateVtWfcReport(int32_t slotId,TransferState transferState)1400 int32_t ImsCallbackStub::UpdateVtWfcReport(int32_t slotId, TransferState transferState)
1401 {
1402 TELEPHONY_LOGI("ImsCallbackStub::UpdateVtWfcReport entry");
1403 return TELEPHONY_SUCCESS;
1404 }
1405
UpdateSetMuteResponse(const MuteControlResponse & response)1406 int32_t ImsCallbackStub::UpdateSetMuteResponse(const MuteControlResponse &response)
1407 {
1408 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetMuteResponse entry");
1409 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1410 TELEPHONY_LOGE("UpdateSetMuteResponse return, GetInstance is nullptr");
1411 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1412 }
1413 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetMuteResult(response);
1414 return TELEPHONY_SUCCESS;
1415 }
1416
UpdateGetMuteResponse(const MuteControlResponse & response)1417 int32_t ImsCallbackStub::UpdateGetMuteResponse(const MuteControlResponse &response)
1418 {
1419 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetMuteResponse entry");
1420 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1421 TELEPHONY_LOGE("UpdateGetMuteResponse return, GetInstance is nullptr");
1422 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1423 }
1424 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetMuteResult(response);
1425 return TELEPHONY_SUCCESS;
1426 }
1427
UpdateGetEccCallListResponse(const EmergencyInfoList & callList)1428 int32_t ImsCallbackStub::UpdateGetEccCallListResponse(const EmergencyInfoList &callList)
1429 {
1430 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetEccCallListResponse entry");
1431 return TELEPHONY_SUCCESS;
1432 }
1433
UpdateCallRingBackResponse(const RingbackVoice & info)1434 int32_t ImsCallbackStub::UpdateCallRingBackResponse(const RingbackVoice &info)
1435 {
1436 TELEPHONY_LOGI("ImsCallbackStub::UpdateCallRingBackResponse entry");
1437 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1438 TELEPHONY_LOGE("UpdateCallRingBackResponse return, GetInstance is nullptr");
1439 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1440 }
1441 TELEPHONY_LOGI("UpdateCallRingBackResponse: report to call manager");
1442 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportCallRingBackResult(info.status);
1443 return TELEPHONY_SUCCESS;
1444 }
1445
UpdateCallFailReasonResponse(int32_t reason)1446 int32_t ImsCallbackStub::UpdateCallFailReasonResponse(int32_t reason)
1447 {
1448 TELEPHONY_LOGI("ImsCallbackStub::UpdateCallFailReasonResponse entry");
1449 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1450 TELEPHONY_LOGE("UpdateCallFailReasonResponse return, GetInstance is nullptr");
1451 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1452 }
1453 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportCallFailReason(reason);
1454 return TELEPHONY_SUCCESS;
1455 }
1456
UpdateGetClipResponse(const ClipResponse & response)1457 int32_t ImsCallbackStub::UpdateGetClipResponse(const ClipResponse &response)
1458 {
1459 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetClipResponse entry");
1460 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1461 TELEPHONY_LOGE("UpdateGetClipResponse return, GetInstance is nullptr");
1462 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1463 }
1464 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetClipResult(response);
1465 return TELEPHONY_SUCCESS;
1466 }
1467
UpdateGetClirResponse(const ClirResponse & response)1468 int32_t ImsCallbackStub::UpdateGetClirResponse(const ClirResponse &response)
1469 {
1470 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetClirResponse entry");
1471 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1472 TELEPHONY_LOGE("UpdateGetClirResponse return, GetInstance is nullptr");
1473 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1474 }
1475 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetClirResult(response);
1476 return TELEPHONY_SUCCESS;
1477 }
1478
UpdateSetClirResponse(HRilErrType errType)1479 int32_t ImsCallbackStub::UpdateSetClirResponse(HRilErrType errType)
1480 {
1481 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetClirResponse entry");
1482 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1483 TELEPHONY_LOGE("UpdateSetClirResponse return, GetInstance is nullptr");
1484 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1485 }
1486 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetClirResult(static_cast<int32_t>(errType));
1487 return TELEPHONY_SUCCESS;
1488 }
1489
UpdateGetCallTransferResponse(const CallTransferResponse & response)1490 int32_t ImsCallbackStub::UpdateGetCallTransferResponse(const CallTransferResponse &response)
1491 {
1492 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetCallTransferResponse entry");
1493 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1494 TELEPHONY_LOGE("UpdateGetCallTransferResponse return, GetInstance is nullptr");
1495 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1496 }
1497 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetTransferResult(response);
1498 return TELEPHONY_SUCCESS;
1499 }
1500
UpdateSetCallTransferResponse(HRilErrType errType)1501 int32_t ImsCallbackStub::UpdateSetCallTransferResponse(HRilErrType errType)
1502 {
1503 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetCallTransferResponse entry");
1504 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1505 TELEPHONY_LOGE("UpdateSetCallTransferResponse return, GetInstance is nullptr");
1506 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1507 }
1508 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetTransferResult(static_cast<int32_t>(errType));
1509 return TELEPHONY_SUCCESS;
1510 }
1511
UpdateGetCallRestrictionResponse(const CallRestrictionResponse & response)1512 int32_t ImsCallbackStub::UpdateGetCallRestrictionResponse(const CallRestrictionResponse &response)
1513 {
1514 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetCallRestrictionResponse entry");
1515 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1516 TELEPHONY_LOGE("UpdateGetCallRestrictionResponse return, GetInstance is nullptr");
1517 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1518 }
1519 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetRestrictionResult(response);
1520 return TELEPHONY_SUCCESS;
1521 }
1522
UpdateSetCallRestrictionResponse(HRilErrType errType)1523 int32_t ImsCallbackStub::UpdateSetCallRestrictionResponse(HRilErrType errType)
1524 {
1525 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetCallRestrictionResponse entry");
1526 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1527 TELEPHONY_LOGE("UpdateSetCallRestrictionResponse return, GetInstance is nullptr");
1528 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1529 }
1530 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetRestrictionResult(static_cast<int32_t>(errType));
1531 return TELEPHONY_SUCCESS;
1532 }
1533
UpdateGetCallWaitingResponse(const CallWaitResponse & response)1534 int32_t ImsCallbackStub::UpdateGetCallWaitingResponse(const CallWaitResponse &response)
1535 {
1536 TELEPHONY_LOGI("ImsCallbackStub::UpdateGetCallWaitingResponse entry");
1537 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1538 TELEPHONY_LOGE("UpdateGetCallWaitingResponse return, GetInstance is nullptr");
1539 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1540 }
1541 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportGetWaitingResult(response);
1542 return TELEPHONY_SUCCESS;
1543 }
1544
UpdateSetCallWaitingResponse(HRilErrType errType)1545 int32_t ImsCallbackStub::UpdateSetCallWaitingResponse(HRilErrType errType)
1546 {
1547 TELEPHONY_LOGI("ImsCallbackStub::UpdateSetCallWaitingResponse entry");
1548 if (DelayedSingleton<CellularCallRegister>::GetInstance() == nullptr) {
1549 TELEPHONY_LOGE("UpdateSetCallWaitingResponse return, GetInstance is nullptr");
1550 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1551 }
1552 DelayedSingleton<CellularCallRegister>::GetInstance()->ReportSetWaitingResult(static_cast<int32_t>(errType));
1553 return TELEPHONY_SUCCESS;
1554 }
1555 } // namespace Telephony
1556 } // namespace OHOS
1557