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 #ifndef BLUETOOTH_CALL_PROXY_H 17 #define BLUETOOTH_CALL_PROXY_H 18 19 #include <cstdio> 20 #include <string> 21 22 #include "iremote_broker.h" 23 #include "iremote_proxy.h" 24 #include "pac_map.h" 25 26 #include "call_manager_inner_type.h" 27 #include "i_bluetooth_call.h" 28 #include "telephony_log_wrapper.h" 29 30 namespace OHOS { 31 namespace Telephony { 32 class BluetoothCallProxy : public IRemoteProxy<IBluetoothCall> { 33 public: 34 /** 35 * BluetoothCallProxy 36 * 37 * @param impl 38 */ 39 explicit BluetoothCallProxy(const sptr<IRemoteObject> &impl); 40 virtual ~BluetoothCallProxy() = default; 41 42 /** 43 * AnswerCall 44 * 45 * @brief Answer a phone call 46 * @return Returns 0 on success, others on failure. 47 */ 48 int32_t AnswerCall() override; 49 50 /** 51 * RejectCall 52 * 53 * @brief Reject a phone call 54 * @return Returns 0 on success, others on failure. 55 */ 56 int32_t RejectCall() override; 57 58 /** 59 * HangUpCall 60 * 61 * @brief Hang up the phone 62 * @return Returns 0 on success, others on failure. 63 */ 64 int32_t HangUpCall() override; 65 66 /** 67 * GetCallState 68 * 69 * @brief Obtain the call status of the device 70 * @return Returns 0 on success, others on failure. 71 */ 72 int32_t GetCallState() override; 73 74 /** 75 * HoldCall 76 * 77 * @brief Park a phone call 78 * @return Returns 0 on success, others on failure. 79 */ 80 int32_t HoldCall() override; 81 82 /** 83 * UnHoldCall 84 * 85 * @brief Activate a phone call 86 * @return Returns 0 on success, others on failure. 87 */ 88 int32_t UnHoldCall() override; 89 90 /** 91 * SwitchCall 92 * 93 * @brief Switch the phone 94 * @return Returns 0 on success, others on failure. 95 */ 96 int32_t SwitchCall() override; 97 98 /** 99 * StartDtmf 100 * 101 * @brief Enable and send DTMF 102 * @param str[in], Characters sent 103 * @return Returns 0 on success, others on failure. 104 */ 105 int32_t StartDtmf(char str) override; 106 107 /** 108 * StopDtmf 109 * 110 * @brief Stop the DTMF 111 * @return Returns 0 on success, others on failure. 112 */ 113 int32_t StopDtmf() override; 114 115 /** 116 * CombineConference 117 * 118 * @brief Merge calls to form a conference 119 * @return Returns 0 on success, others on failure. 120 */ 121 int32_t CombineConference() override; 122 123 /** 124 * SeparateConference 125 * 126 * @brief Separates a specified call from a conference call 127 * @return Returns 0 on success, others on failure. 128 */ 129 int32_t SeparateConference() override; 130 131 /** 132 * GetCurrentCallList 133 * 134 * @brief Get current call list 135 * @param slotId[in], The slot id 136 * @return Returns call info list. 137 */ 138 std::vector<CallAttributeInfo> GetCurrentCallList(int32_t slotId) override; 139 140 private: 141 static inline BrokerDelegator<BluetoothCallProxy> delegator_; 142 }; 143 } // namespace Telephony 144 } // namespace OHOS 145 146 #endif // BLUETOOTH_CALL_PROXY_H