• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef TELEPHONY_IMS_CALL_CLIENT_H
17 #define TELEPHONY_IMS_CALL_CLIENT_H
18 
19 #include "event_runner.h"
20 #include "ims_call_interface.h"
21 #include "ims_core_service_interface.h"
22 #include "iremote_stub.h"
23 #include "rwlock.h"
24 #include "singleton.h"
25 #include "system_ability_status_change_stub.h"
26 
27 namespace OHOS {
28 namespace Telephony {
29 class ImsCallClient {
30     DECLARE_DELAYED_SINGLETON(ImsCallClient);
31 
32 public:
33     /**
34      * @brief Get ImsCall Remote Object ptr
35      *
36      * @return sptr<ImsCallInterface>
37      */
38     sptr<ImsCallInterface> GetImsCallProxy();
39 
40     /**
41      * @brief Get the remote object ptr, initiate a listener and subscribe the system ability
42      */
43     void Init();
44 
45     /**
46      * @brief Clear the listener and the remote ptr when destroy the ImsCallClient Object
47      */
48     void UnInit();
49 
50     /**
51      * @brief Register ImsCallCallback Handler, put the handler and slot id into {handlerMap_}
52      *
53      * @param slotId Indicates the card slot index number,
54      * @param handler Indicates the event handler ptr
55      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
56      */
57     int32_t RegisterImsCallCallbackHandler(int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
58 
59     /**
60      * @brief Get the event handler ptr from {handlerMap_}
61      *
62      * @param slotId Indicates the card slot index number,
63      * @return AppExecFwk::EventHandler
64      */
65     std::shared_ptr<AppExecFwk::EventHandler> GetHandler(int32_t slotId);
66 
67     /****************** call basic ******************/
68     /**
69      * @brief IMS dial the call interface
70      *
71      * @param ImsCallInfo Indicates the call detail information, contains phone number, slot id,
72      * video state, call index
73      * @param CLIRMode Indicates the CLIR mode, like default, transfer, inhibition
74      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
75      */
76     int32_t Dial(const ImsCallInfo &callInfo, CLIRMode mode);
77 
78     /**
79      * @brief IMS HangUp the call interface
80      *
81      * @param ImsCallInfo Indicates the call detail information, contains phone number, slot id,
82      * video state, call index
83      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
84      */
85     int32_t HangUp(const ImsCallInfo &callInfo);
86 
87     /**
88      * @brief IMS Reject the call interface
89      *
90      * @param ImsCallInfo Indicates the call detail information, contains phone number, slot id,
91      * video state, call index
92      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
93      */
94     int32_t Reject(const ImsCallInfo &callInfo);
95 
96     /**
97      * @brief IMS Reject the call with reason interface
98      *
99      * @param ImsCallInfo Indicates the call detail information, contains phone number, slot id,
100      * video state, call index
101      * @param ImsRejectReason Indicated the reject reason, like user is busy or user decline
102      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
103      */
104     int32_t RejectWithReason(const ImsCallInfo &callInfo, const ImsRejectReason &reason);
105 
106     /**
107      * @brief IMS Answer the call interface
108      *
109      * @param ImsCallInfo Indicates the call detail information, contains phone number, slot id,
110      * video state, call index
111      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
112      */
113     int32_t Answer(const ImsCallInfo &callInfo);
114 
115     /**
116      * @brief Hold the Call
117      *
118      * @param slotId Indicates the card slot index number,
119      * @param callType Indicates the call type,
120      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
121      */
122     int32_t HoldCall(int32_t slotId, int32_t callType);
123 
124     /**
125      * @brief UnHold the Call
126      *
127      * @param slotId Indicates the card slot index number,
128      * @param callType Indicates the type of video state, 0: voice, 1: video
129      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
130      */
131     int32_t UnHoldCall(int32_t slotId, int32_t callType);
132 
133     /**
134      * @brief Switch the phone call between hold and unhold
135      *
136      * @param slotId Indicates the card slot index number,
137      * @param callType Indicates the type of video state, 0: voice, 1: video
138      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
139      */
140     int32_t SwitchCall(int32_t slotId, int32_t callType);
141 
142     /**
143      * @brief Merge calls to form a conference
144      *
145      * @param slotId Indicates the card slot index number,
146      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
147      */
148     int32_t CombineConference(int32_t slotId);
149 
150     /**
151      * @brief Invite someone to conference
152      *
153      * @param slotId Indicates the card slot index number,
154      * @param numberList phone number list which will be invited to the conference call
155      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
156      */
157     int32_t InviteToConference(int32_t slotId, const std::vector<std::string> &numberList);
158 
159     /**
160      * @brief Kick out someone from conference
161      *
162      * @param slotId Indicates the card slot index number,
163      * @param index which will be kicked out from the conference call
164      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
165      */
166     int32_t KickOutFromConference(int32_t slotId, int32_t index);
167 
168     /**
169      * @brief IMS SendUpdateCallMediaModeRequest interface
170      *
171      * @param ImsCallInfo Indicates the call detail information, contains phone number, slot id,
172      * video state, call index
173      * @param ImsCallType Indicates the call media mode, like audio only, send only .etc.
174      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
175      */
176     int32_t SendUpdateCallMediaModeRequest(const ImsCallInfo &callInfo, ImsCallType callType);
177 
178     /**
179      * @brief IMS SendUpdateCallMediaModeResponse interface
180      *
181      * @param ImsCallInfo Indicates the call detail information, contains phone number, slot id,
182      * video state, call index
183      * @param ImsCallType Indicates the call media mode, like audio only, send only .etc.
184      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
185      */
186     int32_t SendUpdateCallMediaModeResponse(const ImsCallInfo &callInfo, ImsCallType callType);
187 
188     /**
189      * @brief Cancel Call Upgrade
190      *
191      * @param slotId Indicates the slot id
192      * @param Indicates Indicates the call index number.
193      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
194      */
195     int32_t CancelCallUpgrade(int32_t slotId, int32_t callIndex);
196 
197     /**
198      * @brief Request Camera Capabilities
199      *
200      * @param slotId Indicates the slot id
201      * @param callIndex Indicates the call index number.
202      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
203      */
204     int32_t RequestCameraCapabilities(int32_t slotId, int32_t callIndex);
205 
206     /**
207      * @brief Get Ims Calls Data Request
208      *
209      * @param slotId Indicates the card slot index number,
210      * @param lastCallsDataFlag The ims call data id, is a number in milliseconds
211      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
212      */
213     int32_t GetImsCallsDataRequest(int32_t slotId, int64_t lastCallsDataFlag);
214 
215     /**
216      * @brief Get Last Call Fail Reason
217      *
218      * @param slotId Indicates the card slot index number,
219      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
220      */
221     int32_t GetLastCallFailReason(int32_t slotId);
222 
223     /****************** dtmf rtt ******************/
224     /**
225      * @brief start to paly a dtmf tone
226      *
227      * @param slotId Indicates the card slot index number,
228      * @param cDTMFCode A character indicate the DTMF digit for which to play the tone. This
229      * value must be one of {0~9}, {*} or {#}.
230      * @param index Indicates the index of command.
231      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
232      */
233     int32_t StartDtmf(int32_t slotId, char cDtmfCode, int32_t index);
234 
235     /**
236      * @brief play a dtmf tone
237      *
238      * @param slotId Indicates the card slot index number,
239      * @param cDtmfCode A character indicate the DTMF digit for which to play the tone. This
240      * value must be one of {0~9}, {*} or {#}.
241      * @param index Indicates the index of command.
242      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
243      */
244     int32_t SendDtmf(int32_t slotId, char cDtmfCode, int32_t index);
245 
246     /**
247      * @brief stop the playing dtmf tone
248      *
249      * @param slotId Indicates the card slot index number,
250      * @param index Indicates the index of command.
251      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
252      */
253     int32_t StopDtmf(int32_t slotId, int32_t index);
254 
255     /**
256      * @brief Start a RTT session
257      *
258      * @param slotId Indicates the card slot index number,
259      * @param msg the specific RTT msg
260      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
261      */
262     int32_t StartRtt(int32_t slotId, const std::string &msg);
263 
264     /**
265      * @brief Terminate the current RTT session
266      *
267      * @param slotId Indicates the card slot index number,
268      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
269      */
270     int32_t StopRtt(int32_t slotId);
271 
272     /****************** ims config ******************/
273     /**
274      * @brief Set Domain Preference Mode
275      *
276      * @param slotId Indicates the card slot index number,
277      * @param mode indicate the domain preference, 1: CS only, 2: CS prefer, 3: PS prefer, 4: PS only
278      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
279      */
280     int32_t SetDomainPreferenceMode(int32_t slotId, int32_t mode);
281 
282     /**
283      * @brief Get Domain Preference Mode
284      *
285      * @param slotId Indicates the card slot index number,
286      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
287      */
288     int32_t GetDomainPreferenceMode(int32_t slotId);
289 
290     /**
291      * @brief Set the Carrier Vt Config
292      *
293      * @param slotId Indicates the card slot index number,
294      * @param active 1: enable carrier vt, 0: disable carrier vt
295      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
296      */
297     int32_t SetCarrierVtConfig(int32_t slotId, int32_t active);
298 
299     /**
300      * @brief Set the ims switch status
301      *
302      * @param slotId Indicates the card slot index number,
303      * @param active 1: enable ims, 0: disable ims
304      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
305      */
306     int32_t SetImsSwitchStatus(int32_t slotId, int32_t active);
307 
308     /**
309      * @brief IMS GetImsSwitchStatus interface
310      *
311      * @param slotId Indicates the card slot index number,
312      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
313      */
314     int32_t GetImsSwitchStatus(int32_t slotId);
315 
316     /**
317      * @brief IMS SetImsConfig interface
318      *
319      * @param ImsConfigItem Identify specific item, like ITEM_VIDEO_QUALITY, ITEM_IMS_SWITCH_STATUS
320      * @param value The specific value corresponding to the item
321      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
322      */
323     int32_t SetImsConfig(ImsConfigItem item, const std::string &value);
324 
325     /**
326      * @brief IMS SetImsConfig interface
327      *
328      * @param ImsConfigItem Identify specific item, like ITEM_VIDEO_QUALITY, ITEM_IMS_SWITCH_STATUS
329      * @param value The specific value corresponding to the item
330      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
331      */
332     int32_t SetImsConfig(ImsConfigItem item, int32_t value);
333 
334     /**
335      * @brief IMS GetImsConfig interface
336      *
337      * @param ImsConfigItem Identify specific item, like ITEM_VIDEO_QUALITY, ITEM_IMS_SWITCH_STATUS
338      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
339      */
340     int32_t GetImsConfig(ImsConfigItem item);
341 
342     /**
343      * @brief IMS SetImsFeatureValue interface
344      *
345      * @param FeatureType the ims feature item, like VoLTE, ViLTE, SS over UT
346      * @param value The specific value corresponding to the item
347      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
348      */
349     int32_t SetImsFeatureValue(FeatureType type, int32_t value);
350 
351     /**
352      * @brief IMS GetImsFeatureValue interface
353      *
354      * @param FeatureType Indicate which feature type to query.
355      * @param value Indicate the return value of the query feature type.
356      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
357      */
358     int32_t GetImsFeatureValue(FeatureType type, int32_t &value);
359 
360     /**
361      * @brief Set the mute state of the call
362      *
363      * @param mute 0: not mute, 1:mute
364      * @param slotId Indicates the card slot index number,
365      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
366      */
367     int32_t SetMute(int32_t slotId, int32_t mute);
368 
369     /**
370      * @brief IMS GetMute interface
371      *
372      * @param slotId Indicates the card slot index number,
373      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
374      */
375     int32_t GetMute(int32_t slotId);
376 
377     /****************** video settings ******************/
378     /**
379      * @brief IMS ControlCamera interface
380      *
381      * @param slotId[in], The slot id
382      * @param callIndex Indicates the call index number.
383      * @param cameraId The id of the camera
384      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
385      */
386     int32_t ControlCamera(int32_t slotId, int32_t callIndex, const std::string &cameraId);
387 
388     /**
389      * @brief Set a window which used to display a preview of camera capturing
390      *
391      * @param slotId[in], The slot id
392      * @param callIndex Indicates the call index number.
393      * @param surfaceID Surface id of window object
394      * @param surface The surface object of window
395      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
396      */
397     int32_t SetPreviewWindow(int32_t slotId, int32_t callIndex, const std::string &surfaceID, sptr<Surface> surface);
398 
399     /**
400      * @brief Set a window which used to display the viedo which is received from remote
401      *
402      * @param slotId[in], The slot id
403      * @param callIndex Indicates the call index number.
404      * @param surfaceID Surface id of window object
405      * @param surface The surface object of window
406      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
407      */
408     int32_t SetDisplayWindow(int32_t slotId, int32_t callIndex, const std::string &surfaceID, sptr<Surface> surface);
409 
410     /**
411      * @brief Set camera zoom ratio
412      *
413      * @param zoomRatio the camera zoom ratio
414      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
415      */
416     int32_t SetCameraZoom(float zoomRatio);
417 
418     /**
419      * @brief Set a picture which will be displayed when the video signal is paused
420      *
421      * @param slotId[in], The slot id
422      * @param callIndex Indicates the call index number.
423      * @param path the dispalyed image path
424      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
425      */
426     int32_t SetPausePicture(int32_t slotId, int32_t callIndex, const std::string &path);
427 
428     /**
429      * @brief Set the device orientation
430      *
431      * @param slotId[in], The slot id
432      * @param callIndex Indicates the call index number.
433      * @param rotation The device orientation, in degrees
434      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
435      */
436     int32_t SetDeviceDirection(int32_t slotId, int32_t callIndex, int32_t rotation);
437 
438     /****************** supplement ******************/
439     /**
440      * @brief SetClip IMS SetClip interface
441      *
442      * @param slotId Indicates the card slot index number,
443      * ranging from 0 to the maximum card slot index number supported by the device.
444      * @param action Indicates the action for SetClip,
445      * 1, means turn on clip; 0, means turn off clip.
446      * @param index Indicates the index of command.
447      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
448      */
449     int32_t SetClip(int32_t slotId, int32_t action, int32_t index);
450 
451     /**
452      * @brief GetClip IMS GetClip interface
453      *
454      * @param slotId Indicates the card slot index number,
455      * ranging from 0 to the maximum card slot index number supported by the device.
456      * @param index Indicates the index of command.
457      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
458      */
459     int32_t GetClip(int32_t slotId, int32_t index);
460 
461     /**
462      * @brief SetClir IMS SetClir interface
463      *
464      * @param slotId Indicates the card slot index number,
465      * ranging from 0 to the maximum card slot index number supported by the device.
466      * @param action Indicates the action for SetClir,
467      * 1, means turn on clir; 0, means turn off clir.
468      * @param index Indicates the index of command.
469      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
470      */
471     int32_t SetClir(int32_t slotId, int32_t action, int32_t index);
472 
473     /**
474      * @brief GetClir IMS GetClir interface
475      *
476      * @param slotId Indicates the card slot index number,
477      * ranging from 0 to the maximum card slot index number supported by the device.
478      * @param index Indicates the index of command.
479      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
480      */
481     int32_t GetClir(int32_t slotId, int32_t index);
482 
483     /**
484      * @brief SetCallTransfer Set Call Transfer Request
485      *
486      * @param slotId Indicates the card slot index number,
487      * ranging from 0 to the maximum card slot index number supported by the device.
488      * @param cfInfo Indicates the reason/mode/transferNum/timer of the set call transfer.
489      * @param classType Indicates a sum of service class for setting call transfer.
490      * @param index Indicates the index of command.
491      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
492      */
493     int32_t SetCallTransfer(int32_t slotId, const CallTransferInfo &cfInfo, int32_t classType, int32_t index);
494 
495     /**
496      * @brief confirm whether IMS can set call transfer time.
497      *
498      * @param slotId Indicates the card slot index number,
499      * ranging from 0 to the maximum card slot index number supported by the device.
500      * @param result, The result of can set or not
501      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
502      */
503     int32_t CanSetCallTransferTime(int32_t slotId, bool &result);
504 
505     /**
506      * @brief GetCallTransfer IMS GetCallTransfer interface
507      *
508      * @param slotId Indicates the card slot index number,
509      * ranging from 0 to the maximum card slot index number supported by the device.
510      * @param reason Indicates the reason of the get call transfer.
511      * @param index Indicates the index of command.
512      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
513      */
514     int32_t GetCallTransfer(int32_t slotId, int32_t reason, int32_t index);
515 
516     /**
517      * @brief SetCallRestriction IMS SetCallRestriction interface
518      *
519      * @param slotId Indicates the card slot index number,
520      * ranging from 0 to the maximum card slot index number supported by the device.
521      * @param fac Indicates the facility of the set call restriction.
522      * @param mode Indicates the mode of the set call restriction.
523      * @param pw Indicates password or "" if not required.
524      * @param index Indicates the index of command.
525      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
526      */
527     int32_t SetCallRestriction(
528         int32_t slotId, const std::string &fac, int32_t mode, const std::string &pw, int32_t index);
529 
530     /**
531      * @brief GetCallRestriction IMS GetCallRestriction interface
532      *
533      * @param slotId Indicates the card slot index number,
534      * ranging from 0 to the maximum card slot index number supported by the device.
535      * @param fac Indicates the facility of the get call restriction.
536      * @param index Indicates the index of command.
537      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
538      */
539     int32_t GetCallRestriction(int32_t slotId, const std::string &fac, int32_t index);
540 
541     /**
542      * @brief SetCallWaiting IMS SetCallWaiting interface
543      *
544      * @param slotId Indicates the card slot index number,
545      * ranging from 0 to the maximum card slot index number supported by the device.
546      * @param activate Indicates the action for SetCallWaiting,
547      * true, means turn on CallWaiting; false, means turn off CallWaiting.
548      * @param classType Call waiting and conditions +CCWA,
549      * the value was {@code ServiceClassType}, See 3GPP TS 22.083.
550      * @param index Indicates the index of command.
551      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
552      */
553     int32_t SetCallWaiting(int32_t slotId, bool activate, int32_t classType, int32_t index);
554 
555     /**
556      * @brief SetVideoCallWaiting IMS SetVideoCallWaiting interface
557      *
558      * @param slotId Indicates the card slot index number,
559      * ranging from 0 to the maximum card slot index number supported by the device.
560      * @param activate Indicates the action for SetVideoCallWaiting,
561      * true, means turn on VideoCallWaiting; false, means turn off VideoCallWaiting.
562      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
563      */
564     int32_t SetVideoCallWaiting(int32_t slotId, bool activate);
565 
566     /**
567      * @brief GetCallWaiting IMS GetCallWaiting interface
568      *
569      * @param slotId Indicates the card slot index number,
570      * ranging from 0 to the maximum card slot index number supported by the device.
571      * @param index Indicates the index of command.
572      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
573      */
574     int32_t GetCallWaiting(int32_t slotId, int32_t index);
575 
576     /**
577      * @brief SetColr IMS SetColr interface
578      *
579      * @param slotId Indicates the card slot index number,
580      * ranging from 0 to the maximum card slot index number supported by the device.
581      * @param presentation Indicates the action for SetColr,
582      * 1, means turn on colr; 0, means turn off colr.
583      * @param index Indicates the index of command.
584      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
585      */
586     int32_t SetColr(int32_t slotId, int32_t presentation, int32_t index);
587 
588     /**
589      * @brief GetColr IMS GetColr interface
590      *
591      * @param slotId Indicates the card slot index number,
592      * ranging from 0 to the maximum card slot index number supported by the device.
593      * @param index Indicates the index of command.
594      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
595      */
596     int32_t GetColr(int32_t slotId, int32_t index);
597 
598     /**
599      * @brief SetColp IMS SetColp interface
600      *
601      * @param slotId Indicates the card slot index number,
602      * ranging from 0 to the maximum card slot index number supported by the device.
603      * @param action Indicates the action for SetColp,
604      * 1, means turn on colp; 0, means turn off colp.
605      * @param index Indicates the index of command.
606      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
607      */
608     int32_t SetColp(int32_t slotId, int32_t action, int32_t index);
609 
610     /**
611      * @brief GetColp IMS GetColp interface
612      *
613      * @param slotId Indicates the card slot index number,
614      * ranging from 0 to the maximum card slot index number supported by the device.
615      * @param index Indicates the index of command.
616      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
617      */
618     int32_t GetColp(int32_t slotId, int32_t index);
619 
620     /**
621      * @brief Update Ims Capabilities
622      *
623      * @param slotId Indicates the card slot index number,
624      * ranging from 0 to the maximum card slot index number supported by the device.
625      * @param imsCapabilityList Indicates the related ims capability
626      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
627      */
628     int32_t UpdateImsCapabilities(int32_t slotId, const ImsCapabilityList &imsCapabilityList);
629 
630     /**
631      * @brief Get impu which come form network
632      *
633      * @param slotId Indicates the card slot index number,
634      * ranging from 0 to the maximum card slot index number supported by the device.
635      * @param impu the result of impu
636      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
637      */
638     int32_t GetUtImpuFromNetwork(int32_t slotId, std::string &impu);
639 
640     /**
641      * @brief Notify operatorconfig changed to ims_service
642      *
643      * @param slotId Indicates the card slot index number,
644      * ranging from 0 to the maximum card slot index number supported by the device.
645      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
646      */
647     int32_t NotifyOperatorConfigChanged(int32_t slotId, int32_t state);
648 
649     /**
650      * @brief Get ims Capabilities interface
651      *
652      * @param slotId Indicates the card slot index number,
653      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
654      */
655     int32_t GetImsCapabilities(int32_t slotId);
656 
657 private:
658     class SystemAbilityListener : public SystemAbilityStatusChangeStub {
659     public:
SystemAbilityListener()660         SystemAbilityListener() {}
~SystemAbilityListener()661         ~SystemAbilityListener() {}
662 
663     public:
664         void OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId) override;
665         void OnRemoveSystemAbility(int32_t systemAbilityId, const std::string &deviceId) override;
666     };
667 
668     /**
669      * Is Connect ImsCall Remote Object
670      *
671      * @return bool
672      */
673     bool IsConnect();
674     int32_t RegisterImsCallCallback();
675     int32_t ReConnectService();
676     void Clean();
677 
678 private:
679     sptr<ImsCoreServiceInterface> imsCoreServiceProxy_ = nullptr;
680     sptr<ImsCallInterface> imsCallProxy_ = nullptr;
681     sptr<ImsCallCallbackInterface> imsCallCallback_ = nullptr;
682     std::map<int32_t, std::shared_ptr<AppExecFwk::EventHandler>> handlerMap_;
683     Utils::RWLock rwClientLock_;
684     sptr<ISystemAbilityStatusChange> statusChangeListener_ = nullptr;
685     std::mutex mutexMap_;
686 };
687 } // namespace Telephony
688 } // namespace OHOS
689 
690 #endif // TELEPHONY_IMS_CORE_SERVICE_CLIENT_H
691