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

Commit ff1586bf authored by Henri Chataing's avatar Henri Chataing
Browse files

btif_a2dp: Incorrect check for A2DP Offload Start status

Bug: 350899760
Flag: EXEMPT, minor fix
Test: m com.android.btservices
Test: Manual |
   Validate correct audio stream with HD Audio toggle off
Change-Id: I00b09b7fe6a540a37ba721a71da090e815885c1a
parent 3d28bf01
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -29,16 +29,14 @@ namespace bluetooth {
namespace audio {
namespace a2dp {

/// Copied after the definition from the Bluetooth Audio interface:
/// Loosely copied after the definition from the Bluetooth Audio interface:
/// hardware/interfaces/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
enum BluetoothAudioStatus {
  UNKNOWN = 0,
  SUCCESS = 1,
  UNSUPPORTED_CODEC_CONFIGURATION = 2,
  FAILURE = 3,
  // Not defined in BluetoothAudioStatus, but used internally for
  // state keeping.
  PENDING = 5,
enum class BluetoothAudioStatus {
  SUCCESS = 0,
  UNKNOWN,
  UNSUPPORTED_CODEC_CONFIGURATION,
  FAILURE,
  PENDING,
};

bool update_codec_offloading_capabilities(
+1 −2
Original line number Diff line number Diff line
@@ -181,8 +181,7 @@ void btif_a2dp_on_offload_started(const RawAddress& peer_addr,
  }

  if (btif_av_is_a2dp_offload_running()) {
    if (ack != BTA_AV_SUCCESS &&
        btif_av_stream_started_ready(A2dpType::kSource)) {
    if (ack != BluetoothAudioStatus::SUCCESS && btif_av_stream_started_ready(A2dpType::kSource)) {
      // Offload request will return with failure from btif_av sm if
      // suspend is triggered for remote start. Disconnect only if SoC
      // returned failure for offload VSC