Loading system/audio_hal_interface/hal_version_manager.cc +5 −12 Original line number Diff line number Diff line Loading @@ -44,18 +44,7 @@ BluetoothAudioHalVersion HalVersionManager::GetHalVersion() { } BluetoothAudioHalTransport HalVersionManager::GetHalTransport() { switch (GetHalVersion()) { case BluetoothAudioHalVersion::VERSION_AIDL_V1: case BluetoothAudioHalVersion::VERSION_AIDL_V2: case BluetoothAudioHalVersion::VERSION_AIDL_V3: case BluetoothAudioHalVersion::VERSION_AIDL_V4: return BluetoothAudioHalTransport::AIDL; case BluetoothAudioHalVersion::VERSION_2_0: case BluetoothAudioHalVersion::VERSION_2_1: return BluetoothAudioHalTransport::HIDL; default: return BluetoothAudioHalTransport::UNKNOWN; } return instance_ptr->hal_transport_; } android::sp<IBluetoothAudioProvidersFactory_2_1> Loading Loading @@ -131,9 +120,11 @@ BluetoothAudioHalVersion GetAidlInterfaceVersion() { } HalVersionManager::HalVersionManager() { hal_transport_ = BluetoothAudioHalTransport::UNKNOWN; if (AServiceManager_checkService( kDefaultAudioProviderFactoryInterface.c_str()) != nullptr) { hal_version_ = GetAidlInterfaceVersion(); hal_transport_ = BluetoothAudioHalTransport::AIDL; return; } Loading @@ -155,6 +146,7 @@ HalVersionManager::HalVersionManager() { if (instance_count > 0) { hal_version_ = BluetoothAudioHalVersion::VERSION_2_1; hal_transport_ = BluetoothAudioHalTransport::HIDL; return; } Loading @@ -168,6 +160,7 @@ HalVersionManager::HalVersionManager() { if (instance_count > 0) { hal_version_ = BluetoothAudioHalVersion::VERSION_2_0; hal_transport_ = BluetoothAudioHalTransport::HIDL; return; } Loading system/audio_hal_interface/hal_version_manager.h +1 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,6 @@ enum class BluetoothAudioHalVersion : uint8_t { enum class BluetoothAudioHalTransport : uint8_t { // Uninit, default value UNKNOWN, // No HAL available after init or force disabled DISABLED, AIDL, HIDL, }; Loading @@ -72,6 +70,7 @@ class HalVersionManager { std::mutex mutex_; BluetoothAudioHalVersion hal_version_; BluetoothAudioHalTransport hal_transport_; }; } // namespace audio Loading system/audio_hal_interface/hal_version_manager_host.cc +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ HalVersionManager::GetProvidersFactory_2_0() { HalVersionManager::HalVersionManager() { hal_version_ = BluetoothAudioHalVersion::VERSION_UNAVAILABLE; hal_transport_ = BluetoothAudioHalTransport::UNKNOWN; } } // namespace audio Loading system/bta/le_audio/hal_verifier.cc +4 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ #include "bta_le_audio_api.h" bool LeAudioHalVerifier::SupportsLeAudio() { return bluetooth::audio::HalVersionManager::GetHalVersion() >= return bluetooth::audio::HalVersionManager::GetHalTransport() == bluetooth::audio::BluetoothAudioHalTransport::AIDL || bluetooth::audio::HalVersionManager::GetHalVersion() >= bluetooth::audio::BluetoothAudioHalVersion::VERSION_2_1; } Loading Loading
system/audio_hal_interface/hal_version_manager.cc +5 −12 Original line number Diff line number Diff line Loading @@ -44,18 +44,7 @@ BluetoothAudioHalVersion HalVersionManager::GetHalVersion() { } BluetoothAudioHalTransport HalVersionManager::GetHalTransport() { switch (GetHalVersion()) { case BluetoothAudioHalVersion::VERSION_AIDL_V1: case BluetoothAudioHalVersion::VERSION_AIDL_V2: case BluetoothAudioHalVersion::VERSION_AIDL_V3: case BluetoothAudioHalVersion::VERSION_AIDL_V4: return BluetoothAudioHalTransport::AIDL; case BluetoothAudioHalVersion::VERSION_2_0: case BluetoothAudioHalVersion::VERSION_2_1: return BluetoothAudioHalTransport::HIDL; default: return BluetoothAudioHalTransport::UNKNOWN; } return instance_ptr->hal_transport_; } android::sp<IBluetoothAudioProvidersFactory_2_1> Loading Loading @@ -131,9 +120,11 @@ BluetoothAudioHalVersion GetAidlInterfaceVersion() { } HalVersionManager::HalVersionManager() { hal_transport_ = BluetoothAudioHalTransport::UNKNOWN; if (AServiceManager_checkService( kDefaultAudioProviderFactoryInterface.c_str()) != nullptr) { hal_version_ = GetAidlInterfaceVersion(); hal_transport_ = BluetoothAudioHalTransport::AIDL; return; } Loading @@ -155,6 +146,7 @@ HalVersionManager::HalVersionManager() { if (instance_count > 0) { hal_version_ = BluetoothAudioHalVersion::VERSION_2_1; hal_transport_ = BluetoothAudioHalTransport::HIDL; return; } Loading @@ -168,6 +160,7 @@ HalVersionManager::HalVersionManager() { if (instance_count > 0) { hal_version_ = BluetoothAudioHalVersion::VERSION_2_0; hal_transport_ = BluetoothAudioHalTransport::HIDL; return; } Loading
system/audio_hal_interface/hal_version_manager.h +1 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,6 @@ enum class BluetoothAudioHalVersion : uint8_t { enum class BluetoothAudioHalTransport : uint8_t { // Uninit, default value UNKNOWN, // No HAL available after init or force disabled DISABLED, AIDL, HIDL, }; Loading @@ -72,6 +70,7 @@ class HalVersionManager { std::mutex mutex_; BluetoothAudioHalVersion hal_version_; BluetoothAudioHalTransport hal_transport_; }; } // namespace audio Loading
system/audio_hal_interface/hal_version_manager_host.cc +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ HalVersionManager::GetProvidersFactory_2_0() { HalVersionManager::HalVersionManager() { hal_version_ = BluetoothAudioHalVersion::VERSION_UNAVAILABLE; hal_transport_ = BluetoothAudioHalTransport::UNKNOWN; } } // namespace audio Loading
system/bta/le_audio/hal_verifier.cc +4 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ #include "bta_le_audio_api.h" bool LeAudioHalVerifier::SupportsLeAudio() { return bluetooth::audio::HalVersionManager::GetHalVersion() >= return bluetooth::audio::HalVersionManager::GetHalTransport() == bluetooth::audio::BluetoothAudioHalTransport::AIDL || bluetooth::audio::HalVersionManager::GetHalVersion() >= bluetooth::audio::BluetoothAudioHalVersion::VERSION_2_1; } Loading