Loading system/bta/le_audio/device_groups.h +10 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,16 @@ public: return dsa_modes_list; } bool DsaReducedSduSizeSupported() { bool reduced_sdu = false; for (auto leAudioDevice : leAudioDevices_) { if (!leAudioDevice.expired()) { reduced_sdu |= leAudioDevice.lock()->DsaReducedSduSizeSupported(); } } return reduced_sdu; } types::BidirectionalPair<types::AudioContexts> GetLatestAvailableContexts(void) const; bool IsInTransition(void) const; Loading system/bta/le_audio/devices.cc +5 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,9 @@ void LeAudioDevice::ParseHeadtrackingCodec(const struct types::acs_ac_record& pa return; } // Valid headtracker codec metadata available, so it must support reduced sdu size dsa_.reduced_sdu = true; uint8_t supported_transports = ltv[6]; DsaModes dsa_modes = {DsaMode::DISABLED}; Loading Loading @@ -1205,6 +1208,8 @@ void LeAudioDevice::UpdateDeviceAllowlistFlag(void) { DsaModes LeAudioDevice::GetDsaModes(void) { return dsa_.modes; } bool LeAudioDevice::DsaReducedSduSizeSupported() { return dsa_.reduced_sdu; } types::DataPathState LeAudioDevice::GetDsaDataPathState(void) { return dsa_.state; } void LeAudioDevice::SetDsaDataPathState(types::DataPathState state) { dsa_.state = state; } Loading system/bta/le_audio/devices.h +3 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ public: acl_asymmetric_(false), acl_phy_update_done_(false), link_quality_timer(nullptr), dsa_({{DsaMode::DISABLED}, types::DataPathState::IDLE, GATT_INVALID_CONN_ID}) {} dsa_({{DsaMode::DISABLED}, types::DataPathState::IDLE, GATT_INVALID_CONN_ID, false}) {} ~LeAudioDevice(void); void SetConnectionState(DeviceConnectState state); Loading Loading @@ -227,6 +227,7 @@ public: void GetDeviceModelName(void); void UpdateDeviceAllowlistFlag(void); DsaModes GetDsaModes(void); bool DsaReducedSduSizeSupported(); types::DataPathState GetDsaDataPathState(void); void SetDsaDataPathState(types::DataPathState state); uint16_t GetDsaCisHandle(void); Loading @@ -239,6 +240,7 @@ private: DsaModes modes; types::DataPathState state; uint16_t cis_handle; bool reduced_sdu; // TODO: Remove when earbud implementations move to approved DSA 2.0 standard } dsa_; static constexpr char kLeAudioDeviceAllowListProp[] = "persist.bluetooth.leaudio.allow_list"; Loading system/bta/le_audio/state_machine.cc +6 −0 Original line number Diff line number Diff line Loading @@ -1398,9 +1398,15 @@ private: param.max_trans_lat_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerMaxTransLat; it->max_sdu_size_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerMaxSduSize; // Early draft of DSA 2.0 spec mentioned allocating 15 bytes for headtracker data if (!com::android::bluetooth::flags::headtracker_sdu_size()) { it->max_sdu_size_stom = 15; } else if (!group->DsaReducedSduSizeSupported()) { log::verbose("Device does not support reduced headtracker SDU"); it->max_sdu_size_stom = 15; } it->rtn_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerRtn; it++; Loading Loading
system/bta/le_audio/device_groups.h +10 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,16 @@ public: return dsa_modes_list; } bool DsaReducedSduSizeSupported() { bool reduced_sdu = false; for (auto leAudioDevice : leAudioDevices_) { if (!leAudioDevice.expired()) { reduced_sdu |= leAudioDevice.lock()->DsaReducedSduSizeSupported(); } } return reduced_sdu; } types::BidirectionalPair<types::AudioContexts> GetLatestAvailableContexts(void) const; bool IsInTransition(void) const; Loading
system/bta/le_audio/devices.cc +5 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,9 @@ void LeAudioDevice::ParseHeadtrackingCodec(const struct types::acs_ac_record& pa return; } // Valid headtracker codec metadata available, so it must support reduced sdu size dsa_.reduced_sdu = true; uint8_t supported_transports = ltv[6]; DsaModes dsa_modes = {DsaMode::DISABLED}; Loading Loading @@ -1205,6 +1208,8 @@ void LeAudioDevice::UpdateDeviceAllowlistFlag(void) { DsaModes LeAudioDevice::GetDsaModes(void) { return dsa_.modes; } bool LeAudioDevice::DsaReducedSduSizeSupported() { return dsa_.reduced_sdu; } types::DataPathState LeAudioDevice::GetDsaDataPathState(void) { return dsa_.state; } void LeAudioDevice::SetDsaDataPathState(types::DataPathState state) { dsa_.state = state; } Loading
system/bta/le_audio/devices.h +3 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ public: acl_asymmetric_(false), acl_phy_update_done_(false), link_quality_timer(nullptr), dsa_({{DsaMode::DISABLED}, types::DataPathState::IDLE, GATT_INVALID_CONN_ID}) {} dsa_({{DsaMode::DISABLED}, types::DataPathState::IDLE, GATT_INVALID_CONN_ID, false}) {} ~LeAudioDevice(void); void SetConnectionState(DeviceConnectState state); Loading Loading @@ -227,6 +227,7 @@ public: void GetDeviceModelName(void); void UpdateDeviceAllowlistFlag(void); DsaModes GetDsaModes(void); bool DsaReducedSduSizeSupported(); types::DataPathState GetDsaDataPathState(void); void SetDsaDataPathState(types::DataPathState state); uint16_t GetDsaCisHandle(void); Loading @@ -239,6 +240,7 @@ private: DsaModes modes; types::DataPathState state; uint16_t cis_handle; bool reduced_sdu; // TODO: Remove when earbud implementations move to approved DSA 2.0 standard } dsa_; static constexpr char kLeAudioDeviceAllowListProp[] = "persist.bluetooth.leaudio.allow_list"; Loading
system/bta/le_audio/state_machine.cc +6 −0 Original line number Diff line number Diff line Loading @@ -1398,9 +1398,15 @@ private: param.max_trans_lat_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerMaxTransLat; it->max_sdu_size_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerMaxSduSize; // Early draft of DSA 2.0 spec mentioned allocating 15 bytes for headtracker data if (!com::android::bluetooth::flags::headtracker_sdu_size()) { it->max_sdu_size_stom = 15; } else if (!group->DsaReducedSduSizeSupported()) { log::verbose("Device does not support reduced headtracker SDU"); it->max_sdu_size_stom = 15; } it->rtn_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerRtn; it++; Loading