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

Commit 803cfcf1 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Jakub Pawłowski
Browse files

CoreInterface::onLinkDown transport

Classic profiles don't care about LE transport connection/disconnection

Test: switch between LE Audio and Classic multiple times
Test: mma -j32
Flag: exempt, trivial
Bug: 334762961
Change-Id: I75aad0d401f836347afc75d58f68fa93339e04ac
parent 780fcca2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -146,7 +146,8 @@ struct CoreInterface {
  virtual bt_status_t toggleProfile(tBTA_SERVICE_ID service_id,
                                    bool enable) = 0;
  virtual void removeDeviceFromProfiles(const RawAddress& bd_addr) = 0;
  virtual void onLinkDown(const RawAddress& bd_addr) = 0;
  virtual void onLinkDown(const RawAddress& bd_addr,
                          tBT_TRANSPORT transport) = 0;

  CoreInterface(EventCallbacks* eventCallbacks,
                ConfigInterface* configInterface, CodecInterface* msbcCodec,
+2 −1
Original line number Diff line number Diff line
@@ -126,7 +126,8 @@ struct MockCoreInterface : public CoreInterface {
              (tBTA_SERVICE_ID service_id, bool enable), ());
  MOCK_METHOD((void), removeDeviceFromProfiles, (const RawAddress& bd_addr),
              ());
  MOCK_METHOD((void), onLinkDown, (const RawAddress& bd_addr), ());
  MOCK_METHOD((void), onLinkDown,
              (const RawAddress& bd_addr, tBT_TRANSPORT transport), ());
};

}  // namespace testing
+3 −1
Original line number Diff line number Diff line
@@ -331,7 +331,9 @@ struct CoreInterfaceImpl : bluetooth::core::CoreInterface {
    }
  }

  void onLinkDown(const RawAddress& bd_addr) override {
  void onLinkDown(const RawAddress& bd_addr, tBT_TRANSPORT transport) override {
    if (transport != BT_TRANSPORT_BR_EDR) return;

    if (com::android::bluetooth::flags::a2dp_concurrent_source_sink()) {
      btif_av_acl_disconnected(bd_addr, A2dpType::kSource);
      btif_av_acl_disconnected(bd_addr, A2dpType::kSink);
+2 −1
Original line number Diff line number Diff line
@@ -2464,7 +2464,8 @@ void btif_dm_acl_evt(tBTA_DM_ACL_EVT event, tBTA_DM_ACL* p_data) {
    case BTA_DM_LINK_DOWN_EVT: {
      bd_addr = p_data->link_down.bd_addr;
      btm_set_bond_type_dev(p_data->link_down.bd_addr, BOND_TYPE_UNKNOWN);
      GetInterfaceToProfiles()->onLinkDown(bd_addr);
      GetInterfaceToProfiles()->onLinkDown(
          bd_addr, p_data->link_down.transport_link_type);

      bt_conn_direction_t direction;
      switch (btm_get_acl_disc_reason_code()) {
+2 −1
Original line number Diff line number Diff line
@@ -126,4 +126,5 @@ bt_status_t MockCoreInterface::toggleProfile(tBTA_SERVICE_ID /* service_id */,
void MockCoreInterface::removeDeviceFromProfiles(
    const RawAddress& /* bd_addr */){};

void MockCoreInterface::onLinkDown(const RawAddress& /* bd_addr */){};
void MockCoreInterface::onLinkDown(const RawAddress& /* bd_addr */,
                                   tBT_TRANSPORT /* transport */){};
Loading