195489c19Sopenharmony_ci/*
295489c19Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd.
395489c19Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
495489c19Sopenharmony_ci * you may not use this file except in compliance with the License.
595489c19Sopenharmony_ci * You may obtain a copy of the License at
695489c19Sopenharmony_ci *
795489c19Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
895489c19Sopenharmony_ci *
995489c19Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1095489c19Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1195489c19Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1295489c19Sopenharmony_ci * See the License for the specific language governing permissions and
1395489c19Sopenharmony_ci * limitations under the License.
1495489c19Sopenharmony_ci */
1595489c19Sopenharmony_ci
1695489c19Sopenharmony_ci/**
1795489c19Sopenharmony_ci * @addtogroup Bluetooth
1895489c19Sopenharmony_ci * @{
1995489c19Sopenharmony_ci *
2095489c19Sopenharmony_ci * @brief Defines a bluetooth system that provides basic bluetooth connection and profile functions,
2195489c19Sopenharmony_ci *        including A2DP, AVRCP, BLE, GATT, HFP, MAP, PBAP, and SPP, etc.
2295489c19Sopenharmony_ci *
2395489c19Sopenharmony_ci * @since 6
2495489c19Sopenharmony_ci */
2595489c19Sopenharmony_ci
2695489c19Sopenharmony_ci/**
2795489c19Sopenharmony_ci * @file bluetooth_hfp_ag.h
2895489c19Sopenharmony_ci *
2995489c19Sopenharmony_ci * @brief Declares HFP AG role framework functions, including basic and observer functions.
3095489c19Sopenharmony_ci *
3195489c19Sopenharmony_ci * @since 6
3295489c19Sopenharmony_ci */
3395489c19Sopenharmony_ci
3495489c19Sopenharmony_ci#ifndef BLUETOOTH_HFP_AG_H
3595489c19Sopenharmony_ci#define BLUETOOTH_HFP_AG_H
3695489c19Sopenharmony_ci
3795489c19Sopenharmony_ci#include <string>
3895489c19Sopenharmony_ci#include <vector>
3995489c19Sopenharmony_ci#include <memory>
4095489c19Sopenharmony_ci#include <list>
4195489c19Sopenharmony_ci
4295489c19Sopenharmony_ci#include "bluetooth_def.h"
4395489c19Sopenharmony_ci#include "bluetooth_types.h"
4495489c19Sopenharmony_ci#include "bluetooth_remote_device.h"
4595489c19Sopenharmony_ci#include "bluetooth_no_destructor.h"
4695489c19Sopenharmony_ci
4795489c19Sopenharmony_cinamespace OHOS {
4895489c19Sopenharmony_cinamespace Bluetooth {
4995489c19Sopenharmony_ci/**
5095489c19Sopenharmony_ci * @brief Class for HandsFree AudioGateway observer functions.
5195489c19Sopenharmony_ci *
5295489c19Sopenharmony_ci * @since 6
5395489c19Sopenharmony_ci */
5495489c19Sopenharmony_ciclass HandsFreeAudioGatewayObserver {
5595489c19Sopenharmony_cipublic:
5695489c19Sopenharmony_ci    /**
5795489c19Sopenharmony_ci     * @brief The observer function to notify connection state changed.
5895489c19Sopenharmony_ci     *
5995489c19Sopenharmony_ci     * @param device Remote device object.
6095489c19Sopenharmony_ci     * @param state Connection state.
6195489c19Sopenharmony_ci     * @param cause Connecton cause.
6295489c19Sopenharmony_ci     * @since 12
6395489c19Sopenharmony_ci     */
6495489c19Sopenharmony_ci    virtual void OnConnectionStateChanged(const BluetoothRemoteDevice &device, int32_t state, int32_t cause)
6595489c19Sopenharmony_ci    {}
6695489c19Sopenharmony_ci
6795489c19Sopenharmony_ci    /**
6895489c19Sopenharmony_ci     * @brief The observer function to notify audio connection state changed.
6995489c19Sopenharmony_ci     *
7095489c19Sopenharmony_ci     * @param device Remote device object.
7195489c19Sopenharmony_ci     * @param state Audio connection state.
7295489c19Sopenharmony_ci     * @param reason Reason for Audio status change.
7395489c19Sopenharmony_ci     * @since 6
7495489c19Sopenharmony_ci     */
7595489c19Sopenharmony_ci    virtual void OnScoStateChanged(const BluetoothRemoteDevice &device, int32_t state, int32_t reason)
7695489c19Sopenharmony_ci    {}
7795489c19Sopenharmony_ci
7895489c19Sopenharmony_ci    /**
7995489c19Sopenharmony_ci     * @brief The observer function to notify active device changed.
8095489c19Sopenharmony_ci     *
8195489c19Sopenharmony_ci     * @param device Remote active device object.
8295489c19Sopenharmony_ci     * @since 6
8395489c19Sopenharmony_ci     */
8495489c19Sopenharmony_ci    virtual void OnActiveDeviceChanged(const BluetoothRemoteDevice &device)
8595489c19Sopenharmony_ci    {}
8695489c19Sopenharmony_ci
8795489c19Sopenharmony_ci    /**
8895489c19Sopenharmony_ci     * @brief The observer function to notify enhanced driver safety changed.
8995489c19Sopenharmony_ci     *
9095489c19Sopenharmony_ci     * @param device Remote device object.
9195489c19Sopenharmony_ci     * @param indValue Enhanced driver safety value.
9295489c19Sopenharmony_ci     * @since 6
9395489c19Sopenharmony_ci     */
9495489c19Sopenharmony_ci    virtual void OnHfEnhancedDriverSafetyChanged(const BluetoothRemoteDevice &device, int32_t indValue)
9595489c19Sopenharmony_ci    {}
9695489c19Sopenharmony_ci
9795489c19Sopenharmony_ci    /**
9895489c19Sopenharmony_ci     * @brief The observer function to notify audio framework the hfp stack changed.
9995489c19Sopenharmony_ci     *
10095489c19Sopenharmony_ci     * @param device Remote device object.
10195489c19Sopenharmony_ci     * @param action Action on the device.
10295489c19Sopenharmony_ci     * @since 11
10395489c19Sopenharmony_ci     */
10495489c19Sopenharmony_ci    virtual void OnHfpStackChanged(const BluetoothRemoteDevice &device, int32_t action)
10595489c19Sopenharmony_ci    {}
10695489c19Sopenharmony_ci
10795489c19Sopenharmony_ci    /**
10895489c19Sopenharmony_ci     * @brief Destroy the HandsFreeAudioGateway Observer object.
10995489c19Sopenharmony_ci     *
11095489c19Sopenharmony_ci     * @since 6
11195489c19Sopenharmony_ci     */
11295489c19Sopenharmony_ci    virtual ~HandsFreeAudioGatewayObserver()
11395489c19Sopenharmony_ci    {}
11495489c19Sopenharmony_ci
11595489c19Sopenharmony_ci    /**
11695489c19Sopenharmony_ci     * @brief The observer function to notify virtual device changed.
11795489c19Sopenharmony_ci     *
11895489c19Sopenharmony_ci     * @param Action on the device.
11995489c19Sopenharmony_ci     * @param device bluetooth device address.
12095489c19Sopenharmony_ci     * @since 12
12195489c19Sopenharmony_ci     */
12295489c19Sopenharmony_ci    virtual void OnVirtualDeviceChanged(int32_t action, std::string address)
12395489c19Sopenharmony_ci    {}
12495489c19Sopenharmony_ci};
12595489c19Sopenharmony_ci
12695489c19Sopenharmony_ci/**
12795489c19Sopenharmony_ci * @brief Class for HandsFree AudioGateway API.
12895489c19Sopenharmony_ci *
12995489c19Sopenharmony_ci * @since 6
13095489c19Sopenharmony_ci */
13195489c19Sopenharmony_ciclass BLUETOOTH_API HandsFreeAudioGateway {
13295489c19Sopenharmony_cipublic:
13395489c19Sopenharmony_ci    /**
13495489c19Sopenharmony_ci     * @brief Get the instance of HandsFreeAudioGateway object.
13595489c19Sopenharmony_ci     *
13695489c19Sopenharmony_ci     * @return Returns the pointer to the HandsFreeAudioGateway instance.
13795489c19Sopenharmony_ci     * @since 6
13895489c19Sopenharmony_ci     */
13995489c19Sopenharmony_ci    static HandsFreeAudioGateway *GetProfile();
14095489c19Sopenharmony_ci
14195489c19Sopenharmony_ci    /**
14295489c19Sopenharmony_ci     * @brief Get remote HF device list which are in the connected state.
14395489c19Sopenharmony_ci     *
14495489c19Sopenharmony_ci     * @return Returns the list of devices.
14595489c19Sopenharmony_ci     * @since 6
14695489c19Sopenharmony_ci     */
14795489c19Sopenharmony_ci    int32_t GetConnectedDevices(std::vector<BluetoothRemoteDevice>& devices);
14895489c19Sopenharmony_ci
14995489c19Sopenharmony_ci    /**
15095489c19Sopenharmony_ci     * @brief Get remote HF device list which are in the specified states.
15195489c19Sopenharmony_ci     *
15295489c19Sopenharmony_ci     * @param states List of remote device states.
15395489c19Sopenharmony_ci     * @return Returns the list of devices.
15495489c19Sopenharmony_ci     * @since 6
15595489c19Sopenharmony_ci     */
15695489c19Sopenharmony_ci    std::vector<BluetoothRemoteDevice> GetDevicesByStates(std::vector<int> states);
15795489c19Sopenharmony_ci
15895489c19Sopenharmony_ci    /**
15995489c19Sopenharmony_ci     * @brief Get the connection state of the specified remote HF device.
16095489c19Sopenharmony_ci     *
16195489c19Sopenharmony_ci     * @param device Remote device object.
16295489c19Sopenharmony_ci     * @return Returns the connection state of the remote device.
16395489c19Sopenharmony_ci     * @since 6
16495489c19Sopenharmony_ci     */
16595489c19Sopenharmony_ci    int32_t GetDeviceState(const BluetoothRemoteDevice &device, int32_t &state);
16695489c19Sopenharmony_ci
16795489c19Sopenharmony_ci    /**
16895489c19Sopenharmony_ci     * @brief Initiate the establishment of a service level connection to remote HF device.
16995489c19Sopenharmony_ci     *
17095489c19Sopenharmony_ci     * @param device Remote device object.
17195489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
17295489c19Sopenharmony_ci     * @since 6
17395489c19Sopenharmony_ci     */
17495489c19Sopenharmony_ci    int32_t Connect(const BluetoothRemoteDevice &device);
17595489c19Sopenharmony_ci
17695489c19Sopenharmony_ci    /**
17795489c19Sopenharmony_ci     * @brief Release the audio connection from remote HF device.
17895489c19Sopenharmony_ci     *
17995489c19Sopenharmony_ci     * @param device Remote device object.
18095489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
18195489c19Sopenharmony_ci     * @since 6
18295489c19Sopenharmony_ci     */
18395489c19Sopenharmony_ci    int32_t Disconnect(const BluetoothRemoteDevice &device);
18495489c19Sopenharmony_ci
18595489c19Sopenharmony_ci    /**
18695489c19Sopenharmony_ci     * @brief Get the Audio connection state of the specified remote HF device.
18795489c19Sopenharmony_ci     *
18895489c19Sopenharmony_ci     * @param device Remote device object.
18995489c19Sopenharmony_ci     * @return Returns the Audio connection state.
19095489c19Sopenharmony_ci     * @since 6
19195489c19Sopenharmony_ci     */
19295489c19Sopenharmony_ci    int GetScoState(const BluetoothRemoteDevice &device) const;
19395489c19Sopenharmony_ci
19495489c19Sopenharmony_ci    /**
19595489c19Sopenharmony_ci     * @brief Initiate the establishment of an audio connection to remote active HF device.
19695489c19Sopenharmony_ci     *
19795489c19Sopenharmony_ci     * @param callType the type of the call, Refer to enum BtCallType
19895489c19Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns <b>Other</b> if the operation fails.
19995489c19Sopenharmony_ci     * @since 10
20095489c19Sopenharmony_ci     */
20195489c19Sopenharmony_ci    int32_t ConnectSco(uint8_t callType);
20295489c19Sopenharmony_ci
20395489c19Sopenharmony_ci    /**
20495489c19Sopenharmony_ci     * @brief Release the audio connection from remote active HF device.
20595489c19Sopenharmony_ci     *
20695489c19Sopenharmony_ci     * @param callType the type of the call, Refer to enum BtCallType
20795489c19Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns <b>Other</b> if the operation fails.
20895489c19Sopenharmony_ci     * @since 10
20995489c19Sopenharmony_ci     */
21095489c19Sopenharmony_ci    int32_t DisconnectSco(uint8_t callType);
21195489c19Sopenharmony_ci
21295489c19Sopenharmony_ci    /**
21395489c19Sopenharmony_ci     * @brief Initiate the establishment of an audio connection to remote active HF device.
21495489c19Sopenharmony_ci     *
21595489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
21695489c19Sopenharmony_ci     * @since 6
21795489c19Sopenharmony_ci     */
21895489c19Sopenharmony_ci    bool ConnectSco();
21995489c19Sopenharmony_ci
22095489c19Sopenharmony_ci    /**
22195489c19Sopenharmony_ci     * @brief Release the audio connection from remote active HF device.
22295489c19Sopenharmony_ci     *
22395489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
22495489c19Sopenharmony_ci     * @since 6
22595489c19Sopenharmony_ci     */
22695489c19Sopenharmony_ci    bool DisconnectSco();
22795489c19Sopenharmony_ci
22895489c19Sopenharmony_ci    /**
22995489c19Sopenharmony_ci     * @brief This function used to Update changed phone call informations.
23095489c19Sopenharmony_ci     *
23195489c19Sopenharmony_ci     * @param numActive Active call number.
23295489c19Sopenharmony_ci     * @param numHeld Held call number.
23395489c19Sopenharmony_ci     * @param callState Current call state.
23495489c19Sopenharmony_ci     * @param number Phone call number.
23595489c19Sopenharmony_ci     * @param type Type of phone call number.
23695489c19Sopenharmony_ci     * @param name Name of phone call number.
23795489c19Sopenharmony_ci     * @since 6
23895489c19Sopenharmony_ci     */
23995489c19Sopenharmony_ci    void PhoneStateChanged(
24095489c19Sopenharmony_ci        int numActive, int numHeld, int callState, const std::string &number, int type, const std::string &name);
24195489c19Sopenharmony_ci
24295489c19Sopenharmony_ci    /**
24395489c19Sopenharmony_ci     * @brief Send response for querying standard list current calls by remote Hf device.
24495489c19Sopenharmony_ci     *
24595489c19Sopenharmony_ci     * @param index Index of the current call.
24695489c19Sopenharmony_ci     * @param direction Direction of the current call.
24795489c19Sopenharmony_ci     * @param status Status of the current call.
24895489c19Sopenharmony_ci     * @param mode Source Mode of the current call.
24995489c19Sopenharmony_ci     * @param mpty Is this call a member of a conference call.
25095489c19Sopenharmony_ci     * @param number Phone call number.
25195489c19Sopenharmony_ci     * @param type Type of phone call number.
25295489c19Sopenharmony_ci     * @since 6
25395489c19Sopenharmony_ci     */
25495489c19Sopenharmony_ci    void ClccResponse(int index, int direction, int status, int mode, bool mpty, const std::string &number, int type);
25595489c19Sopenharmony_ci
25695489c19Sopenharmony_ci    /**
25795489c19Sopenharmony_ci     * @brief Open the voice recognition.
25895489c19Sopenharmony_ci     *
25995489c19Sopenharmony_ci     * @param device Remote device object.
26095489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
26195489c19Sopenharmony_ci     * @since 6
26295489c19Sopenharmony_ci     */
26395489c19Sopenharmony_ci    bool OpenVoiceRecognition(const BluetoothRemoteDevice &device);
26495489c19Sopenharmony_ci
26595489c19Sopenharmony_ci    /**
26695489c19Sopenharmony_ci     * @brief Close the voice recognition.
26795489c19Sopenharmony_ci     *
26895489c19Sopenharmony_ci     * @param device Remote device object.
26995489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
27095489c19Sopenharmony_ci     * @since 6
27195489c19Sopenharmony_ci     */
27295489c19Sopenharmony_ci    bool CloseVoiceRecognition(const BluetoothRemoteDevice &device);
27395489c19Sopenharmony_ci
27495489c19Sopenharmony_ci    /**
27595489c19Sopenharmony_ci     * @brief Set the active device for audio connection.
27695489c19Sopenharmony_ci     *
27795489c19Sopenharmony_ci     * @param device Remote device object.
27895489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
27995489c19Sopenharmony_ci     * @since 6
28095489c19Sopenharmony_ci     */
28195489c19Sopenharmony_ci    bool SetActiveDevice(const BluetoothRemoteDevice &device);
28295489c19Sopenharmony_ci
28395489c19Sopenharmony_ci    bool IntoMock(const BluetoothRemoteDevice &device, int state);
28495489c19Sopenharmony_ci    bool SendNoCarrier(const BluetoothRemoteDevice &device);
28595489c19Sopenharmony_ci
28695489c19Sopenharmony_ci    /**
28795489c19Sopenharmony_ci     * @brief Get the active device object.
28895489c19Sopenharmony_ci     *
28995489c19Sopenharmony_ci     * @param device Remote active device object.
29095489c19Sopenharmony_ci     * @return Returns <b>true</b> if the operation is successful; returns <b>false</b> if the operation fails.
29195489c19Sopenharmony_ci     * @since 6
29295489c19Sopenharmony_ci     */
29395489c19Sopenharmony_ci    BluetoothRemoteDevice GetActiveDevice() const;
29495489c19Sopenharmony_ci
29595489c19Sopenharmony_ci    /**
29695489c19Sopenharmony_ci     * @brief Set connection strategy for peer bluetooth device.
29795489c19Sopenharmony_ci     *        If peer device is connected and the policy is set not allowed,then perform disconnect operation.
29895489c19Sopenharmony_ci     *        If peer device is disconnected and the policy is set allowed,then perform connect operation.
29995489c19Sopenharmony_ci     *
30095489c19Sopenharmony_ci     * @param device The address of the peer bluetooth device.
30195489c19Sopenharmony_ci     * @param strategy The device connect strategy.
30295489c19Sopenharmony_ci     * @return Returns <b>RET_NO_ERROR</b> if the operation is successful.
30395489c19Sopenharmony_ci     *         Returns <b>BT_ERR_PERMISSION_FAILED</b> Permission denied.
30495489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INVALID_PARAM</b> Input error.
30595489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INVALID_STATE</b> BT_ERR_INVALID_STATE.
30695489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INTERNAL_ERROR</b> Operation failed.
30795489c19Sopenharmony_ci     * @since 10.0
30895489c19Sopenharmony_ci     */
30995489c19Sopenharmony_ci    int SetConnectStrategy(const BluetoothRemoteDevice &device, int strategy);
31095489c19Sopenharmony_ci
31195489c19Sopenharmony_ci    /**
31295489c19Sopenharmony_ci     * @brief Get connection strategy of peer bluetooth device.
31395489c19Sopenharmony_ci     *
31495489c19Sopenharmony_ci     * @param device The address of the peer bluetooth device.
31595489c19Sopenharmony_ci     * @param strategy The device connect strategy.
31695489c19Sopenharmony_ci     * @return Returns <b>RET_NO_ERROR</b> if the operation is successful.
31795489c19Sopenharmony_ci     *         Returns <b>BT_ERR_PERMISSION_FAILED</b> Permission denied.
31895489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INVALID_PARAM</b> Input error.
31995489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INVALID_STATE</b> BT_ERR_INVALID_STATE.
32095489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INTERNAL_ERROR</b> Operation failed.
32195489c19Sopenharmony_ci     * @since 10.0
32295489c19Sopenharmony_ci     */
32395489c19Sopenharmony_ci    int GetConnectStrategy(const BluetoothRemoteDevice &device, int &strategy) const;
32495489c19Sopenharmony_ci
32595489c19Sopenharmony_ci    /**
32695489c19Sopenharmony_ci     * @brief Register HandsFree AudioGateway observer instance.
32795489c19Sopenharmony_ci     *
32895489c19Sopenharmony_ci     * @param observer HandsFree AudioGateway observer instance.
32995489c19Sopenharmony_ci     * @since 6
33095489c19Sopenharmony_ci     */
33195489c19Sopenharmony_ci    void RegisterObserver(std::shared_ptr<HandsFreeAudioGatewayObserver> observer);
33295489c19Sopenharmony_ci
33395489c19Sopenharmony_ci    /**
33495489c19Sopenharmony_ci     * @brief Deregister HandsFree AudioGateway observer instance.
33595489c19Sopenharmony_ci     *
33695489c19Sopenharmony_ci     * @param observer HandsFree AudioGateway observer instance.
33795489c19Sopenharmony_ci     * @since 6
33895489c19Sopenharmony_ci     */
33995489c19Sopenharmony_ci    void DeregisterObserver(std::shared_ptr<HandsFreeAudioGatewayObserver> observer);
34095489c19Sopenharmony_ci
34195489c19Sopenharmony_ci    /**
34295489c19Sopenharmony_ci     * @brief Get remote HF device list which are in the connected state.
34395489c19Sopenharmony_ci     *
34495489c19Sopenharmony_ci     * @return Returns the list of devices.
34595489c19Sopenharmony_ci     * @since 6
34695489c19Sopenharmony_ci     */
34795489c19Sopenharmony_ci    std::vector<BluetoothRemoteDevice> GetConnectedDevices() const;
34895489c19Sopenharmony_ci
34995489c19Sopenharmony_ci    /**
35095489c19Sopenharmony_ci     * @brief Check whether in-band-ringing is enabled
35195489c19Sopenharmony_ci     *
35295489c19Sopenharmony_ci     * @return Returns <b>true</b> if the in-band-ringing is enbale;
35395489c19Sopenharmony_ci     * returns <b>false</b> if the in-band-ringing is disable.
35495489c19Sopenharmony_ci     * @since 11
35595489c19Sopenharmony_ci     */
35695489c19Sopenharmony_ci    int IsInbandRingingEnabled(bool &isEnabled) const;
35795489c19Sopenharmony_ci
35895489c19Sopenharmony_ci    /**
35995489c19Sopenharmony_ci     * @brief This function used to update changed phone call state.
36095489c19Sopenharmony_ci     *
36195489c19Sopenharmony_ci     * @param callId Current call id.
36295489c19Sopenharmony_ci     * @param callState Current call state.
36395489c19Sopenharmony_ci     * @since 11
36495489c19Sopenharmony_ci     */
36595489c19Sopenharmony_ci    void CallDetailsChanged(int callId, int callState);
36695489c19Sopenharmony_ci
36795489c19Sopenharmony_ci    /**
36895489c19Sopenharmony_ci     * @brief Enable or disable the bluetooth log.
36995489c19Sopenharmony_ci     *
37095489c19Sopenharmony_ci     * @param state True: enable log, false: diaable log.
37195489c19Sopenharmony_ci     * @since 11
37295489c19Sopenharmony_ci     */
37395489c19Sopenharmony_ci    void EnableBtCallLog(bool state);
37495489c19Sopenharmony_ci
37595489c19Sopenharmony_ci    /**
37695489c19Sopenharmony_ci     * @brief Check whether vgs is supported.
37795489c19Sopenharmony_ci     *
37895489c19Sopenharmony_ci     * @param device The address of the peer bluetooth device.
37995489c19Sopenharmony_ci     * @param isSupported Whether vgs is supported.
38095489c19Sopenharmony_ci     * @return Returns <b>RET_NO_ERROR</b> if the operation is successful.
38195489c19Sopenharmony_ci     *         Returns <b>BT_ERR_PERMISSION_FAILED</b> Permission denied.
38295489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INVALID_PARAM</b> Input error.
38395489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INVALID_STATE</b> BT_ERR_INVALID_STATE.
38495489c19Sopenharmony_ci     *         Returns <b>BT_ERR_INTERNAL_ERROR</b> Operation failed.
38595489c19Sopenharmony_ci     * @since 12
38695489c19Sopenharmony_ci     */
38795489c19Sopenharmony_ci    int IsVgsSupported(const BluetoothRemoteDevice &device, bool &isSupported) const;
38895489c19Sopenharmony_ci
38995489c19Sopenharmony_ci    /**
39095489c19Sopenharmony_ci     * get virtual device list.
39195489c19Sopenharmony_ci     *
39295489c19Sopenharmony_ci     * @param devices virtual device list.
39395489c19Sopenharmony_ci     * @since 12
39495489c19Sopenharmony_ci     */
39595489c19Sopenharmony_ci    void GetVirtualDeviceList(std::vector<std::string> &devices) const;
39695489c19Sopenharmony_ci
39795489c19Sopenharmony_ci    /**
39895489c19Sopenharmony_ci     * @brief Static HandsFree AudioGateway observer instance.
39995489c19Sopenharmony_ci     *
40095489c19Sopenharmony_ci     * @since 6
40195489c19Sopenharmony_ci     */
40295489c19Sopenharmony_ci    static HandsFreeAudioGateway *instance_;
40395489c19Sopenharmony_ci
40495489c19Sopenharmony_ci    /**
40595489c19Sopenharmony_ci     * @brief The external process calls the HfpAg profile interface before the Bluetooth process starts. At this
40695489c19Sopenharmony_ci     * time, it needs to monitor the start of the Bluetooth process, and then call this interface to initialize the
40795489c19Sopenharmony_ci     * HfpAg proflie.
40895489c19Sopenharmony_ci     */
40995489c19Sopenharmony_ci    void Init();
41095489c19Sopenharmony_ci
41195489c19Sopenharmony_ciprivate:
41295489c19Sopenharmony_ci    HandsFreeAudioGateway();
41395489c19Sopenharmony_ci    ~HandsFreeAudioGateway();
41495489c19Sopenharmony_ci    BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(HandsFreeAudioGateway);
41595489c19Sopenharmony_ci    BLUETOOTH_DECLARE_IMPL();
41695489c19Sopenharmony_ci
41795489c19Sopenharmony_ci#ifdef DTFUZZ_TEST
41895489c19Sopenharmony_ci    friend class BluetoothNoDestructor<HandsFreeAudioGateway>;
41995489c19Sopenharmony_ci#endif
42095489c19Sopenharmony_ci};
42195489c19Sopenharmony_ci}  // namespace Bluetooth
42295489c19Sopenharmony_ci}  // namespace OHOS
42395489c19Sopenharmony_ci#endif  // BLUETOOTH_HFP_AG_H
424