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

Commit da81c691 authored by Sam Saccone's avatar Sam Saccone Committed by Gerrit Code Review
Browse files

Merge "Revert "leaudio: Fix ASE clear on ACL disconnection""

parents 00a018e2 f0542336
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -4416,8 +4416,7 @@ class LeAudioClientImpl : public LeAudioClient {
void le_audio_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
void le_audio_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
  if (!p_data || !instance) return;
  if (!p_data || !instance) return;


  LOG_DEBUG("%s event = %d", p_data->remote_bda.ToString().c_str(),
  DLOG(INFO) << __func__ << " event = " << +event;
            static_cast<int>(event));


  switch (event) {
  switch (event) {
    case BTA_GATTC_DEREG_EVT:
    case BTA_GATTC_DEREG_EVT:
+7 −14
Original line number Original line Diff line number Diff line
@@ -2469,8 +2469,7 @@ void LeAudioDevice::Dump(int fd) {
             << ",\tactive: " << ase.active << ", dir: "
             << ",\tactive: " << ase.active << ", dir: "
             << (ase.direction == types::kLeAudioDirectionSink ? "sink"
             << (ase.direction == types::kLeAudioDirectionSink ? "sink"
                                                               : "source")
                                                               : "source")
             << ",\tcis_id: " << static_cast<int>(ase.cis_id)
             << ",\tcis_id: " << static_cast<int>(ase.cis_id) << ",\tstate: "
             << ",\tcis_handle: " << ase.cis_conn_hdl << ",\tstate: "
             << bluetooth::common::ToString(ase.data_path_state);
             << bluetooth::common::ToString(ase.data_path_state);
    }
    }
  }
  }
@@ -2548,14 +2547,7 @@ bool LeAudioDevice::ActivateConfiguredAses(LeAudioContextType context_type) {


void LeAudioDevice::DeactivateAllAses(void) {
void LeAudioDevice::DeactivateAllAses(void) {
  for (auto& ase : ases_) {
  for (auto& ase : ases_) {
    if (ase.active == false &&
    if (ase.active) {
        ase.data_path_state != AudioStreamDataPathState::IDLE) {
      LOG_WARN(
          " %s, ase_id: %d, ase.cis_id: %d, cis_handle: 0x%02x, "
          "ase.data_path=%s",
          address_.ToString().c_str(), ase.id, ase.cis_id, ase.cis_conn_hdl,
          bluetooth::common::ToString(ase.data_path_state).c_str());
    }
      ase.state = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
      ase.state = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
      ase.data_path_state = AudioStreamDataPathState::IDLE;
      ase.data_path_state = AudioStreamDataPathState::IDLE;
      ase.active = false;
      ase.active = false;
@@ -2563,6 +2555,7 @@ void LeAudioDevice::DeactivateAllAses(void) {
      ase.cis_conn_hdl = 0;
      ase.cis_conn_hdl = 0;
    }
    }
  }
  }
}


std::vector<uint8_t> LeAudioDevice::GetMetadata(
std::vector<uint8_t> LeAudioDevice::GetMetadata(
    AudioContexts context_type, const std::vector<uint8_t>& ccid_list) {
    AudioContexts context_type, const std::vector<uint8_t>& ccid_list) {
+3 −2
Original line number Original line Diff line number Diff line
@@ -614,8 +614,6 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
                                      LeAudioDevice* leAudioDevice) {
                                      LeAudioDevice* leAudioDevice) {
    FreeLinkQualityReports(leAudioDevice);
    FreeLinkQualityReports(leAudioDevice);
    leAudioDevice->conn_id_ = GATT_INVALID_CONN_ID;
    leAudioDevice->conn_id_ = GATT_INVALID_CONN_ID;
    /* mark ASEs as not used. */
    leAudioDevice->DeactivateAllAses();


    if (!group) {
    if (!group) {
      LOG(ERROR) << __func__
      LOG(ERROR) << __func__
@@ -624,6 +622,9 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
      return;
      return;
    }
    }


    /* mark ASEs as not used. */
    leAudioDevice->DeactivateAllAses();

    /* If group is in Idle and not transitioning, just update the current group
    /* If group is in Idle and not transitioning, just update the current group
     * audio context availability which could change due to disconnected group
     * audio context availability which could change due to disconnected group
     * member.
     * member.