• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_register.h"
17 #include "telephony_errors.h"
18 
19 namespace OHOS {
20 namespace Telephony {
ImsRegister()21 ImsRegister::ImsRegister() : cellularCallBack_(nullptr) {}
22 ImsRegister::~ImsRegister() = default;
RegisterCellularCallBack(const sptr<ImsCallback> & callback)23 int32_t ImsRegister::RegisterCellularCallBack(const sptr<ImsCallback> &callback)
24 {
25     cellularCallBack_ = callback;
26     return TELEPHONY_SUCCESS;
27 }
28 
IsCallBackExists()29 bool ImsRegister::IsCallBackExists()
30 {
31     return cellularCallBack_ != nullptr;
32 }
33 
UpdateDialResponse(const ImsResponseInfo & info)34 int32_t ImsRegister::UpdateDialResponse(const ImsResponseInfo &info)
35 {
36     TELEPHONY_LOGI("UpdateDialResponse entry");
37     if (cellularCallBack_ == nullptr) {
38         TELEPHONY_LOGE("UpdateDialResponse return, cellularCallBack_ is nullptr, report fail!");
39         return TELEPHONY_ERR_LOCAL_PTR_NULL;
40     }
41     cellularCallBack_->UpdateDialResponse(info);
42     return TELEPHONY_SUCCESS;
43 }
44 
UpdateHangUpResponse(const ImsResponseInfo & info)45 int32_t ImsRegister::UpdateHangUpResponse(const ImsResponseInfo &info)
46 {
47     TELEPHONY_LOGI("UpdateHangUpResponse entry");
48     if (cellularCallBack_ == nullptr) {
49         TELEPHONY_LOGE("UpdateHangUpResponse return, cellularCallBack_ is nullptr, report fail!");
50         return TELEPHONY_ERR_LOCAL_PTR_NULL;
51     }
52     cellularCallBack_->UpdateHangUpResponse(info);
53     return TELEPHONY_SUCCESS;
54 }
55 
UpdateRejectResponse(const ImsResponseInfo & info)56 int32_t ImsRegister::UpdateRejectResponse(const ImsResponseInfo &info)
57 {
58     TELEPHONY_LOGI("UpdateRejectResponse entry");
59     if (cellularCallBack_ == nullptr) {
60         TELEPHONY_LOGE("UpdateRejectResponse return, cellularCallBack_ is nullptr, report fail!");
61         return TELEPHONY_ERR_LOCAL_PTR_NULL;
62     }
63     cellularCallBack_->UpdateRejectResponse(info);
64     return TELEPHONY_SUCCESS;
65 }
66 
UpdateAnswerResponse(const ImsResponseInfo & info)67 int32_t ImsRegister::UpdateAnswerResponse(const ImsResponseInfo &info)
68 {
69     TELEPHONY_LOGI("UpdateAnswerResponse entry");
70     if (cellularCallBack_ == nullptr) {
71         TELEPHONY_LOGE("UpdateAnswerResponse return, cellularCallBack_ is nullptr, report fail!");
72         return TELEPHONY_ERR_LOCAL_PTR_NULL;
73     }
74     cellularCallBack_->UpdateAnswerResponse(info);
75     return TELEPHONY_SUCCESS;
76 }
77 
UpdateHoldResponse(const ImsResponseInfo & info)78 int32_t ImsRegister::UpdateHoldResponse(const ImsResponseInfo &info)
79 {
80     TELEPHONY_LOGI("UpdateHoldResponse entry");
81     if (cellularCallBack_ == nullptr) {
82         TELEPHONY_LOGE("UpdateHoldResponse return, cellularCallBack_ is nullptr, report fail!");
83         return TELEPHONY_ERR_LOCAL_PTR_NULL;
84     }
85     cellularCallBack_->UpdateHoldResponse(info);
86     return TELEPHONY_SUCCESS;
87 }
88 
UpdateUnHoldResponse(const ImsResponseInfo & info)89 int32_t ImsRegister::UpdateUnHoldResponse(const ImsResponseInfo &info)
90 {
91     TELEPHONY_LOGI("UpdateUnHoldResponse entry");
92     if (cellularCallBack_ == nullptr) {
93         TELEPHONY_LOGE("UpdateUnHoldResponse return, cellularCallBack_ is nullptr, report fail!");
94         return TELEPHONY_ERR_LOCAL_PTR_NULL;
95     }
96     cellularCallBack_->UpdateUnHoldResponse(info);
97     return TELEPHONY_SUCCESS;
98 }
99 
UpdateSwitchResponse(const ImsResponseInfo & info)100 int32_t ImsRegister::UpdateSwitchResponse(const ImsResponseInfo &info)
101 {
102     TELEPHONY_LOGI("UpdateSwitchResponse entry");
103     if (cellularCallBack_ == nullptr) {
104         TELEPHONY_LOGE("UpdateSwitchResponse return, cellularCallBack_ is nullptr, report fail!");
105         return TELEPHONY_ERR_LOCAL_PTR_NULL;
106     }
107     cellularCallBack_->UpdateSwitchResponse(info);
108     return TELEPHONY_SUCCESS;
109 }
110 
UpdateCombineConferenceResponse(const ImsResponseInfo & info)111 int32_t ImsRegister::UpdateCombineConferenceResponse(const ImsResponseInfo &info)
112 {
113     TELEPHONY_LOGI("UpdateCombineConferenceResponse entry");
114     if (cellularCallBack_ == nullptr) {
115         TELEPHONY_LOGE("UpdateCombineConferenceResponse return, cellularCallBack_ is nullptr, report fail!");
116         return TELEPHONY_ERR_LOCAL_PTR_NULL;
117     }
118     cellularCallBack_->UpdateCombineConferenceResponse(info);
119     return TELEPHONY_SUCCESS;
120 }
121 
UpdateInviteToConferenceResponse(const ImsResponseInfo & info)122 int32_t ImsRegister::UpdateInviteToConferenceResponse(const ImsResponseInfo &info)
123 {
124     TELEPHONY_LOGI("UpdateInviteToConferenceResponse entry");
125     if (cellularCallBack_ == nullptr) {
126         TELEPHONY_LOGE("UpdateInviteToConferenceResponse return, cellularCallBack_ is nullptr, report fail!");
127         return TELEPHONY_ERR_LOCAL_PTR_NULL;
128     }
129     cellularCallBack_->UpdateInviteToConferenceResponse(info);
130     return TELEPHONY_SUCCESS;
131 }
132 
UpdateKickOutFromConferenceResponse(const ImsResponseInfo & info)133 int32_t ImsRegister::UpdateKickOutFromConferenceResponse(const ImsResponseInfo &info)
134 {
135     TELEPHONY_LOGI("UpdateKickOutFromConferenceResponse entry");
136     if (cellularCallBack_ == nullptr) {
137         TELEPHONY_LOGE("UpdateKickOutFromConferenceResponse return, cellularCallBack_ is nullptr, report fail!");
138         return TELEPHONY_ERR_LOCAL_PTR_NULL;
139     }
140     cellularCallBack_->UpdateKickOutFromConferenceResponse(info);
141     return TELEPHONY_SUCCESS;
142 }
143 
UpdateCallMediaModeResponse(const ImsResponseInfo & info)144 int32_t ImsRegister::UpdateCallMediaModeResponse(const ImsResponseInfo &info)
145 {
146     TELEPHONY_LOGI("UpdateCallMediaModeResponse entry");
147     if (cellularCallBack_ == nullptr) {
148         TELEPHONY_LOGE("UpdateCallMediaModeResponse return, cellularCallBack_ is nullptr, report fail!");
149         return TELEPHONY_ERR_LOCAL_PTR_NULL;
150     }
151     cellularCallBack_->UpdateCallMediaModeResponse(info);
152     return TELEPHONY_SUCCESS;
153 }
154 
UpdateIsEmergencyPhoneNumberResponse(const ImsResponseInfo & info)155 int32_t ImsRegister::UpdateIsEmergencyPhoneNumberResponse(const ImsResponseInfo &info)
156 {
157     TELEPHONY_LOGI("UpdateIsEmergencyPhoneNumberResponse entry");
158     if (cellularCallBack_ == nullptr) {
159         TELEPHONY_LOGE("UpdateIsEmergencyPhoneNumberResponse return, cellularCallBack_ is nullptr, report fail!");
160         return TELEPHONY_ERR_LOCAL_PTR_NULL;
161     }
162     cellularCallBack_->UpdateIsEmergencyPhoneNumberResponse(info);
163     return TELEPHONY_SUCCESS;
164 }
165 
UpdateIsEmergencyPhoneNumberResponse(bool value)166 int32_t ImsRegister::UpdateIsEmergencyPhoneNumberResponse(bool value)
167 {
168     TELEPHONY_LOGI("UpdateIsEmergencyPhoneNumberResponse entry");
169     if (cellularCallBack_ == nullptr) {
170         TELEPHONY_LOGE("UpdateIsEmergencyPhoneNumberResponse return, cellularCallBack_ is nullptr, report fail!");
171         return TELEPHONY_ERR_LOCAL_PTR_NULL;
172     }
173     cellularCallBack_->UpdateIsEmergencyPhoneNumberResponse(value);
174     return TELEPHONY_SUCCESS;
175 }
176 
UpdateStartDtmfResponse(const ImsResponseInfo & info)177 int32_t ImsRegister::UpdateStartDtmfResponse(const ImsResponseInfo &info)
178 {
179     TELEPHONY_LOGI("UpdateStartDtmfResponse entry");
180     if (cellularCallBack_ == nullptr) {
181         TELEPHONY_LOGE("UpdateStartDtmfResponse return, cellularCallBack_ is nullptr, report fail!");
182         return TELEPHONY_ERR_LOCAL_PTR_NULL;
183     }
184     cellularCallBack_->UpdateStartDtmfResponse(info);
185     return TELEPHONY_SUCCESS;
186 }
187 
UpdateSendDtmfResponse(const ImsResponseInfo & info)188 int32_t ImsRegister::UpdateSendDtmfResponse(const ImsResponseInfo &info)
189 {
190     TELEPHONY_LOGI("UpdateSendDtmfResponse entry");
191     if (cellularCallBack_ == nullptr) {
192         TELEPHONY_LOGE("UpdateSendDtmfResponse return, cellularCallBack_ is nullptr, report fail!");
193         return TELEPHONY_ERR_LOCAL_PTR_NULL;
194     }
195     cellularCallBack_->UpdateSendDtmfResponse(info);
196     return TELEPHONY_SUCCESS;
197 }
198 
UpdateStopDtmfResponse(const ImsResponseInfo & info)199 int32_t ImsRegister::UpdateStopDtmfResponse(const ImsResponseInfo &info)
200 {
201     TELEPHONY_LOGI("UpdateStopDtmfResponse entry");
202     if (cellularCallBack_ == nullptr) {
203         TELEPHONY_LOGE("UpdateStopDtmfResponse return, cellularCallBack_ is nullptr, report fail!");
204         return TELEPHONY_ERR_LOCAL_PTR_NULL;
205     }
206     cellularCallBack_->UpdateStopDtmfResponse(info);
207     return TELEPHONY_SUCCESS;
208 }
209 
UpdateStartRttResponse(const ImsResponseInfo & info)210 int32_t ImsRegister::UpdateStartRttResponse(const ImsResponseInfo &info)
211 {
212     TELEPHONY_LOGI("UpdateStartRttResponse entry");
213     if (cellularCallBack_ == nullptr) {
214         TELEPHONY_LOGE("UpdateStartRttResponse return, cellularCallBack_ is nullptr, report fail!");
215         return TELEPHONY_ERR_LOCAL_PTR_NULL;
216     }
217     cellularCallBack_->UpdateStartRttResponse(info);
218     return TELEPHONY_SUCCESS;
219 }
220 
UpdateStopRttResponse(const ImsResponseInfo & info)221 int32_t ImsRegister::UpdateStopRttResponse(const ImsResponseInfo &info)
222 {
223     TELEPHONY_LOGI("UpdateStopRttResponse entry");
224     if (cellularCallBack_ == nullptr) {
225         TELEPHONY_LOGE("UpdateStopRttResponse return, cellularCallBack_ is nullptr, report fail!");
226         return TELEPHONY_ERR_LOCAL_PTR_NULL;
227     }
228     cellularCallBack_->UpdateStopRttResponse(info);
229     return TELEPHONY_SUCCESS;
230 }
231 
UpdateCallStatusResponse(int32_t slotId)232 int32_t ImsRegister::UpdateCallStatusResponse(int32_t slotId)
233 {
234     TELEPHONY_LOGI("UpdateCallStatusResponse entry");
235     if (cellularCallBack_ == nullptr) {
236         TELEPHONY_LOGE("UpdateCallStatusResponse return, cellularCallBack_ is nullptr, report fail!");
237         return TELEPHONY_ERR_LOCAL_PTR_NULL;
238     }
239     cellularCallBack_->UpdateCallStatusResponse(slotId);
240     return TELEPHONY_SUCCESS;
241 }
242 
UpdateServiceStatusResponse(int32_t slotId,const CallImsServiceStatus & callImsServiceStatus)243 int32_t ImsRegister::UpdateServiceStatusResponse(int32_t slotId, const CallImsServiceStatus &callImsServiceStatus)
244 {
245     TELEPHONY_LOGI("UpdateServiceStatusResponse entry");
246     if (cellularCallBack_ == nullptr) {
247         TELEPHONY_LOGE("UpdateServiceStatusResponse return, cellularCallBack_ is nullptr, report fail!");
248         return TELEPHONY_ERR_LOCAL_PTR_NULL;
249     }
250     cellularCallBack_->UpdateServiceStatusResponse(slotId, callImsServiceStatus);
251     return TELEPHONY_SUCCESS;
252 }
253 
UpdateSetPreModeResponse(int32_t slotId,const ImsResponseInfo & info)254 int32_t ImsRegister::UpdateSetPreModeResponse(int32_t slotId, const ImsResponseInfo &info)
255 {
256     TELEPHONY_LOGI("UpdateSetPreModeResponse entry");
257     if (cellularCallBack_ == nullptr) {
258         TELEPHONY_LOGE("UpdateSetPreModeResponse return, cellularCallBack_ is nullptr, report fail!");
259         return TELEPHONY_ERR_LOCAL_PTR_NULL;
260     }
261     cellularCallBack_->UpdateSetPreModeResponse(slotId, info);
262     return TELEPHONY_SUCCESS;
263 }
264 
UpdateGetPreModeResponse(const ImsResponseInfo & info)265 int32_t ImsRegister::UpdateGetPreModeResponse(const ImsResponseInfo &info)
266 {
267     TELEPHONY_LOGI("UpdateGetPreModeResponse entry");
268     if (cellularCallBack_ == nullptr) {
269         TELEPHONY_LOGE("UpdateGetPreModeResponse return, cellularCallBack_ is nullptr, report fail!");
270         return TELEPHONY_ERR_LOCAL_PTR_NULL;
271     }
272     cellularCallBack_->UpdateGetPreModeResponse(info);
273     return TELEPHONY_SUCCESS;
274 }
275 
UpdateGetPreModeResponse(int32_t slotId,int32_t mode)276 int32_t ImsRegister::UpdateGetPreModeResponse(int32_t slotId, int32_t mode)
277 {
278     TELEPHONY_LOGI("UpdateGetPreModeResponse entry");
279     if (cellularCallBack_ == nullptr) {
280         TELEPHONY_LOGE("UpdateGetPreModeResponse return, cellularCallBack_ is nullptr, report fail!");
281         return TELEPHONY_ERR_LOCAL_PTR_NULL;
282     }
283     cellularCallBack_->UpdateGetPreModeResponse(slotId, mode);
284     return TELEPHONY_SUCCESS;
285 }
286 
UpdateSetImsSwitchResponse(const ImsResponseInfo & info)287 int32_t ImsRegister::UpdateSetImsSwitchResponse(const ImsResponseInfo &info)
288 {
289     TELEPHONY_LOGI("UpdateSetImsSwitchResponse entry");
290     if (cellularCallBack_ == nullptr) {
291         TELEPHONY_LOGE("UpdateSetImsSwitchResponse return, cellularCallBack_ is nullptr, report fail!");
292         return TELEPHONY_ERR_LOCAL_PTR_NULL;
293     }
294     cellularCallBack_->UpdateSetImsSwitchResponse(info);
295     return TELEPHONY_SUCCESS;
296 }
297 
UpdateGetImsSwitchResponse(const ImsResponseInfo & info)298 int32_t ImsRegister::UpdateGetImsSwitchResponse(const ImsResponseInfo &info)
299 {
300     TELEPHONY_LOGI("UpdateGetImsSwitchResponse entry");
301     if (cellularCallBack_ == nullptr) {
302         TELEPHONY_LOGE("UpdateGetImsSwitchResponse return, cellularCallBack_ is nullptr, report fail!");
303         return TELEPHONY_ERR_LOCAL_PTR_NULL;
304     }
305     cellularCallBack_->UpdateGetImsSwitchResponse(info);
306     return TELEPHONY_SUCCESS;
307 }
308 
UpdateGetImsSwitchResponse(int32_t slotId,int32_t active)309 int32_t ImsRegister::UpdateGetImsSwitchResponse(int32_t slotId, int32_t active)
310 {
311     TELEPHONY_LOGI("UpdateGetImsSwitchResponse entry");
312     if (cellularCallBack_ == nullptr) {
313         TELEPHONY_LOGE("UpdateGetImsSwitchResponse return, cellularCallBack_ is nullptr, report fail!");
314         return TELEPHONY_ERR_LOCAL_PTR_NULL;
315     }
316     cellularCallBack_->UpdateGetImsSwitchResponse(slotId, active);
317     return TELEPHONY_SUCCESS;
318 }
319 
UpdateImsCallsDataResponse(const ImsResponseInfo & info)320 int32_t ImsRegister::UpdateImsCallsDataResponse(const ImsResponseInfo &info)
321 {
322     TELEPHONY_LOGI("UpdateImsCallsDataResponse entry");
323     if (cellularCallBack_ == nullptr) {
324         TELEPHONY_LOGE("UpdateImsCallsDataResponse return, cellularCallBack_ is nullptr, report fail!");
325         return TELEPHONY_ERR_LOCAL_PTR_NULL;
326     }
327     cellularCallBack_->UpdateImsCallsDataResponse(info);
328     return TELEPHONY_SUCCESS;
329 }
330 
UpdateImsCallsDataResponse(int32_t slotId,const CallInfoList & callList)331 int32_t ImsRegister::UpdateImsCallsDataResponse(int32_t slotId, const CallInfoList &callList)
332 {
333     TELEPHONY_LOGI("UpdateImsCallsDataResponse entry");
334     if (cellularCallBack_ == nullptr) {
335         TELEPHONY_LOGE("UpdateImsCallsDataResponse return, cellularCallBack_ is nullptr, report fail!");
336         return TELEPHONY_ERR_LOCAL_PTR_NULL;
337     }
338     cellularCallBack_->UpdateImsCallsDataResponse(slotId, callList);
339     return TELEPHONY_SUCCESS;
340 }
341 
UpdateSetImsConfigResponse(const ImsResponseInfo & info)342 int32_t ImsRegister::UpdateSetImsConfigResponse(const ImsResponseInfo &info)
343 {
344     TELEPHONY_LOGI("UpdateSetImsConfigResponse entry");
345     if (cellularCallBack_ == nullptr) {
346         TELEPHONY_LOGE("UpdateSetImsConfigResponse return, cellularCallBack_ is nullptr, report fail!");
347         return TELEPHONY_ERR_LOCAL_PTR_NULL;
348     }
349     cellularCallBack_->UpdateSetImsConfigResponse(info);
350     return TELEPHONY_SUCCESS;
351 }
352 
UpdateGetImsConfigResponse(int32_t value)353 int32_t ImsRegister::UpdateGetImsConfigResponse(int32_t value)
354 {
355     TELEPHONY_LOGI("UpdateGetImsConfigResponse int entry");
356     if (cellularCallBack_ == nullptr) {
357         TELEPHONY_LOGE("UpdateGetImsConfigResponse return, cellularCallBack_ is nullptr, report fail!");
358         return TELEPHONY_ERR_LOCAL_PTR_NULL;
359     }
360     cellularCallBack_->UpdateGetImsConfigResponse(value);
361     return TELEPHONY_SUCCESS;
362 }
363 
UpdateGetImsConfigResponse(const ImsResponseInfo & info)364 int32_t ImsRegister::UpdateGetImsConfigResponse(const ImsResponseInfo &info)
365 {
366     TELEPHONY_LOGI("UpdateGetImsConfigResponse entry");
367     if (cellularCallBack_ == nullptr) {
368         TELEPHONY_LOGE("UpdateGetImsConfigResponse return, cellularCallBack_ is nullptr, report fail!");
369         return TELEPHONY_ERR_LOCAL_PTR_NULL;
370     }
371     cellularCallBack_->UpdateGetImsConfigResponse(info);
372     return TELEPHONY_SUCCESS;
373 }
374 
UpdateSetImsFeatureValueResponse(const ImsResponseInfo & info)375 int32_t ImsRegister::UpdateSetImsFeatureValueResponse(const ImsResponseInfo &info)
376 {
377     TELEPHONY_LOGI("UpdateSetImsFeatureValueResponse entry");
378     if (cellularCallBack_ == nullptr) {
379         TELEPHONY_LOGE("UpdateSetImsFeatureValueResponse return, cellularCallBack_ is nullptr, report fail!");
380         return TELEPHONY_ERR_LOCAL_PTR_NULL;
381     }
382     cellularCallBack_->UpdateSetImsFeatureValueResponse(info);
383     return TELEPHONY_SUCCESS;
384 }
385 
UpdateGetImsFeatureValueResponse(int32_t value)386 int32_t ImsRegister::UpdateGetImsFeatureValueResponse(int32_t value)
387 {
388     TELEPHONY_LOGI("UpdateGetImsFeatureValueResponse int entry");
389     if (cellularCallBack_ == nullptr) {
390         TELEPHONY_LOGE("UpdateGetImsFeatureValueResponse return, cellularCallBack_ is nullptr, report fail!");
391         return TELEPHONY_ERR_LOCAL_PTR_NULL;
392     }
393     cellularCallBack_->UpdateGetImsFeatureValueResponse(value);
394     return TELEPHONY_SUCCESS;
395 }
396 
UpdateGetImsFeatureValueResponse(const ImsResponseInfo & info)397 int32_t ImsRegister::UpdateGetImsFeatureValueResponse(const ImsResponseInfo &info)
398 {
399     TELEPHONY_LOGI("UpdateGetImsFeatureValueResponse entry");
400     if (cellularCallBack_ == nullptr) {
401         TELEPHONY_LOGE("UpdateGetImsFeatureValueResponse return, cellularCallBack_ is nullptr, report fail!");
402         return TELEPHONY_ERR_LOCAL_PTR_NULL;
403     }
404     cellularCallBack_->UpdateGetImsFeatureValueResponse(info);
405     return TELEPHONY_SUCCESS;
406 }
407 
UpdateSetImsSwitchEnhanceModeResponse(const ImsResponseInfo & info)408 int32_t ImsRegister::UpdateSetImsSwitchEnhanceModeResponse(const ImsResponseInfo &info)
409 {
410     TELEPHONY_LOGI("UpdateSetImsSwitchEnhanceModeResponse entry");
411     if (cellularCallBack_ == nullptr) {
412         TELEPHONY_LOGE("UpdateSetImsSwitchEnhanceModeResponse return, cellularCallBack_ is nullptr, report fail!");
413         return TELEPHONY_ERR_LOCAL_PTR_NULL;
414     }
415     cellularCallBack_->UpdateSetImsSwitchEnhanceModeResponse(info);
416     return TELEPHONY_SUCCESS;
417 }
418 
UpdateGetImsSwitchEnhanceModeResponse(int32_t value)419 int32_t ImsRegister::UpdateGetImsSwitchEnhanceModeResponse(int32_t value)
420 {
421     TELEPHONY_LOGI("UpdateGetImsSwitchEnhanceModeResponse int entry");
422     if (cellularCallBack_ == nullptr) {
423         TELEPHONY_LOGE("UpdateGetImsSwitchEnhanceModeResponse return, cellularCallBack_ is nullptr, report fail!");
424         return TELEPHONY_ERR_LOCAL_PTR_NULL;
425     }
426     cellularCallBack_->UpdateGetImsSwitchEnhanceModeResponse(value);
427     return TELEPHONY_SUCCESS;
428 }
429 
UpdateGetImsSwitchEnhanceModeResponse(const ImsResponseInfo & info)430 int32_t ImsRegister::UpdateGetImsSwitchEnhanceModeResponse(const ImsResponseInfo &info)
431 {
432     TELEPHONY_LOGI("UpdateGetImsSwitchEnhanceModeResponse entry");
433     if (cellularCallBack_ == nullptr) {
434         TELEPHONY_LOGE("UpdateGetImsSwitchEnhanceModeResponse return, cellularCallBack_ is nullptr, report fail!");
435         return TELEPHONY_ERR_LOCAL_PTR_NULL;
436     }
437     cellularCallBack_->UpdateGetImsSwitchEnhanceModeResponse(info);
438     return TELEPHONY_SUCCESS;
439 }
440 
UpdateCtrlCameraResponse(const ImsResponseInfo & info)441 int32_t ImsRegister::UpdateCtrlCameraResponse(const ImsResponseInfo &info)
442 {
443     TELEPHONY_LOGI("UpdateCtrlCameraResponse entry");
444     if (cellularCallBack_ == nullptr) {
445         TELEPHONY_LOGE("UpdateCtrlCameraResponse return, cellularCallBack_ is nullptr, report fail!");
446         return TELEPHONY_ERR_LOCAL_PTR_NULL;
447     }
448     cellularCallBack_->UpdateCtrlCameraResponse(info);
449     return TELEPHONY_SUCCESS;
450 }
451 
UpdateSetPreviewWindowResponse(const ImsResponseInfo & info)452 int32_t ImsRegister::UpdateSetPreviewWindowResponse(const ImsResponseInfo &info)
453 {
454     TELEPHONY_LOGI("UpdateSetPreviewWindowResponse entry");
455     if (cellularCallBack_ == nullptr) {
456         TELEPHONY_LOGE("UpdateSetPreviewWindowResponse return, cellularCallBack_ is nullptr, report fail!");
457         return TELEPHONY_ERR_LOCAL_PTR_NULL;
458     }
459     cellularCallBack_->UpdateSetPreviewWindowResponse(info);
460     return TELEPHONY_SUCCESS;
461 }
462 
UpdateSetDisplayWindowResponse(const ImsResponseInfo & info)463 int32_t ImsRegister::UpdateSetDisplayWindowResponse(const ImsResponseInfo &info)
464 {
465     TELEPHONY_LOGI("UpdateSetDisplayWindowResponse entry");
466     if (cellularCallBack_ == nullptr) {
467         TELEPHONY_LOGE("UpdateSetDisplayWindowResponse return, cellularCallBack_ is nullptr, report fail!");
468         return TELEPHONY_ERR_LOCAL_PTR_NULL;
469     }
470     cellularCallBack_->UpdateSetDisplayWindowResponse(info);
471     return TELEPHONY_SUCCESS;
472 }
473 
UpdateSetCameraZoomResponse(const ImsResponseInfo & info)474 int32_t ImsRegister::UpdateSetCameraZoomResponse(const ImsResponseInfo &info)
475 {
476     TELEPHONY_LOGI("UpdateSetCameraZoomResponse entry");
477     if (cellularCallBack_ == nullptr) {
478         TELEPHONY_LOGE("UpdateSetCameraZoomResponse return, cellularCallBack_ is nullptr, report fail!");
479         return TELEPHONY_ERR_LOCAL_PTR_NULL;
480     }
481     cellularCallBack_->UpdateSetCameraZoomResponse(info);
482     return TELEPHONY_SUCCESS;
483 }
484 
UpdateSetPauseImageResponse(const ImsResponseInfo & info)485 int32_t ImsRegister::UpdateSetPauseImageResponse(const ImsResponseInfo &info)
486 {
487     TELEPHONY_LOGI("UpdateSetPauseImageResponse entry");
488     if (cellularCallBack_ == nullptr) {
489         TELEPHONY_LOGE("UpdateSetPauseImageResponse return, cellularCallBack_ is nullptr, report fail!");
490         return TELEPHONY_ERR_LOCAL_PTR_NULL;
491     }
492     cellularCallBack_->UpdateSetPauseImageResponse(info);
493     return TELEPHONY_SUCCESS;
494 }
495 
UpdateSetDeviceDirectionResponse(const ImsResponseInfo & info)496 int32_t ImsRegister::UpdateSetDeviceDirectionResponse(const ImsResponseInfo &info)
497 {
498     TELEPHONY_LOGI("UpdateSetDeviceDirectionResponse entry");
499     if (cellularCallBack_ == nullptr) {
500         TELEPHONY_LOGE("UpdateSetDeviceDirectionResponse return, cellularCallBack_ is nullptr, report fail!");
501         return TELEPHONY_ERR_LOCAL_PTR_NULL;
502     }
503     cellularCallBack_->UpdateSetDeviceDirectionResponse(info);
504     return TELEPHONY_SUCCESS;
505 }
506 
UpdateCallRingBackResponse(const RingbackVoice & info)507 int32_t ImsRegister::UpdateCallRingBackResponse(const RingbackVoice &info)
508 {
509     TELEPHONY_LOGI("UpdateCallRingBackResponse entry");
510     if (cellularCallBack_ == nullptr) {
511         TELEPHONY_LOGE("UpdateCallRingBackResponse return, cellularCallBack_ is nullptr, report fail!");
512         return TELEPHONY_ERR_LOCAL_PTR_NULL;
513     }
514     cellularCallBack_->UpdateCallRingBackResponse(info);
515     return TELEPHONY_SUCCESS;
516 }
517 
UpdateSetMuteResponse(const MuteControlResponse & response)518 int32_t ImsRegister::UpdateSetMuteResponse(const MuteControlResponse &response)
519 {
520     TELEPHONY_LOGI("UpdateSetMuteResponse entry");
521     if (cellularCallBack_ == nullptr) {
522         TELEPHONY_LOGE("UpdateSetMuteResponse return, cellularCallBack_ is nullptr, report fail!");
523         return TELEPHONY_ERR_LOCAL_PTR_NULL;
524     }
525     cellularCallBack_->UpdateSetMuteResponse(response);
526     return TELEPHONY_SUCCESS;
527 }
528 
UpdateGetMuteResponse(const MuteControlResponse & response)529 int32_t ImsRegister::UpdateGetMuteResponse(const MuteControlResponse &response)
530 {
531     TELEPHONY_LOGI("UpdateGetMuteResponse entry");
532     if (cellularCallBack_ == nullptr) {
533         TELEPHONY_LOGE("UpdateGetMuteResponse return, cellularCallBack_ is nullptr, report fail!");
534         return TELEPHONY_ERR_LOCAL_PTR_NULL;
535     }
536     cellularCallBack_->UpdateGetMuteResponse(response);
537     return TELEPHONY_SUCCESS;
538 }
539 
UpdateGetEccCallListResponse(const EmergencyInfoList & callList)540 int32_t ImsRegister::UpdateGetEccCallListResponse(const EmergencyInfoList &callList)
541 {
542     TELEPHONY_LOGI("UpdateGetEccCallListResponse entry");
543     if (cellularCallBack_ == nullptr) {
544         TELEPHONY_LOGE("UpdateGetEccCallListResponse return, cellularCallBack_ is nullptr, report fail!");
545         return TELEPHONY_ERR_LOCAL_PTR_NULL;
546     }
547     cellularCallBack_->UpdateGetEccCallListResponse(callList);
548     return TELEPHONY_SUCCESS;
549 }
550 
UpdateCallFailReasonResponse(int32_t reason)551 int32_t ImsRegister::UpdateCallFailReasonResponse(int32_t reason)
552 {
553     TELEPHONY_LOGI("UpdateCallFailReasonResponse entry");
554     if (cellularCallBack_ == nullptr) {
555         TELEPHONY_LOGE("UpdateCallFailReasonResponse return, cellularCallBack_ is nullptr, report fail!");
556         return TELEPHONY_ERR_LOCAL_PTR_NULL;
557     }
558     cellularCallBack_->UpdateCallFailReasonResponse(reason);
559     return TELEPHONY_SUCCESS;
560 }
561 
UpdateGetClipResponse(const ClipResponse & response)562 int32_t ImsRegister::UpdateGetClipResponse(const ClipResponse &response)
563 {
564     TELEPHONY_LOGI("UpdateGetClipResponse entry");
565     if (cellularCallBack_ == nullptr) {
566         TELEPHONY_LOGE("UpdateGetClipResponse return, cellularCallBack_ is nullptr, report fail!");
567         return TELEPHONY_ERR_LOCAL_PTR_NULL;
568     }
569     cellularCallBack_->UpdateGetClipResponse(response);
570     return TELEPHONY_SUCCESS;
571 }
572 
UpdateGetClirResponse(const ClirResponse & response)573 int32_t ImsRegister::UpdateGetClirResponse(const ClirResponse &response)
574 {
575     TELEPHONY_LOGI("UpdateGetClirResponse entry");
576     if (cellularCallBack_ == nullptr) {
577         TELEPHONY_LOGE("UpdateGetClirResponse return, cellularCallBack_ is nullptr, report fail!");
578         return TELEPHONY_ERR_LOCAL_PTR_NULL;
579     }
580     cellularCallBack_->UpdateGetClirResponse(response);
581     return TELEPHONY_SUCCESS;
582 }
583 
UpdateSetClirResponse(HRilErrType errType)584 int32_t ImsRegister::UpdateSetClirResponse(HRilErrType errType)
585 {
586     TELEPHONY_LOGI("UpdateSetClirResponse entry");
587     if (cellularCallBack_ == nullptr) {
588         TELEPHONY_LOGE("UpdateSetClirResponse return, cellularCallBack_ is nullptr, report fail!");
589         return TELEPHONY_ERR_LOCAL_PTR_NULL;
590     }
591     cellularCallBack_->UpdateSetClirResponse(errType);
592     return TELEPHONY_SUCCESS;
593 }
594 
UpdateGetCallTransferResponse(const CallTransferResponse & response)595 int32_t ImsRegister::UpdateGetCallTransferResponse(const CallTransferResponse &response)
596 {
597     TELEPHONY_LOGI("UpdateGetCallTransferResponse entry");
598     if (cellularCallBack_ == nullptr) {
599         TELEPHONY_LOGE("UpdateGetCallTransferResponse return, cellularCallBack_ is nullptr, report fail!");
600         return TELEPHONY_ERR_LOCAL_PTR_NULL;
601     }
602     cellularCallBack_->UpdateGetCallTransferResponse(response);
603     return TELEPHONY_SUCCESS;
604 }
605 
UpdateSetCallTransferResponse(HRilErrType errType)606 int32_t ImsRegister::UpdateSetCallTransferResponse(HRilErrType errType)
607 {
608     TELEPHONY_LOGI("UpdateSetCallTransferResponse entry");
609     if (cellularCallBack_ == nullptr) {
610         TELEPHONY_LOGE("UpdateSetCallTransferResponse return, cellularCallBack_ is nullptr, report fail!");
611         return TELEPHONY_ERR_LOCAL_PTR_NULL;
612     }
613     cellularCallBack_->UpdateSetCallTransferResponse(errType);
614     return TELEPHONY_SUCCESS;
615 }
616 
UpdateGetCallRestrictionResponse(const CallRestrictionResponse & response)617 int32_t ImsRegister::UpdateGetCallRestrictionResponse(const CallRestrictionResponse &response)
618 {
619     TELEPHONY_LOGI("UpdateGetCallRestrictionResponse entry");
620     if (cellularCallBack_ == nullptr) {
621         TELEPHONY_LOGE("UpdateGetCallRestrictionResponse return, cellularCallBack_ is nullptr, report fail!");
622         return TELEPHONY_ERR_LOCAL_PTR_NULL;
623     }
624     cellularCallBack_->UpdateGetCallRestrictionResponse(response);
625     return TELEPHONY_SUCCESS;
626 }
627 
UpdateSetCallRestrictionResponse(HRilErrType errType)628 int32_t ImsRegister::UpdateSetCallRestrictionResponse(HRilErrType errType)
629 {
630     TELEPHONY_LOGI("UpdateSetCallRestrictionResponse entry");
631     if (cellularCallBack_ == nullptr) {
632         TELEPHONY_LOGE("UpdateSetCallRestrictionResponse return, cellularCallBack_ is nullptr, report fail!");
633         return TELEPHONY_ERR_LOCAL_PTR_NULL;
634     }
635     cellularCallBack_->UpdateSetCallRestrictionResponse(errType);
636     return TELEPHONY_SUCCESS;
637 }
638 
UpdateGetCallWaitingResponse(const CallWaitResponse & response)639 int32_t ImsRegister::UpdateGetCallWaitingResponse(const CallWaitResponse &response)
640 {
641     TELEPHONY_LOGI("UpdateGetCallWaitingResponse entry");
642     if (cellularCallBack_ == nullptr) {
643         TELEPHONY_LOGE("UpdateGetCallWaitingResponse return, cellularCallBack_ is nullptr, report fail!");
644         return TELEPHONY_ERR_LOCAL_PTR_NULL;
645     }
646     cellularCallBack_->UpdateGetCallWaitingResponse(response);
647     return TELEPHONY_SUCCESS;
648 }
649 
UpdateSetCallWaitingResponse(HRilErrType errType)650 int32_t ImsRegister::UpdateSetCallWaitingResponse(HRilErrType errType)
651 {
652     TELEPHONY_LOGI("UpdateSetCallWaitingResponse entry");
653     if (cellularCallBack_ == nullptr) {
654         TELEPHONY_LOGE("UpdateSetCallWaitingResponse return, cellularCallBack_ is nullptr, report fail!");
655         return TELEPHONY_ERR_LOCAL_PTR_NULL;
656     }
657     cellularCallBack_->UpdateSetCallWaitingResponse(errType);
658     return TELEPHONY_SUCCESS;
659 }
660 } // namespace Telephony
661 } // namespace OHOS