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

Commit 1bcc1b6a authored by Jakub Rotkiewicz's avatar Jakub Rotkiewicz
Browse files

aidl/a2dp_provider_info: fix Source/SinkCodecIndex

Those functions should return extended codec indexes, not only known
codec indexes.

Bug: 305734815
Test: m com.android.btservices
Change-Id: I98a56d640c00fb7f9867337975f12ee57e968ee8
parent 7302c97d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ std::optional<btav_a2dp_codec_index_t> ProviderInfo::SourceCodecIndex(
    CodecId const& codec_id) const {
  for (auto const& [index, codec] : assigned_codec_indexes) {
    if (codec->id == codec_id && index >= BTAV_A2DP_CODEC_INDEX_SOURCE_MIN &&
        index < BTAV_A2DP_CODEC_INDEX_SOURCE_MAX) {
        index < BTAV_A2DP_CODEC_INDEX_SOURCE_EXT_MAX) {
      return index;
    }
  }
@@ -246,7 +246,7 @@ std::optional<btav_a2dp_codec_index_t> ProviderInfo::SourceCodecIndex(
        codec->id.get<CodecId::vendor>().id == (int)vendor_id &&
        codec->id.get<CodecId::vendor>().codecId == codec_id &&
        index >= BTAV_A2DP_CODEC_INDEX_SOURCE_MIN &&
        index < BTAV_A2DP_CODEC_INDEX_SOURCE_MAX) {
        index < BTAV_A2DP_CODEC_INDEX_SOURCE_EXT_MAX) {
      return index;
    }
  }
@@ -274,7 +274,7 @@ std::optional<btav_a2dp_codec_index_t> ProviderInfo::SinkCodecIndex(
        codec->id.get<CodecId::vendor>().id == (int)vendor_id &&
        codec->id.get<CodecId::vendor>().codecId == codec_id &&
        index >= BTAV_A2DP_CODEC_INDEX_SINK_MIN &&
        index < BTAV_A2DP_CODEC_INDEX_SINK_MAX) {
        index < BTAV_A2DP_CODEC_INDEX_SINK_EXT_MAX) {
      return index;
    }
  }