• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef CALL_MANAGER_SERVICE_H
17 #define CALL_MANAGER_SERVICE_H
18 
19 #include <memory>
20 
21 #include "bluetooth_call_manager.h"
22 #include "call_control_manager.h"
23 #include "call_manager_service_stub.h"
24 #include "call_state_report_proxy.h"
25 #include "call_status_manager.h"
26 #include "i_call_status_callback.h"
27 #include "iremote_stub.h"
28 #include "iservice_registry.h"
29 #include "singleton.h"
30 #include "system_ability.h"
31 #include "system_ability_definition.h"
32 #include "bluetooth_call_state.h"
33 
34 namespace OHOS {
35 namespace Telephony {
36 class CallManagerService : public SystemAbility,
37                            public CallManagerServiceStub,
38                            public std::enable_shared_from_this<CallManagerService> {
39     DECLARE_DELAYED_SINGLETON(CallManagerService)
40     DECLARE_SYSTEM_ABILITY(CallManagerService)
41 public:
42     void SetCallStatusManager(std::shared_ptr<CallStatusManager> callStatusManager);
43     bool Init();
44     void UnInit();
45 
46     /**
47      * service OnStart
48      */
49     void OnStart() override;
50 
51     /**
52      * service OnStop
53      */
54     void OnStop() override;
55 
56     /**
57      * service dump
58      * @param fd
59      * @param args
60      * @return
61      */
62     int32_t Dump(std::int32_t fd, const std::vector<std::u16string> &args) override;
63 
64     /**
65      * Get bindTime_
66      * @return string
67      */
68     std::string GetBindTime();
69 
70     /**
71      * Get spendTime_
72      * @return string
73      */
74     std::string GetStartServiceSpent();
75 
76     /**
77      * Get serviceRunningState_
78      * @return serviceRunningState_
79      */
80     int32_t GetServiceRunningState();
81 
82     /**
83      * RegisterCallBack
84      *
85      * @brief Register callback
86      * @param callback[in], callback function pointer
87      * @param bundleName[in], bundle name
88      * @return Returns 0 on success, others on failure.
89      */
90     int32_t RegisterCallBack(const sptr<ICallAbilityCallback> &callback) override;
91 
92     /**
93      * UnRegisterCallBack
94      *
95      * @brief unregister callback
96      * @param bundleName[in], bundle name
97      * @return Returns 0 on success, others on failure.
98      */
99     int32_t UnRegisterCallBack() override;
100 
101     /**
102      * ObserverOnCallDetailsChange
103      *
104      * @brief excute when observe OnCallDetailsChange
105      * @return Returns 0 on success, others on failure.
106      */
107     int32_t ObserverOnCallDetailsChange() override;
108 
109     /**
110      * DialCall
111      *
112      * @brief Dial a phone call
113      * @param number[in], dial param.
114      * @param extras[in], extras date.
115      * @return Returns callId when the value is greater than zero, others on failure.
116      */
117     int32_t DialCall(std::u16string number, AppExecFwk::PacMap &extras) override;
118 
119     /**
120      * MakeCall
121      *
122      * @brief Make a phone call
123      * @param number[in], call param.
124      * @return Returns 0 on success, others on failure.
125      */
126     int32_t MakeCall(std::string number) override;
127 
128     /**
129      * AnswerCall
130      *
131      * @brief Answer a phone call
132      * @param callId[in], call id
133      * @param videoState[in], 0: audio, 1: video
134      * @return Returns 0 on success, others on failure.
135      */
136     int32_t AnswerCall(int32_t callId, int32_t videoState) override;
137 
138     /**
139      * RejectCall
140      *
141      * @brief Reject a phone call
142      * @param callId[in], call id
143      * @param rejectWithMessage[in], Whether to enter the reason for rejection,true:yes false:no
144      * @param textMessage[in], The reason you reject the call
145      * @return Returns 0 on success, others on failure.
146      */
147     int32_t RejectCall(int32_t callId, bool rejectWithMessage, std::u16string textMessage) override;
148 
149     /**
150      * HangUpCall
151      *
152      * @brief Hang up the phone
153      * @param callId[in], call id
154      * @return Returns 0 on success, others on failure.
155      */
156     int32_t HangUpCall(int32_t callId) override;
157 
158     /**
159      * GetCallState
160      *
161      * @brief Obtain the call status of the device
162      * @return Returns call state.
163      */
164     int32_t GetCallState() override;
165 
166     /**
167      * HoldCall
168      *
169      * @brief Park a phone call
170      * @param callId[in], call id
171      * @return Returns 0 on success, others on failure.
172      */
173     int32_t HoldCall(int32_t callId) override;
174 
175     /**
176      * UnHoldCall
177      *
178      * @brief Activate a phone call
179      * @param callId[in], call id
180      * @return Returns 0 on success, others on failure.
181      */
182     int32_t UnHoldCall(int32_t callId) override;
183 
184     /**
185      * SwitchCall
186      *
187      * @brief Switch the phone
188      * @param callId[in], call id
189      * @return Returns 0 on success, others on failure.
190      */
191     int32_t SwitchCall(int32_t callId) override;
192 
193     /**
194      * HasCall
195      *
196      * @brief Is there Call
197      * @return Returns true on has call, others on there is no call.
198      */
199     bool HasCall() override;
200 
201     /**
202      * IsNewCallAllowed
203      *
204      * @brief Can I initiate a call
205      * @param enabled[out], true on can, others on there is not can
206      * @return Returns interface processing results.
207      */
208     int32_t IsNewCallAllowed(bool &enabled) override;
209 
210     /**
211      * SetMuted
212      *
213      * @brief Mute the Microphone
214      * @param isMute[in], mute state
215      * @return Returns 0 on success, others on failure.
216      */
217     int32_t SetMuted(bool isMute) override;
218 
219     /**
220      * MuteRinger
221      *
222      * @brief Call mute
223      * @return Returns 0 on success, others on failure.
224      */
225     int32_t MuteRinger() override;
226 
227     /**
228      * SetAudioDevice
229      *
230      * @brief Setting the Audio Channel
231      * @param audioDevice[in], contain audioDeviceType ande address
232      * @return Returns 0 on success, others on failure.
233      */
234     int32_t SetAudioDevice(const AudioDevice &audioDevice) override;
235 
236     /**
237      * IsRinging
238      *
239      * @brief Whether the ringing
240      * @param enabled[out], true on ringing, false on there is no ringing
241      * @return Returns interface processing results.
242      */
243     int32_t IsRinging(bool &enabled) override;
244 
245     /**
246      * IsInEmergencyCall
247      *
248      * @brief Is there an emergency call
249      * @param enabled[out], true on emergency call, false on no emergency call
250      * @return Returns interface processing results.
251      */
252     int32_t IsInEmergencyCall(bool &enabled) override;
253 
254     /**
255      * StartDtmf
256      *
257      * @brief Enable and send DTMF
258      * @param callId[in], call id
259      * @param str[in], Characters sent
260      * @return Returns 0 on success, others on failure.
261      */
262     int32_t StartDtmf(int32_t callId, char str) override;
263 
264     /**
265      * StopDtmf
266      *
267      * @brief Stop the DTMF
268      * @param callId[in], call id
269      * @return Returns 0 on success, others on failure.
270      */
271     int32_t StopDtmf(int32_t callId) override;
272 
273     int32_t PostDialProceed(int32_t callId, bool proceed) override;
274 
275     /**
276      * GetCallWaiting
277      *
278      * @brief Gets whether the call waiting service of the current account is enabled
279      * @param slotId[in], The slot id
280      * @return Returns 0 on success, others on failure.
281      */
282     int32_t GetCallWaiting(int32_t slotId) override;
283 
284     /**
285      * SetCallWaiting
286      *
287      * @brief Set the call waiting function for the current account
288      * @param slotId[in], The slot id
289      * @param activate[in], Activation of switch
290      * @return Returns 0 on success, others on failure.
291      */
292     int32_t SetCallWaiting(int32_t slotId, bool activate) override;
293 
294     /**
295      * GetCallRestriction
296      *
297      * @brief Gets the call restriction information of the specified account
298      * @param slotId[in], The slot id
299      * @param type[in], Call Restriction type
300      * @return Returns 0 on success, others on failure.
301      */
302     int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type) override;
303 
304     /**
305      * SetCallRestriction
306      *
307      * @brief Set the call restriction function for the current account
308      * @param slotId[in], The slot id
309      * @param info[in], Call restriction information
310      * @return Returns 0 on success, others on failure.
311      */
312     int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info) override;
313 
314     /**
315      * SetCallRestrictionPassword
316      *
317      * @brief Set the call restriction password function for the current account
318      * @param slotId[in], The slot id
319      * @param fac[in], Call restriction type
320      * @param oldPassword[in], Old password of call restriction type
321      * @param newPassword[in], New password of call restriction type
322      * @return Returns 0 on success, others on failure.
323      */
324     int32_t SetCallRestrictionPassword(
325         int32_t slotId, CallRestrictionType fac, const char *oldPassword, const char *newPassword) override;
326 
327     /**
328      * GetCallTransferInfo
329      *
330      * @brief Gets the call transfer information of the current account
331      * @param slotId[in], The slot id
332      * @param type[in], Call Transfer Type
333      * @return Returns 0 on success, others on failure.
334      */
335     int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type) override;
336 
337     /**
338      * SetCallTransferInfo
339      *
340      * @brief Set the call transfer function for the current account
341      * @param slotId[in], The slot id
342      * @param info[in], Call Transfer Information
343      * @return Returns 0 on success, others on failure.
344      */
345     int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info) override;
346 
347     /**
348      * CanSetCallTransferTime
349      *
350      * @brief confirm whether IMS support call transfer due to time.
351      * @param slotId[in], The slot id
352      * @param result[out], The result of support or not
353      * @return Returns 0 on success, others on failure.
354      */
355     int32_t CanSetCallTransferTime(int32_t slotId, bool &result) override;
356 
357     /**
358      * CombineConference
359      *
360      * @brief Merge calls to form a conference
361      * @param callId[in], call id
362      * @return Returns 0 on success, others on failure.
363      */
364     int32_t CombineConference(int32_t mainCallId) override;
365 
366     /**
367      * SeparateConference
368      *
369      * @brief Separates a specified call from a conference call
370      * @param callId[in], call id
371      * @return Returns 0 on success, others on failure.
372      */
373     int32_t SeparateConference(int32_t callId) override;
374 
375     /**
376      * KickOutFromConference
377      *
378      * @brief Hangup a specified call from a conference call
379      * @param callId[in], call id
380      * @return Returns 0 on success, others on failure.
381      */
382     int32_t KickOutFromConference(int32_t callId) override;
383 
384     /**
385      * ControlCamera
386      *
387      * @brief Open or close camera
388      * @param callId[in], call id
389      * @param cameraId[in], The camera id
390      * @return Returns 0 on success, others on failure.
391      */
392     int32_t ControlCamera(int32_t callId, std::u16string &cameraId) override;
393 
394     /**
395      * SetPreviewWindow
396      *
397      * @brief Set the location and size of the preview window for videos captured by the local camera.
398      * @param callId[in], call id
399      * @param surfaceId[in], Window information
400      * @param surface[in], Window information
401      * @return Returns 0 on success, others on failure.
402      */
403     int32_t SetPreviewWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface) override;
404 
405     /**
406      * SetDisplayWindow
407      *
408      * @brief Sets the location and size of the remote video window.
409      * @param callId[in], call id
410      * @param surfaceId[in], Window information
411      * @param surface[in], Window information
412      * @return Returns 0 on success, others on failure.
413      */
414     int32_t SetDisplayWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface) override;
415 
416     /**
417      * SetCameraZoom
418      *
419      * @brief Sets the local camera zoom scale
420      * @param zoomRatio[in], Camera scale
421      * @return Returns 0 on success, others on failure.
422      */
423     int32_t SetCameraZoom(float zoomRatio) override;
424 
425     /**
426      * SetPausePicture
427      *
428      * @brief APP sets the screen of the remote video freeze immediately.
429      * If the APP does not call this interface when making a video call,
430      * the last frame before the remote video freeze is displayed by default
431      * @param callId[in], call id
432      * @param path[in], Local Picture address
433      * @return Returns 0 on success, others on failure.
434      */
435     int32_t SetPausePicture(int32_t callId, std::u16string &path) override;
436 
437     /**
438      * SetDeviceDirection
439      *
440      * @brief Set the rotation Angle of the local device. The default value is 0
441      * @param callId[in], call id
442      * @param rotation[in], Rotation Angle
443      * @return Returns 0 on success, others on failure.
444      */
445     int32_t SetDeviceDirection(int32_t callId, int32_t rotation) override;
446 
447     /**
448      * IsEmergencyPhoneNumber
449      *
450      * @brief Is it an emergency call
451      * @param number[in], Phone number to be formatted
452      * @param slotId[in], The slot id
453      * @param enabled[out] result of is it an emergency call
454      * @return Returns 0 on success, others on failure.
455      */
456     int32_t IsEmergencyPhoneNumber(std::u16string &number, int32_t slotId, bool &enabled) override;
457 
458     /**
459      * FormatPhoneNumber
460      *
461      * @brief Formatting a phone number
462      * @param number[in], Phone number to be formatted
463      * @param countryCode[in], Country code of the phone number
464      * @param formatNumber[out] Formatting a phone number
465      * @return Returns 0 on success, others on failure.
466      */
467     int32_t FormatPhoneNumber(
468         std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) override;
469 
470     /**
471      * FormatPhoneNumberToE164
472      *
473      * @brief Formatting a phone number
474      * @param number[in]. Phone number to be formatted
475      * @param countryCode[in], Country code of the phone number
476      * @param formatNumber[out] Formatting a phone number
477      * @return Returns 0 on success, others on failure.
478      */
479     int32_t FormatPhoneNumberToE164(
480         std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) override;
481 
482     /**
483      * GetMainCallId
484      *
485      * @brief Obtain the ID of the primary call in a conference
486      * @param callId[in], Id of a call in a conference
487      * @return Returns main call id, -1 on not call id.
488      */
489     int32_t GetMainCallId(int32_t callId, int32_t &mainCallId) override;
490 
491     /**
492      * GetSubCallIdList
493      *
494      * @brief Obtain the list of neutron call ids
495      * @param callId[in], Id of a call in a conference
496      * @param callIdList[out], the list of neutron call ids
497      * @return Returns 0 on success, others on failure.
498      */
499     int32_t GetSubCallIdList(int32_t callId, std::vector<std::u16string> &callIdList) override;
500 
501     /**
502      * GetCallIdListForConference
503      *
504      * @brief Obtain the callId list of all calls in a conference
505      * @param callId[in], Id of a call in a conference
506      * @param callIdList[out], the callId list of all calls in a conference
507      * @return Returns 0 on success, others on failure.
508      */
509     int32_t GetCallIdListForConference(int32_t callId, std::vector<std::u16string> &callIdList) override;
510 
511     /**
512      * SetCallPreferenceMode
513      *
514      * @brief Setting the Call Type
515      * @param slotId[in], The slot id
516      * @param mode[in], Preference Mode
517      * @return Returns 0 on success, others on failure.
518      */
519     int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode) override;
520 
521     /**
522      * GetImsConfig
523      *
524      * @brief Obtain the IMS service configuration
525      * @param slotId[in], The slot id
526      * @param item[in]
527      * @return Returns 0 on success, others on failure.
528      */
529     int32_t GetImsConfig(int32_t slotId, ImsConfigItem item) override;
530 
531     /**
532      * SetImsConfig
533      *
534      * @brief Example Set the IMS service configuration
535      * @param slotId[in], The slot id
536      * @param item[in]
537      * @return Returns 0 on success, others on failure.
538      */
539     int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value) override;
540 
541     /**
542      * GetImsFeatureValue
543      *
544      * @brief Gets the value of the IMS function item of the specified network type
545      * @param slotId[in], The slot id
546      * @param info[in], FeatureType
547      * @return Returns 0 on success, others on failure.
548      */
549     int32_t GetImsFeatureValue(int32_t slotId, FeatureType type) override;
550 
551     /**
552      * SetImsFeatureValue
553      *
554      * @brief Set the value of the IMS function item of the specified network type
555      * @param slotId[in], The slot id
556      * @param info[in], FeatureType
557      * @param value[in]
558      * @return Returns 0 on success, others on failure.
559      */
560     int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value) override;
561 
562     /**
563      * UpdateImsCallMode
564      *
565      * @brief Setting the Call Mode
566      * @param callId[in], The call id
567      * @param mode[in], Calling patterns
568      * @return Returns 0 on success, others on failure.
569      */
570     int32_t UpdateImsCallMode(int32_t callId, ImsCallMode mode) override;
571 
572     /**
573      * EnableImsSwitch
574      *
575      * @brief Start VoLte
576      * @param slotId[in], The slot id
577      * @return Returns 0 on success, others on failure.
578      */
579     int32_t EnableImsSwitch(int32_t slotId) override;
580 
581     /**
582      * DisableImsSwitch
583      *
584      * @brief Stop VoLte
585      * @param slotId[in], The slot id
586      * @return Returns 0 on success, others on failure.
587      */
588     int32_t DisableImsSwitch(int32_t slotId) override;
589 
590     /**
591      * IsImsSwitchEnabled
592      *
593      * @brief Whether to enable VoLte
594      * @param slotId[in], The slot id
595      * @param enabled[out], The result of enable or not
596      * @return Returns 0 on success, others on failure.
597      */
598     int32_t IsImsSwitchEnabled(int32_t slotId, bool &enabled) override;
599 
600     /**
601      * SetVoNRState
602      *
603      * @brief Set VoNR State
604      * @param slotId[in], The slot id
605      * @param state[in], The state of VoNR
606      * @return Returns 0 on success, others on failure.
607      */
608     int32_t SetVoNRState(int32_t slotId, int32_t state) override;
609 
610     /**
611      * GetVoNRState
612      *
613      * @brief Get VoNR State
614      * @param slotId[in], The slot id
615      * @param state[out], The result of VoNR state ON or OFF
616      * @return Returns 0 on success, others on failure.
617      */
618     int32_t GetVoNRState(int32_t slotId, int32_t &state) override;
619 
620     /**
621      * StartRtt
622      *
623      * @brief Enable and send RTT information
624      * @param callId[in], The call id
625      * @param msg[in], RTT information
626      * @return Returns 0 on success, others on failure.
627      */
628     int32_t StartRtt(int32_t callId, std::u16string &msg) override;
629 
630     /**
631      * StopRtt
632      *
633      * @brief Close the RTT
634      * @param callId[in], The call id
635      * @return Returns 0 on success, others on failure.
636      */
637     int32_t StopRtt(int32_t callId) override;
638 
639     /**
640      * JoinConference
641      *
642      * @brief Bring someone into a meeting
643      * @param callId[in], The call id
644      * @param numberList[in], List of calls to join the conference
645      * @return Returns 0 on success, others on failure.
646      */
647     int32_t JoinConference(int32_t callId, std::vector<std::u16string> &numberList) override;
648 
649     /**
650      * ReportOttCallDetailsInfo
651      *
652      * @brief report ott call details info
653      * @param ottVec[in], ott call status detail info list
654      * @return Returns 0 on success, others on failure.
655      */
656     int32_t ReportOttCallDetailsInfo(std::vector<OttCallDetailsInfo> &ottVec) override;
657 
658     /**
659      * ReportOttCallEventInfo
660      *
661      * @brief report ott call details info
662      * @param ottVec[in], ott call status detail info list
663      * @return Returns 0 on success, others on failure.
664      */
665     int32_t ReportOttCallEventInfo(OttCallEventInfo &eventInfo) override;
666 
667     /**
668      * CloseUnFinishedUssd
669      *
670      * @brief Close Unfinished ussd function for the current account
671      * @param slotId[in], The slot id
672      * @return Returns 0 on success, others on failure.
673      */
674     int32_t CloseUnFinishedUssd(int32_t slotId) override;
675 
676     /**
677      * Remove missed incoming call notification.
678      *
679      * @return Returns 0 on success, others on failure.
680      */
681     int32_t RemoveMissedIncomingCallNotification() override;
682 
683     /**
684      * SetVoIPCallState
685      *
686      * @brief Set VoIP Call State
687      * @param state[in], The state of VoIP Call
688      * @return Returns 0 on success, others on failure.
689      */
690     int32_t SetVoIPCallState(int32_t state) override;
691 
692     /**
693      * GetVoIPCallState
694      *
695      * @brief Get VoIP Call State
696      * @param state[out], The result of VoIP Call
697      * @return Returns 0 on success, others on failure.
698      */
699     int32_t GetVoIPCallState(int32_t &state) override;
700 
701     /**
702      * @brief Set VoIP Call info
703      *
704      * @param callId[out] Indicates the VoIP Call id
705      * @param state[out] Indicates the VoIP Call state
706      * @param phoneNumber[out] Indicates the VoIP Call phone number
707      * @return Returns 0 on success, others on failure.
708      */
709     int32_t SetVoIPCallInfo(int32_t callId, int32_t state, std::string phoneNumber) override;
710 
711     /**
712      * @brief Get VoIP Call Switch Status
713      *
714      * @param callId[out] Indicates the VoIP Call id
715      * @param state[out] Indicates the VoIP Call state
716      * @param phoneNumber[out] Indicates the VoIP Call phone number
717      * @return Returns 0 on success, others on failure.
718      */
719     int32_t GetVoIPCallInfo(int32_t &callId, int32_t &state, std::string &phoneNumber) override;
720 
721     /**
722      * Handle special code from dialer.
723      *
724      * @param specialCode[in], special code
725      * @return Returns 0 on success, others on failure.
726      */
727     int32_t InputDialerSpecialCode(const std::string &specialCode) override;
728 
729     /**
730      * GetProxyObjectPtr
731      *
732      * @brief get callManager proxy object ptr
733      * @param proxyType[in], proxy type
734      * @return Returns nullptr on failure, others on success.
735      */
736     sptr<IRemoteObject> GetProxyObjectPtr(CallManagerProxyType proxyType) override;
737 
738     /**
739      * ReportAudioDeviceInfo
740      *
741      * @brief report audio device info
742      * @return Returns 0 on success, others on failure.
743      */
744     int32_t ReportAudioDeviceInfo() override;
745 
746     /**
747      * CancelCallUpgrade
748      *
749      * @brief cancel upgrade to video call
750      * @param callId[in], The call id
751      *
752      * @return Returns 0 on success, others on failure.
753      */
754     int32_t CancelCallUpgrade(int32_t callId) override;
755 
756     /**
757      * RequestCameraCapabilities
758      *
759      * @brief request camera capabilities
760      * @param callId[in], The call id
761      *
762      * @return Returns 0 on success, others on failure.
763      */
764     int32_t RequestCameraCapabilities(int32_t callId) override;
765 
766     /**
767      * RegisterVoipCallManagerCallback
768      *
769      * @brief notify voip register callstatus callback
770      * @return Returns 0 on success, others on failure.
771      */
772     int32_t RegisterVoipCallManagerCallback() override;
773 
774     /**
775      * @brief notify voip unregister callstatus callback
776      *
777      * @return Returns 0 on success, others on failure.
778      */
779     int32_t UnRegisterVoipCallManagerCallback() override;
780 
781     /**
782      * @brief send call ui event
783      *
784      * @return Returns 0 on success, others on failure.
785      */
786     int32_t SendCallUiEvent(int32_t callId, std::string &eventName) override;
787 
788     /**
789      * OnAddSystemAbility
790      *
791      * @brief on system ability added
792      * @param systemAbilityId
793      * @param deviceId
794      */
795     void OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId) override;
796 
797     /**
798      * RegisterBluetoothCallManagerCallbackPtr
799      *
800      * @brief notify bluetooth register callstatus callback
801      * @return Returns sptr<ICallStatusCallback>.
802      */
803     sptr<ICallStatusCallback> RegisterBluetoothCallManagerCallbackPtr(std::string &macAddress) override;
804 
805     /**
806      * @brief send ussd response to modem
807      *
808      * @param slotId[in] the slot id
809      * @param content[in] the content need send to modem
810      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
811      */
812     int32_t SendUssdResponse(int32_t slotId, const std::string &content) override;
813 private:
814     std::string GetBundleInfo();
815     int32_t dealCeliaCallEvent(int32_t callId);
816 
817 private:
818     enum ServiceRunningState {
819         STATE_STOPPED = 0,
820         STATE_RUNNING,
821     };
822     const std::string SOS_PULL_CALL_PAGE = "2";
823 
824     ServiceRunningState state_ { ServiceRunningState::STATE_STOPPED };
825 #ifndef TELEPHONY_VOIP_CALL_MANAGER_SYS_ABILITY_ID
826 #define TELEPHONY_VOIP_CALL_MANAGER_SYS_ABILITY_ID 65968
827 #endif
828     std::shared_ptr<CallControlManager> callControlManagerPtr_;
829     std::map<uint32_t, sptr<IRemoteObject>> proxyObjectPtrMap_;
830     std::vector<std::string> supportSpecialCode_ { "*#2846#", "*#2846*",
831         "*#*#2846579#*#*", "#1#", "*#28465#", "*#*#121314#*#*", "*#*#19467328#*#*",
832         "*#*#2589#*#*", "*#*#2845#*#*", "*#*#2846#*#*", "*#*#2847#*#*", "*#*#28465#*#*",
833         "*#*#2627#*#*", "*#*#258#*#*", "*#28460" };
834     std::mutex lock_;
835     const int32_t startTime_ = 1900;
836     const int32_t extraMonth_ = 1;
837     int64_t bindTime_ = 0L;
838     int32_t spendTime_ = 0;
839     sptr<ICallStatusCallback> bluetoothCallCallbackPtr_ = nullptr;
840     std::shared_ptr<BluetoothCallState> bluetoothCallObserver_  = nullptr;
841     std::shared_ptr<CallStatusManager> callStatusManagerPtr_ = nullptr;
842 };
843 } // namespace Telephony
844 } // namespace OHOS
845 
846 #endif // CALL_MANAGER_SERVICE_H
847