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

Commit 2c66b366 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I771efe95,I0a86e885,If0bb8317 into tm-qpr-dev

* changes:
  leaudio: Make sure to clean bta queue on BT OFF
  leaudio: Recover on CIG not being removed on BT OFF
  leaudio: Minor refactor needed for future patch
parents a09a63b9 e9b9dd6c
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -189,6 +189,16 @@ void LeAudioDeviceGroup::Deactivate(void) {
  }
}

le_audio::types::CigState LeAudioDeviceGroup::GetCigState(void) {
  return cig_state_;
}

void LeAudioDeviceGroup::SetCigState(le_audio::types::CigState state) {
  LOG_VERBOSE("%s -> %s", bluetooth::common::ToString(cig_state_).c_str(),
              bluetooth::common::ToString(state).c_str());
  cig_state_ = state;
}

bool LeAudioDeviceGroup::Activate(LeAudioContextType context_type) {
  for (auto leAudioDevice : leAudioDevices_) {
    if (leAudioDevice.expired()) continue;
@@ -2626,8 +2636,12 @@ void LeAudioDevices::Dump(int fd, int group_id) {

void LeAudioDevices::Cleanup(void) {
  for (auto const& device : leAudioDevices_) {
    if (device->conn_id_ != GATT_INVALID_CONN_ID) {
      BtaGattQueue::Clean(device->conn_id_);
      BTA_GATTC_Close(device->conn_id_);
      device->DisconnectAcl();
    }
  }
  leAudioDevices_.clear();
}

+2 −0
Original line number Diff line number Diff line
@@ -227,6 +227,8 @@ class LeAudioDeviceGroup {
      types::LeAudioContextType context_type = types::LeAudioContextType::RFU);
  bool Activate(types::LeAudioContextType context_type);
  void Deactivate(void);
  types::CigState GetCigState(void);
  void SetCigState(le_audio::types::CigState state);
  void CigClearCis(void);
  void ClearSinksFromConfiguration(void);
  void ClearSourcesFromConfiguration(void);
+2 −2
Original line number Diff line number Diff line
@@ -579,8 +579,8 @@ uint32_t AdjustAllocationForOffloader(uint32_t allocation) {

namespace types {
std::ostream& operator<<(std::ostream& os, const types::CigState& state) {
  static const char* char_value_[4] = {"NONE", "CREATING", "CREATED",
                                       "REMOVING"};
  static const char* char_value_[5] = {"NONE", "CREATING", "CREATED",
                                       "REMOVING", "RECOVERING"};

  os << char_value_[static_cast<uint8_t>(state)] << " ("
     << "0x" << std::setfill('0') << std::setw(2) << static_cast<int>(state)
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ constexpr uint16_t kMaxTransportLatencyMin = 0x0005;
constexpr uint16_t kMaxTransportLatencyMax = 0x0FA0;

/* Enums */
enum class CigState : uint8_t { NONE, CREATING, CREATED, REMOVING };
enum class CigState : uint8_t { NONE, CREATING, CREATED, REMOVING, RECOVERING };

/* ASE states according to BAP defined state machine states */
enum class AseState : uint8_t {
+3 −1
Original line number Diff line number Diff line
@@ -58,7 +58,9 @@ void IsoManager::ReconfigureCig(
  pimpl_->ReconfigureCig(cig_id, std::move(cig_params));
}

void IsoManager::RemoveCig(uint8_t cig_id) { pimpl_->RemoveCig(cig_id); }
void IsoManager::RemoveCig(uint8_t cig_id, bool force) {
  pimpl_->RemoveCig(cig_id, force);
}

void IsoManager::EstablishCis(
    struct iso_manager::cis_establish_params conn_params) {
Loading