1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "audio_hal_interface/hal_version_manager.h"
18 #include "bta_le_audio_api.h"
19 
SupportsLeAudio()20 bool LeAudioHalVerifier::SupportsLeAudio() {
21   return bluetooth::audio::HalVersionManager::GetHalTransport() ==
22                  bluetooth::audio::BluetoothAudioHalTransport::AIDL ||
23          bluetooth::audio::HalVersionManager::GetHalVersion() >=
24                  bluetooth::audio::BluetoothAudioHalVersion::VERSION_2_1;
25 }
26 
SupportsLeAudioHardwareOffload()27 bool LeAudioHalVerifier::SupportsLeAudioHardwareOffload() {
28   return bluetooth::audio::HalVersionManager::GetHalTransport() ==
29          bluetooth::audio::BluetoothAudioHalTransport::AIDL;
30 }
31 
SupportsLeAudioBroadcast()32 bool LeAudioHalVerifier::SupportsLeAudioBroadcast() {
33   return bluetooth::audio::HalVersionManager::GetHalTransport() ==
34          bluetooth::audio::BluetoothAudioHalTransport::AIDL;
35 }
36 
SupportsStreamActiveApi()37 bool LeAudioHalVerifier::SupportsStreamActiveApi() {
38   return bluetooth::audio::HalVersionManager::GetHalVersion() >=
39          bluetooth::audio::BluetoothAudioHalVersion::VERSION_AIDL_V3;
40 }
41