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

Commit 694de03e authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Automerger Merge Worker
Browse files

Merge "Allow 15 byte headtracker SDU for early implementations" into main am: 7424113f

parents 67d60cb9 7424113f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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;
+5 −0
Original line number Diff line number Diff line
@@ -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};

@@ -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; }
+3 −1
Original line number Diff line number Diff line
@@ -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);
@@ -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);
@@ -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";
+6 −0
Original line number Diff line number Diff line
@@ -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++;