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

Commit e367ad0d authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Gerrit Code Review
Browse files

Merge "leaudio: Fix ASE clear on ACL disconnection"

parents 57b0318e 0a7cf6fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4416,7 +4416,7 @@ class LeAudioClientImpl : public LeAudioClient {
void le_audio_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
  if (!p_data || !instance) return;

  DLOG(INFO) << __func__ << " event = " << +event;
  LOG_DEBUG("event = %d", static_cast<int>(event));

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

void LeAudioDevice::DeactivateAllAses(void) {
  for (auto& ase : ases_) {
    if (ase.active) {
    if (ase.active == false &&
        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.data_path_state = AudioStreamDataPathState::IDLE;
    ase.active = false;
@@ -2555,7 +2563,6 @@ void LeAudioDevice::DeactivateAllAses(void) {
    ase.cis_conn_hdl = 0;
  }
}
}

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

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

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

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