1 /* 2 * Copyright (C) 2021-2023 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_STATUS_CALLBACK_PROXY_H 17 #define CALL_STATUS_CALLBACK_PROXY_H 18 19 #include "call_status_callback_ipc_interface_code.h" 20 #include "iremote_proxy.h" 21 #include "i_call_status_callback.h" 22 23 namespace OHOS { 24 namespace Telephony { 25 class CallStatusCallbackProxy : public IRemoteProxy<ICallStatusCallback> { 26 public: 27 /** 28 * @brief Construct a new CallStatusCallbackProxy object 29 * 30 * @param impl 31 */ 32 explicit CallStatusCallbackProxy(const sptr<IRemoteObject> &impl); 33 virtual ~CallStatusCallbackProxy() = default; 34 35 /** 36 * @brief update the call details info 37 * 38 * @param info[in] call info, contains phone number, call type, call state, call mode, voice domain, account id .etc 39 * @return Returns 0 on success, others on failure. 40 */ 41 int32_t UpdateCallReportInfo(const CallReportInfo &info) override; 42 43 /** 44 * @brief update the call details info list 45 * 46 * @param info[in] calls info, contains slot id and a CallReportInfo vector 47 * @return Returns 0 on success, others on failure. 48 */ 49 int32_t UpdateCallsReportInfo(const CallsReportInfo &info) override; 50 51 /** 52 * @brief update the call disconnect reason 53 * 54 * @param details[in], contains DisconnectedReason and the corresponding message 55 * @return Returns 0 on success, others on failure. 56 */ 57 int32_t UpdateDisconnectedCause(const DisconnectedDetails &details) override; 58 59 /** 60 * @brief update the event result 61 * 62 * @param info[in], contains RequestResultEventId and CellularCallEventType 63 * @return Returns 0 on success, others on failure. 64 */ 65 int32_t UpdateEventResultInfo(const CellularCallEventInfo &info) override; 66 67 /** 68 * @brief update the rbtplay info 69 * 70 * @param info[in], 0: NETWORK_ALERTING, 1: LOCAL_ALERTING 71 * @return Returns 0 on success, others on failure. 72 */ 73 int32_t UpdateRBTPlayInfo(const RBTPlayInfo info) override; 74 75 /** 76 * @brief update the response of get call waiting 77 * 78 * @param callWaitResponse[in], contains result, status and calssCw 79 * @return Returns 0 on success, others on failure. 80 */ 81 int32_t UpdateGetWaitingResult(const CallWaitResponse &callWaitResponse) override; 82 83 /** 84 * @brief update the response of set call waiting 85 * 86 * @param result[in], 0 means the result is success, others is failure 87 * @return Returns 0 on success, others on failure. 88 */ 89 int32_t UpdateSetWaitingResult(const int32_t result) override; 90 91 /** 92 * @brief update the response of Get Restriction 93 * 94 * @param callRestrictionResult[in], contains result, status and calssCw 95 * @return Returns 0 on success, others on failure. 96 */ 97 int32_t UpdateGetRestrictionResult(const CallRestrictionResponse &callRestrictionResult) override; 98 99 /** 100 * @brief update the response of Set Restriction 101 * 102 * @param result[in], 0 means the result is success, others is failure 103 * @return Returns 0 on success, others on failure. 104 */ 105 int32_t UpdateSetRestrictionResult(const int32_t result) override; 106 107 /** 108 * @brief update the response of Set Restriction Password 109 * 110 * @param result[in], 0 means the result is success, others is failure 111 * @return Returns 0 on success, others on failure. 112 */ 113 int32_t UpdateSetRestrictionPasswordResult(const int32_t result) override; 114 115 /** 116 * @brief update the response of Get Transfer 117 * 118 * @param callTransferResponse[in], contains result, status, calssx, reason, number, time .etc 119 * @return Returns 0 on success, others on failure. 120 */ 121 int32_t UpdateGetTransferResult(const CallTransferResponse &callTransferResponse) override; 122 123 /** 124 * @brief update the response of Set Transfer 125 * 126 * @param result[in], 0 means the result is success, others is failure 127 * @return Returns 0 on success, others on failure. 128 */ 129 int32_t UpdateSetTransferResult(const int32_t result) override; 130 131 /** 132 * @brief update the response of Get CallClip 133 * 134 * @param clipResponse[in], contains result, action, clipStat 135 * @return Returns 0 on success, others on failure. 136 */ 137 int32_t UpdateGetCallClipResult(const ClipResponse &clipResponse) override; 138 139 /** 140 * @brief update the response of Get CallClir 141 * 142 * @param clirResponse[in], contains result, action, clirStat 143 * @return Returns 0 on success, others on failure. 144 */ 145 int32_t UpdateGetCallClirResult(const ClirResponse &clirResponse) override; 146 147 /** 148 * @brief update the result of Update Set CallClir 149 * 150 * @param result[in], 0 means the result is success, others is failure 151 * @return Returns 0 on success, others on failure. 152 */ 153 int32_t UpdateSetCallClirResult(const int32_t result) override; 154 155 /** 156 * @brief update the result of Start Rtt 157 * 158 * @param result[in], 0 means the result is success, others is failure 159 * @return Returns 0 on success, others on failure. 160 */ 161 int32_t StartRttResult(const int32_t result) override; 162 163 /** 164 * @brief update the result of stop rtt 165 * 166 * @param result[in], the Stop Rtt Result, 0 means the result is success, others is failure 167 * @return Returns 0 on success, others on failure. 168 */ 169 int32_t StopRttResult(const int32_t result) override; 170 171 /** 172 * @brief update the response of get ims config 173 * 174 * @param response[in], contains result and value 175 * @return Returns 0 on success, others on failure. 176 */ 177 int32_t GetImsConfigResult(const GetImsConfigResponse &response) override; 178 179 /** 180 * @brief update the result of SetImsConfig 181 * 182 * @param result[in], 0 means the result is success, others is failure 183 * @return Returns 0 on success, others on failure. 184 */ 185 int32_t SetImsConfigResult(const int32_t result) override; 186 187 /** 188 * @brief update the response of GetImsFeatureValue 189 * 190 * @param response[in], contains result and value 191 * @return Returns 0 on success, others on failure. 192 */ 193 int32_t GetImsFeatureValueResult(const GetImsFeatureValueResponse &response) override; 194 195 /** 196 * @brief update the result of SetImsFeatureValue 197 * 198 * @param result[in], 0 means the result is success, others is failure 199 * @return Returns 0 on success, others on failure. 200 */ 201 int32_t SetImsFeatureValueResult(const int32_t result) override; 202 203 /** 204 * @brief update the result of ReceiveUpdateCallMediaMode 205 * 206 * @param response[in], indicates the Call Media mode response information 207 * @return Returns 0 on success, others on failure. 208 */ 209 int32_t ReceiveUpdateCallMediaModeRequest(const CallModeReportInfo &response) override; 210 211 /** 212 * @brief update the result of ReceiveUpdateCallMediaMode 213 * 214 * @param response[in], indicates the Call Media mode response information 215 * @return Returns 0 on success, others on failure. 216 */ 217 int32_t ReceiveUpdateCallMediaModeResponse(const CallModeReportInfo &response) override; 218 219 /** 220 * @brief update the result of invite to conference 221 * 222 * @param result[in], 0 means the result is success, others is failure 223 * @return Returns 0 on success, others on failure. 224 */ 225 int32_t InviteToConferenceResult(const int32_t result) override; 226 227 /** 228 * @brief update the result of start dtmf 229 * 230 * @param result[in], 0 means the result is success, others is failure 231 * @return Returns 0 on success, others on failure. 232 */ 233 int32_t StartDtmfResult(const int32_t result) override; 234 235 /** 236 * @brief update the result of stop dtmf 237 * 238 * @param result[in], 0 means the result is success, others is failure 239 * @return Returns 0 on success, others on failure. 240 */ 241 int32_t StopDtmfResult(const int32_t result) override; 242 243 /** 244 * @brief update the result of send ussd 245 * 246 * @param result[in], 0 means the result is success, others is failure 247 * @return Returns 0 on success, others on failure. 248 */ 249 int32_t SendUssdResult(const int32_t result) override; 250 251 /** 252 * @brief update the result of GetImsCallData 253 * 254 * @param result[in], 0 means the result is success, others is failure 255 * @return Returns 0 on success, others on failure. 256 */ 257 int32_t GetImsCallDataResult(const int32_t result) override; 258 259 /** 260 * @brief update the result of send mmi code 261 * 262 * @param info[in], contains result and message 263 * @return Returns 0 on success, others on failure. 264 */ 265 int32_t SendMmiCodeResult(const MmiCodeInfo &info) override; 266 267 /** 268 * @brief update the result of Close UnFinished Ussd 269 * 270 * @param result[in], 0 means the result is success, others is failure 271 * @return Returns 0 on success, others on failure. 272 */ 273 int32_t CloseUnFinishedUssdResult(const int32_t result) override; 274 275 int32_t ReportPostDialChar(const std::string &c) override; 276 277 int32_t ReportPostDialDelay(const std::string &str) override; 278 279 /** 280 * @brief handle call session event changed 281 * 282 * @param eventOptions[in], call session event info 283 * @return Returns 0 on success, others on failure. 284 */ 285 int32_t HandleCallSessionEventChanged(const CallSessionReportInfo &eventOptions) override; 286 287 /** 288 * @brief handle peer dimensions changed 289 * 290 * @param dimensionsDetail[in], peer dimensions info 291 * @return Returns 0 on success, others on failure. 292 */ 293 int32_t HandlePeerDimensionsChanged(const PeerDimensionsReportInfo &dimensionsDetail) override; 294 295 /** 296 * @brief handle call data usage changed 297 * 298 * @param result[in], call data usage 299 * @return Returns 0 on success, others on failure. 300 */ 301 int32_t HandleCallDataUsageChanged(const int64_t result) override; 302 303 /** 304 * @brief handle camera capabilities changed 305 * 306 * @param cameraCapabilities[in], camera capabilities info 307 * @return Returns 0 on success, others on failure. 308 */ 309 int32_t HandleCameraCapabilitiesChanged(const CameraCapabilitiesReportInfo &cameraCapabilities) override; 310 311 /** 312 * @brief update the voip call event 313 * 314 * @param info[in], contains voipCallEvent 315 * @return Returns 0 on success, others on failure. 316 */ 317 int32_t UpdateVoipEventInfo(const VoipCallEventInfo &info) override; 318 319 private: 320 static inline BrokerDelegator<CallStatusCallbackProxy> delegator_; 321 }; 322 } // namespace Telephony 323 } // namespace OHOS 324 325 #endif 326