Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd2b23af authored by Hans Månsson's avatar Hans Månsson Committed by Edward Savage-Jones
Browse files

audio_hal/hidl: Don't fallback to SW encoding when HW is supported

The following commit:

 29d38ad3 Add support for Opus in BT Audio HAL

Added
BTAV_A2DP_CODEC_INDEX_SOURCE_LC3
BTAV_A2DP_CODEC_INDEX_SOURCE_OPUS
BTAV_A2DP_CODEC_INDEX_SINK_OPUS
to the available codecs.

This causes UpdateOffloadingCapabilities to return early with failure
when handling these new cases.

As android.bluetooth.audio@2.[10] hidl interface does not support
these new codecs, they can be handled by not adding the codecs to
codec_mask and printing a warning.

Bug: 258775933
Test: See issue
Change-Id: Iead2ad344e02ff8d2be3630e493b4bc86c4ad919
parent 069a7c41
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -494,11 +494,23 @@ bool UpdateOffloadingCapabilities(
      case BTAV_A2DP_CODEC_INDEX_SOURCE_LDAC:
        codec_type_masks |= CodecType::LDAC;
        break;
      case BTAV_A2DP_CODEC_INDEX_SOURCE_LC3:
        LOG(WARNING) << __func__
                     << ": Ignore source codec_type=" << preference.codec_type
                     << ", not supported";
        break;
      case BTAV_A2DP_CODEC_INDEX_SOURCE_OPUS:
        LOG(WARNING) << __func__
                     << ": Ignore source codec_type=" << preference.codec_type
                     << ", not supported on HIDL";
        break;
      case BTAV_A2DP_CODEC_INDEX_SINK_SBC:
        [[fallthrough]];
      case BTAV_A2DP_CODEC_INDEX_SINK_AAC:
        [[fallthrough]];
      case BTAV_A2DP_CODEC_INDEX_SINK_LDAC:
        [[fallthrough]];
      case BTAV_A2DP_CODEC_INDEX_SINK_OPUS:
        LOG(WARNING) << __func__
                     << ": Ignore sink codec_type=" << preference.codec_type;
        break;