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 #ifndef OHOS_BLUETOOTH_STANDARD_HFP_AG_PROXY_H
16 #define OHOS_BLUETOOTH_STANDARD_HFP_AG_PROXY_H
17 
18 #include "i_bluetooth_hfp_ag.h"
19 #include "iremote_proxy.h"
20 
21 namespace OHOS {
22 namespace Bluetooth {
23 class BluetoothHfpAgProxy : public IRemoteProxy<IBluetoothHfpAg> {
24 public:
BluetoothHfpAgProxy(const sptr<IRemoteObject> & impl)25     explicit BluetoothHfpAgProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IBluetoothHfpAg>(impl) {};
~BluetoothHfpAgProxy()26     ~BluetoothHfpAgProxy() {};
27 
28     int32_t GetConnectDevices(std::vector<BluetoothRawAddress> &devices) override;
29     int GetDevicesByStates(const std::vector<int> &states, std::vector<BluetoothRawAddress> &devices) override;
30     int32_t GetDeviceState(const BluetoothRawAddress &device, int32_t &state) override;
31     int32_t Connect(const BluetoothRawAddress &device) override;
32     int32_t Disconnect(const BluetoothRawAddress &device) override;
33     int GetScoState(const BluetoothRawAddress &device) override;
34     int32_t ConnectSco(uint8_t callType) override;
35     int32_t DisconnectSco(uint8_t callType) override;
36     bool ConnectSco() override;
37     bool DisconnectSco() override;
38     void PhoneStateChanged(BluetoothPhoneState &phoneState) override;
39     void ClccResponse(int index, int direction, int status, int mode, bool mpty, const std::string &number,
40         int type) override;
41     bool OpenVoiceRecognition(const BluetoothRawAddress &device) override;
42     bool CloseVoiceRecognition(const BluetoothRawAddress &device) override;
43     bool SetActiveDevice(const BluetoothRawAddress &device) override;
44     bool IntoMock(const BluetoothRawAddress &device, int state) override;
45     bool SendNoCarrier(const BluetoothRawAddress &device) override;
46     std::string GetActiveDevice() override;
47     void RegisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) override;
48     void DeregisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) override;
49     int SetConnectStrategy(const BluetoothRawAddress &device, int strategy) override;
50     int GetConnectStrategy(const BluetoothRawAddress &device, int &strategy) override;
51     int IsInbandRingingEnabled(bool &isEnabled) override;
52     void CallDetailsChanged(int callId, int callState) override;
53     int IsVgsSupported(const BluetoothRawAddress &device, bool &isSupported) override;
54     void EnableBtCallLog(bool state) override;
55     void GetVirtualDeviceList(std::vector<std::string> &devices) override;
56     void UpdateVirtualDevice(int32_t action, const std::string &address) override;
57 
58 private:
59     static inline BrokerDelegator<BluetoothHfpAgProxy> delegator_;
60 };
61 
62 }  // namespace Bluetooth
63 }  // namespace OHOS
64 
65 #endif  // OHOS_BLUETOOTH_STANDARD_HFP_AG_PROXY_H