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

Commit 4f16b745 authored by Henri Chataing's avatar Henri Chataing
Browse files

Remove unused state following removal of a2dp_concurrent_source_sink

Bug: 331817295
Flag: EXEMPT, dead code removal
Test: m com.android.btservices
Change-Id: I3ba2424ef6cc598fb484548325eebaf1985f7939
parent 1941c52c
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -103,7 +103,6 @@ void BtaAvCo::Init(const std::vector<btav_a2dp_codec_config_t>& codec_priorities
}
}


void BtaAvCo::Reset() {
void BtaAvCo::Reset() {
  bta_av_legacy_state_.Reset();
  bta_av_source_state_.Reset();
  bta_av_source_state_.Reset();
  bta_av_sink_state_.Reset();
  bta_av_sink_state_.Reset();
  content_protect_flag_ = 0;
  content_protect_flag_ = 0;
@@ -980,12 +979,6 @@ void BtaAvCo::DebugDump(int fd) {
  //
  //
  // Active peer codec-specific stats
  // Active peer codec-specific stats
  //
  //
  if (bta_av_legacy_state_.getActivePeer() != nullptr) {
    A2dpCodecs* a2dp_codecs = bta_av_legacy_state_.getActivePeer()->GetCodecs();
    if (a2dp_codecs != nullptr) {
      a2dp_codecs->debug_codec_dump(fd);
    }
  }
  if (bta_av_source_state_.getActivePeer() != nullptr) {
  if (bta_av_source_state_.getActivePeer() != nullptr) {
    A2dpCodecs* a2dp_codecs = bta_av_source_state_.getActivePeer()->GetCodecs();
    A2dpCodecs* a2dp_codecs = bta_av_source_state_.getActivePeer()->GetCodecs();
    if (a2dp_codecs != nullptr) {
    if (a2dp_codecs != nullptr) {
@@ -1000,10 +993,6 @@ void BtaAvCo::DebugDump(int fd) {
  }
  }


  dprintf(fd, "\nA2DP Peers State:\n");
  dprintf(fd, "\nA2DP Peers State:\n");
  dprintf(fd, "  Active peer: %s\n",
          (bta_av_legacy_state_.getActivePeer() != nullptr)
                  ? ADDRESS_TO_LOGGABLE_CSTR(bta_av_legacy_state_.getActivePeer()->addr)
                  : "null");
  dprintf(fd, "  Source: active peer: %s\n",
  dprintf(fd, "  Source: active peer: %s\n",
          (bta_av_source_state_.getActivePeer() != nullptr)
          (bta_av_source_state_.getActivePeer() != nullptr)
                  ? ADDRESS_TO_LOGGABLE_CSTR(bta_av_source_state_.getActivePeer()->addr)
                  ? ADDRESS_TO_LOGGABLE_CSTR(bta_av_source_state_.getActivePeer()->addr)
+0 −1
Original line number Original line Diff line number Diff line
@@ -553,7 +553,6 @@ private:


  const bool content_protect_enabled_;  // True if Content Protect is enabled
  const bool content_protect_enabled_;  // True if Content Protect is enabled
  uint8_t content_protect_flag_;        // Content Protect flag
  uint8_t content_protect_flag_;        // Content Protect flag
  BtaAvCoState bta_av_legacy_state_;    // Legacy state
  BtaAvCoState bta_av_source_state_;    // Source profile state
  BtaAvCoState bta_av_source_state_;    // Source profile state
  BtaAvCoState bta_av_sink_state_;      // Sink profile state
  BtaAvCoState bta_av_sink_state_;      // Sink profile state
};
};
+0 −8
Original line number Original line Diff line number Diff line
@@ -402,7 +402,6 @@ public:
      : callbacks_(nullptr),
      : callbacks_(nullptr),
        enabled_(false),
        enabled_(false),
        a2dp_offload_enabled_(false),
        a2dp_offload_enabled_(false),
        invalid_peer_check_(false),
        max_connected_peers_(kDefaultMaxConnectedAudioDevices) {}
        max_connected_peers_(kDefaultMaxConnectedAudioDevices) {}
  ~BtifAvSource();
  ~BtifAvSource();


@@ -416,8 +415,6 @@ public:
  btav_source_callbacks_t* Callbacks() { return callbacks_; }
  btav_source_callbacks_t* Callbacks() { return callbacks_; }
  bool Enabled() const { return enabled_; }
  bool Enabled() const { return enabled_; }
  bool A2dpOffloadEnabled() const { return a2dp_offload_enabled_; }
  bool A2dpOffloadEnabled() const { return a2dp_offload_enabled_; }
  // TODO(b/321806163): Remove this method as part of flag cleanup
  void SetInvalidPeerCheck(bool invalid_peer_check) { invalid_peer_check_ = invalid_peer_check; }
  BtifAvPeer* FindPeer(const RawAddress& peer_address);
  BtifAvPeer* FindPeer(const RawAddress& peer_address);
  BtifAvPeer* FindPeerByHandle(tBTA_AV_HNDL bta_handle);
  BtifAvPeer* FindPeerByHandle(tBTA_AV_HNDL bta_handle);
  BtifAvPeer* FindPeerByPeerId(uint8_t peer_id);
  BtifAvPeer* FindPeerByPeerId(uint8_t peer_id);
@@ -626,7 +623,6 @@ private:
  btav_source_callbacks_t* callbacks_;
  btav_source_callbacks_t* callbacks_;
  bool enabled_;
  bool enabled_;
  bool a2dp_offload_enabled_;
  bool a2dp_offload_enabled_;
  bool invalid_peer_check_;  // pending to check at BTA_AV_OPEN_EVT
  int max_connected_peers_;
  int max_connected_peers_;
  std::map<RawAddress, BtifAvPeer*> peers_;
  std::map<RawAddress, BtifAvPeer*> peers_;
  std::set<RawAddress> silenced_peers_;
  std::set<RawAddress> silenced_peers_;
@@ -645,7 +641,6 @@ public:
  BtifAvSink()
  BtifAvSink()
      : callbacks_(nullptr),
      : callbacks_(nullptr),
        enabled_(false),
        enabled_(false),
        invalid_peer_check_(false),
        max_connected_peers_(kDefaultMaxConnectedAudioDevices) {}
        max_connected_peers_(kDefaultMaxConnectedAudioDevices) {}
  ~BtifAvSink();
  ~BtifAvSink();


@@ -656,8 +651,6 @@ public:
  btav_sink_callbacks_t* Callbacks() { return callbacks_; }
  btav_sink_callbacks_t* Callbacks() { return callbacks_; }
  bool Enabled() const { return enabled_; }
  bool Enabled() const { return enabled_; }


  // TODO(b/321806163): Remove this method as part of flag cleanup
  void SetInvalidPeerCheck(bool invalid_peer_check) { invalid_peer_check_ = invalid_peer_check; }
  BtifAvPeer* FindPeer(const RawAddress& peer_address);
  BtifAvPeer* FindPeer(const RawAddress& peer_address);
  BtifAvPeer* FindPeerByHandle(tBTA_AV_HNDL bta_handle);
  BtifAvPeer* FindPeerByHandle(tBTA_AV_HNDL bta_handle);
  BtifAvPeer* FindPeerByPeerId(uint8_t peer_id);
  BtifAvPeer* FindPeerByPeerId(uint8_t peer_id);
@@ -761,7 +754,6 @@ private:


  btav_sink_callbacks_t* callbacks_;
  btav_sink_callbacks_t* callbacks_;
  bool enabled_;
  bool enabled_;
  bool invalid_peer_check_;  // pending to check at BTA_AV_OPEN_EVT
  int max_connected_peers_;
  int max_connected_peers_;
  std::map<RawAddress, BtifAvPeer*> peers_;
  std::map<RawAddress, BtifAvPeer*> peers_;
  RawAddress active_peer_;
  RawAddress active_peer_;