Loading system/bta/le_audio/client.cc +0 −12 Original line number Diff line number Diff line Loading @@ -539,12 +539,6 @@ class LeAudioClientImpl : public LeAudioClient { } } void OnDeviceAutonomousStateTransitionTimeout(LeAudioDevice* leAudioDevice) { log::error("Device {}, failed to complete autonomous transition", leAudioDevice->address_); DisconnectDevice(leAudioDevice, true); } void UpdateLocationsAndContextsAvailability(LeAudioDeviceGroup* group, bool force = false) { bool group_conf_changed = group->ReloadAudioLocations(); Loading Loading @@ -6193,12 +6187,6 @@ class CallbacksImpl : public LeAudioGroupStateMachine::Callbacks { if (instance) instance->OnLeAudioDeviceSetStateTimeout(group_id); } void OnDeviceAutonomousStateTransitionTimeout( LeAudioDevice* leAudioDevice) override { if (instance) instance->OnDeviceAutonomousStateTransitionTimeout(leAudioDevice); } void OnUpdatedCisConfiguration(int group_id, uint8_t direction) { if (instance) instance->OnUpdatedCisConfiguration(group_id, direction); } Loading system/bta/le_audio/device_groups.cc +12 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,18 @@ bool LeAudioDeviceGroup::IsGroupReadyToSuspendStream(void) const { return iter == leAudioDevices_.end(); } bool LeAudioDeviceGroup::HaveAnyActiveDeviceInStreamingState() const { auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(), [](auto& d) { if (d.expired()) return false; else return (((d.lock()).get())->HaveAnyStreamingAses()); }); return iter != leAudioDevices_.end(); } bool LeAudioDeviceGroup::HaveAnyActiveDeviceInUnconfiguredState() const { auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(), [](auto& d) { Loading system/bta/le_audio/device_groups.h +1 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ class LeAudioDeviceGroup { types::DataPathState data_path_state) const; bool IsDeviceInTheGroup(LeAudioDevice* leAudioDevice) const; bool HaveAllActiveDevicesAsesTheSameState(types::AseState state) const; bool HaveAnyActiveDeviceInStreamingState() const; bool HaveAnyActiveDeviceInUnconfiguredState() const; bool IsGroupStreamReady(void) const; bool IsGroupReadyToCreateStream(void) const; Loading system/bta/le_audio/devices.cc +16 −8 Original line number Diff line number Diff line Loading @@ -425,9 +425,6 @@ void LeAudioDevice::ClearPACs(void) { LeAudioDevice::~LeAudioDevice(void) { alarm_free(link_quality_timer); for (auto& ase : ases_) { alarm_free(ase.autonomous_operation_timer_); } this->ClearPACs(); } Loading Loading @@ -722,6 +719,19 @@ bool LeAudioDevice::HaveActiveAse(void) { return iter != ases_.end(); } bool LeAudioDevice::HaveAnyStreamingAses(void) { /* In configuring state when active in Idle or Configured and reconfigure */ auto iter = std::find_if(ases_.begin(), ases_.end(), [](const auto& ase) { if (!ase.active) return false; if (ase.state == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) return true; return false; }); return iter != ases_.end(); } bool LeAudioDevice::HaveAnyUnconfiguredAses(void) { /* In configuring state when active in Idle or Configured and reconfigure */ auto iter = std::find_if(ases_.begin(), ases_.end(), [](const auto& ase) { Loading Loading @@ -1131,11 +1141,9 @@ void LeAudioDevice::DeactivateAllAses(void) { bluetooth::common::ToString(ase.cis_state), bluetooth::common::ToString(ase.data_path_state)); } if (alarm_is_scheduled(ase.autonomous_operation_timer_)) { alarm_free(ase.autonomous_operation_timer_); ase.autonomous_operation_timer_ = NULL; ase.autonomous_target_state_ = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE; } log::verbose("{}, ase_id {}", address_, ase.id); ase.state = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE; ase.cis_state = CisState::IDLE; ase.data_path_state = DataPathState::IDLE; Loading system/bta/le_audio/devices.h +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ class LeAudioDevice { bool HaveAllActiveAsesSameState(types::AseState state); bool HaveAllActiveAsesSameDataPathState(types::DataPathState state) const; bool HaveAnyUnconfiguredAses(void); bool HaveAnyStreamingAses(void); bool IsReadyToCreateStream(void); bool IsReadyToStream(void) const { return HaveAllActiveAsesCisEst() && Loading Loading
system/bta/le_audio/client.cc +0 −12 Original line number Diff line number Diff line Loading @@ -539,12 +539,6 @@ class LeAudioClientImpl : public LeAudioClient { } } void OnDeviceAutonomousStateTransitionTimeout(LeAudioDevice* leAudioDevice) { log::error("Device {}, failed to complete autonomous transition", leAudioDevice->address_); DisconnectDevice(leAudioDevice, true); } void UpdateLocationsAndContextsAvailability(LeAudioDeviceGroup* group, bool force = false) { bool group_conf_changed = group->ReloadAudioLocations(); Loading Loading @@ -6193,12 +6187,6 @@ class CallbacksImpl : public LeAudioGroupStateMachine::Callbacks { if (instance) instance->OnLeAudioDeviceSetStateTimeout(group_id); } void OnDeviceAutonomousStateTransitionTimeout( LeAudioDevice* leAudioDevice) override { if (instance) instance->OnDeviceAutonomousStateTransitionTimeout(leAudioDevice); } void OnUpdatedCisConfiguration(int group_id, uint8_t direction) { if (instance) instance->OnUpdatedCisConfiguration(group_id, direction); } Loading
system/bta/le_audio/device_groups.cc +12 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,18 @@ bool LeAudioDeviceGroup::IsGroupReadyToSuspendStream(void) const { return iter == leAudioDevices_.end(); } bool LeAudioDeviceGroup::HaveAnyActiveDeviceInStreamingState() const { auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(), [](auto& d) { if (d.expired()) return false; else return (((d.lock()).get())->HaveAnyStreamingAses()); }); return iter != leAudioDevices_.end(); } bool LeAudioDeviceGroup::HaveAnyActiveDeviceInUnconfiguredState() const { auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(), [](auto& d) { Loading
system/bta/le_audio/device_groups.h +1 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ class LeAudioDeviceGroup { types::DataPathState data_path_state) const; bool IsDeviceInTheGroup(LeAudioDevice* leAudioDevice) const; bool HaveAllActiveDevicesAsesTheSameState(types::AseState state) const; bool HaveAnyActiveDeviceInStreamingState() const; bool HaveAnyActiveDeviceInUnconfiguredState() const; bool IsGroupStreamReady(void) const; bool IsGroupReadyToCreateStream(void) const; Loading
system/bta/le_audio/devices.cc +16 −8 Original line number Diff line number Diff line Loading @@ -425,9 +425,6 @@ void LeAudioDevice::ClearPACs(void) { LeAudioDevice::~LeAudioDevice(void) { alarm_free(link_quality_timer); for (auto& ase : ases_) { alarm_free(ase.autonomous_operation_timer_); } this->ClearPACs(); } Loading Loading @@ -722,6 +719,19 @@ bool LeAudioDevice::HaveActiveAse(void) { return iter != ases_.end(); } bool LeAudioDevice::HaveAnyStreamingAses(void) { /* In configuring state when active in Idle or Configured and reconfigure */ auto iter = std::find_if(ases_.begin(), ases_.end(), [](const auto& ase) { if (!ase.active) return false; if (ase.state == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) return true; return false; }); return iter != ases_.end(); } bool LeAudioDevice::HaveAnyUnconfiguredAses(void) { /* In configuring state when active in Idle or Configured and reconfigure */ auto iter = std::find_if(ases_.begin(), ases_.end(), [](const auto& ase) { Loading Loading @@ -1131,11 +1141,9 @@ void LeAudioDevice::DeactivateAllAses(void) { bluetooth::common::ToString(ase.cis_state), bluetooth::common::ToString(ase.data_path_state)); } if (alarm_is_scheduled(ase.autonomous_operation_timer_)) { alarm_free(ase.autonomous_operation_timer_); ase.autonomous_operation_timer_ = NULL; ase.autonomous_target_state_ = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE; } log::verbose("{}, ase_id {}", address_, ase.id); ase.state = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE; ase.cis_state = CisState::IDLE; ase.data_path_state = DataPathState::IDLE; Loading
system/bta/le_audio/devices.h +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ class LeAudioDevice { bool HaveAllActiveAsesSameState(types::AseState state); bool HaveAllActiveAsesSameDataPathState(types::DataPathState state) const; bool HaveAnyUnconfiguredAses(void); bool HaveAnyStreamingAses(void); bool IsReadyToCreateStream(void); bool IsReadyToStream(void) const { return HaveAllActiveAsesCisEst() && Loading