From ef5bd78f5767d8835aeae29b119cc367c19b005b Mon Sep 17 00:00:00 2001 From: polygraphene Date: Thu, 4 Dec 2025 01:02:39 +0900 Subject: [PATCH] Bluetooth audio fix for Lenovo Y700 gen4 (TB322FC). [3/3] This is a part of patch series to fix bluetooth audio Lenovo Y700 gen4 (TB322FC). Some qualcomm devices reports the offload codecs like Apt-X Adaptive which isn't supported by AOSP. The implementation stops processing the codecs list after stumbled on an unsupported codec. This behaviour let a2dp connection fail. This commit changes it to just ignores the unsupported codecs. Lenovo's (or qualcomm's) bluetooth stack seems to have this change. Related fix on codelinaro: https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/packages/modules/Bluetooth/-/commit/defac8ee01045025d871f3efd2df4ae3ff47d63f --- system/audio_hal_interface/aidl/a2dp/codec_status_aidl.cc | 4 ++-- system/audio_hal_interface/hidl/codec_status_hidl.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/audio_hal_interface/aidl/a2dp/codec_status_aidl.cc b/system/audio_hal_interface/aidl/a2dp/codec_status_aidl.cc index dfdebd2071..2fc2037d59 100644 --- a/system/audio_hal_interface/aidl/a2dp/codec_status_aidl.cc +++ b/system/audio_hal_interface/aidl/a2dp/codec_status_aidl.cc @@ -508,8 +508,8 @@ bool UpdateOffloadingCapabilities( break; case BTAV_A2DP_CODEC_INDEX_MAX: default: - log::error("Unknown codec_type={}", preference.codec_type); - return false; + log::error("Unknown codec_type={}. Ignore.", preference.codec_type); + break; } } offloading_preference.clear(); diff --git a/system/audio_hal_interface/hidl/codec_status_hidl.cc b/system/audio_hal_interface/hidl/codec_status_hidl.cc index a74592a60c..bff1bf90a2 100644 --- a/system/audio_hal_interface/hidl/codec_status_hidl.cc +++ b/system/audio_hal_interface/hidl/codec_status_hidl.cc @@ -469,8 +469,8 @@ bool UpdateOffloadingCapabilities( break; case BTAV_A2DP_CODEC_INDEX_MAX: default: - log::error("Unknown codec_type={}", preference.codec_type); - return false; + log::error("Unknown codec_type={}. Ignore.", preference.codec_type); + break; } } offloading_preference.clear();