• 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 I_CALL_MANAGER_SERVICE_H
17 #define I_CALL_MANAGER_SERVICE_H
18 
19 #include <cstdio>
20 #include <string>
21 #include <vector>
22 
23 #include "iremote_broker.h"
24 #include "surface.h"
25 #include "pac_map.h"
26 
27 #include "call_manager_inner_type.h"
28 #include "i_call_ability_callback.h"
29 #include "i_call_status_callback.h"
30 
31 namespace OHOS {
32 namespace Telephony {
33 extern "C" {
34 enum CallManagerProxyType {
35     PROXY_BLUETOOTH_CALL = 0,
36 };
37 } // end extern
38 
39 class ICallManagerService : public IRemoteBroker {
40 public:
41     virtual ~ICallManagerService() = default;
42     virtual int32_t RegisterCallBack(const sptr<ICallAbilityCallback> &callback) = 0;
43     virtual int32_t UnRegisterCallBack() = 0;
44     virtual int32_t ObserverOnCallDetailsChange() = 0;
45     virtual int32_t DialCall(std::u16string number, AppExecFwk::PacMap &extras) = 0;
46     virtual int32_t MakeCall(std::string number) = 0;
47     virtual int32_t AnswerCall(int32_t callId, int32_t videoState) = 0;
48     virtual int32_t RejectCall(int32_t callId, bool rejectWithMessage, std::u16string textMessage) = 0;
49     virtual int32_t HangUpCall(int32_t callId) = 0;
50     virtual int32_t GetCallState() = 0;
51     virtual int32_t HoldCall(int32_t callId) = 0;
52     virtual int32_t UnHoldCall(int32_t callId) = 0;
53     virtual int32_t SwitchCall(int32_t callId) = 0;
54     virtual bool HasCall(const bool isInCludeVoipCall = true) = 0;
55     virtual int32_t IsNewCallAllowed(bool &enabled) = 0;
56     virtual int32_t SetMuted(bool isMute) = 0;
57     virtual int32_t MuteRinger() = 0;
58     virtual int32_t SetAudioDevice(const AudioDevice &audioDevice) = 0;
59     virtual int32_t IsRinging(bool &enabled) = 0;
60     virtual int32_t IsInEmergencyCall(bool &enabled) = 0;
61     virtual int32_t StartDtmf(int32_t callId, char str) = 0;
62     virtual int32_t StopDtmf(int32_t callId) = 0;
63     virtual int32_t PostDialProceed(int32_t callId, bool proceed) = 0;
64     virtual int32_t GetCallWaiting(int32_t slotId) = 0;
65     virtual int32_t SetCallWaiting(int32_t slotId, bool activate) = 0;
66     virtual int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type) = 0;
67     virtual int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info) = 0;
68     virtual int32_t SetCallRestrictionPassword(
69         int32_t slotId, CallRestrictionType fac, const char *oldPassword, const char *newPassword) = 0;
70     virtual int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type) = 0;
71     virtual int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info) = 0;
72     virtual int32_t CanSetCallTransferTime(int32_t slotId, bool &result) = 0;
73     virtual int32_t CombineConference(int32_t mainCallId) = 0;
74     virtual int32_t SeparateConference(int32_t callId) = 0;
75     virtual int32_t KickOutFromConference(int32_t callId) = 0;
76     virtual int32_t IsEmergencyPhoneNumber(std::u16string &number, int32_t slotId, bool &enabled) = 0;
77     virtual int32_t FormatPhoneNumber(
78         std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) = 0;
79     virtual int32_t FormatPhoneNumberToE164(
80         std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) = 0;
81     virtual int32_t GetMainCallId(int32_t callId, int32_t &mainCallId) = 0;
82     virtual int32_t GetSubCallIdList(int32_t callId, std::vector<std::u16string> &callIdList) = 0;
83     virtual int32_t GetCallIdListForConference(int32_t callId, std::vector<std::u16string> &callIdList) = 0;
84     virtual int32_t ControlCamera(int32_t callId, std::u16string &cameraId) = 0;
85     virtual int32_t SetPreviewWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface) = 0;
86     virtual int32_t SetDisplayWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface) = 0;
87     virtual int32_t SetCameraZoom(float zoomRatio) = 0;
88     virtual int32_t SetPausePicture(int32_t callId, std::u16string &path) = 0;
89     virtual int32_t SetDeviceDirection(int32_t callId, int32_t rotation) = 0;
90     virtual int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode) = 0;
91     virtual int32_t GetImsConfig(int32_t slotId, ImsConfigItem item) = 0;
92     virtual int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value) = 0;
93     virtual int32_t GetImsFeatureValue(int32_t slotId, FeatureType type) = 0;
94     virtual int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value) = 0;
95     virtual int32_t UpdateImsCallMode(int32_t callId, ImsCallMode mode) = 0;
96     virtual int32_t EnableImsSwitch(int32_t slotId) = 0;
97     virtual int32_t DisableImsSwitch(int32_t slotId) = 0;
98     virtual int32_t IsImsSwitchEnabled(int32_t slotId, bool &enabled) = 0;
99     virtual int32_t SetVoNRState(int32_t slotId, int32_t state) = 0;
100     virtual int32_t GetVoNRState(int32_t slotId, int32_t &state) = 0;
101     virtual int32_t StartRtt(int32_t callId, std::u16string &msg) = 0;
102     virtual int32_t StopRtt(int32_t callId) = 0;
103     virtual int32_t JoinConference(int32_t callId, std::vector<std::u16string> &numberList) = 0;
104     virtual int32_t ReportOttCallDetailsInfo(std::vector<OttCallDetailsInfo> &ottVec) = 0;
105     virtual int32_t ReportOttCallEventInfo(OttCallEventInfo &eventInfo) = 0;
106     virtual int32_t CloseUnFinishedUssd(int32_t slotId) = 0;
107     virtual int32_t InputDialerSpecialCode(const std::string &specialCode) = 0;
108     virtual int32_t RemoveMissedIncomingCallNotification() = 0;
109     virtual int32_t SetVoIPCallState(int32_t state) = 0;
110     virtual int32_t GetVoIPCallState(int32_t &state) = 0;
111     virtual int32_t SetVoIPCallInfo(const int32_t callId, const int32_t state, const std::string phoneNumber) = 0;
112     virtual int32_t GetVoIPCallInfo(int32_t &callId, int32_t &state, std::string &phoneNumber) = 0;
113     virtual sptr<IRemoteObject> GetProxyObjectPtr(CallManagerProxyType proxyType) = 0;
114     virtual int32_t ReportAudioDeviceInfo() = 0;
115     virtual int32_t CancelCallUpgrade(int32_t callId) = 0;
116     virtual int32_t RequestCameraCapabilities(int32_t callId) = 0;
117     virtual int32_t RegisterVoipCallManagerCallback() = 0;
118     virtual int32_t UnRegisterVoipCallManagerCallback() = 0;
119     virtual int32_t SendCallUiEvent(int32_t callId, std::string &eventName) = 0;
120     virtual sptr<ICallStatusCallback> RegisterBluetoothCallManagerCallbackPtr(std::string &macAddress) = 0;
121     virtual int32_t SendUssdResponse(int32_t slotId, const std::string &content) = 0;
122     virtual int32_t SetCallPolicyInfo(bool isDialingTrustlist, const std::vector<std::string> &dialingList,
123         bool isIncomingTrustlist, const std::vector<std::string> &incomingList) = 0;
124 
125 public:
126     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ICallManagerService");
127 };
128 } // namespace Telephony
129 } // namespace OHOS
130 
131 #endif // I_CALL_MANAGER_SERVICE_H
132