1 /*
2  * Copyright (C) 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 OHOS_BLUETOOTH_AUDIOMANAGER_PROXY_H
17 #define OHOS_BLUETOOTH_AUDIOMANAGER_PROXY_H
18 
19 #include <iremote_proxy.h>
20 #include "i_bluetooth_audio_manager.h"
21 
22 namespace OHOS {
23 namespace Bluetooth {
24 class BluetoothAudioManagerProxy : public IRemoteProxy<IBluetoothAudioManager> {
25 public:
BluetoothAudioManagerProxy(const sptr<IRemoteObject>& remote)26     explicit BluetoothAudioManagerProxy(const sptr<IRemoteObject>& remote)
27         : IRemoteProxy<IBluetoothAudioManager>(remote)
28     {}
29 
30     ~BluetoothAudioManagerProxy() override = default;
31 
32     int EnableWearDetection(const std::string &deviceId) override;
33     int DisableWearDetection(const std::string &deviceId) override;
34     int GetWearDetectionState(const std::string &deviceId, int32_t &ability) override;
35     int32_t IsDeviceWearing(const BluetoothRawAddress &device) override;
36     int32_t IsWearDetectionSupported(const BluetoothRawAddress &device, bool &isSupported) override;
37     int32_t SendDeviceSelection(const BluetoothRawAddress &device, int useA2dp, int useHfp, int userSelection) override;
38 
39 private:
40     int SetWearDetection(const std::string &deviceId, bool enable);
41     static inline BrokerDelegator<BluetoothAudioManagerProxy> delegator_;
42 };
43 }  // namespace Bluetooth
44 }  // namespace OHOS
45 
46 #endif  // OHOS_BLUETOOTH_AUDIOMANAGER_PROXY_H