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

Commit c16dd957 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "CoreInterface::onLinkDown transport" into main

parents 629f1d63 803cfcf1
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -146,7 +146,8 @@ struct CoreInterface {
  virtual bt_status_t toggleProfile(tBTA_SERVICE_ID service_id,
  virtual bt_status_t toggleProfile(tBTA_SERVICE_ID service_id,
                                    bool enable) = 0;
                                    bool enable) = 0;
  virtual void removeDeviceFromProfiles(const RawAddress& bd_addr) = 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,
  CoreInterface(EventCallbacks* eventCallbacks,
                ConfigInterface* configInterface, CodecInterface* msbcCodec,
                ConfigInterface* configInterface, CodecInterface* msbcCodec,
+2 −1
Original line number Original line Diff line number Diff line
@@ -126,7 +126,8 @@ struct MockCoreInterface : public CoreInterface {
              (tBTA_SERVICE_ID service_id, bool enable), ());
              (tBTA_SERVICE_ID service_id, bool enable), ());
  MOCK_METHOD((void), removeDeviceFromProfiles, (const RawAddress& bd_addr),
  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
}  // namespace testing
+3 −1
Original line number Original line 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()) {
    if (com::android::bluetooth::flags::a2dp_concurrent_source_sink()) {
      btif_av_acl_disconnected(bd_addr, A2dpType::kSource);
      btif_av_acl_disconnected(bd_addr, A2dpType::kSource);
      btif_av_acl_disconnected(bd_addr, A2dpType::kSink);
      btif_av_acl_disconnected(bd_addr, A2dpType::kSink);
+2 −1
Original line number Original line Diff line number Diff line
@@ -2431,7 +2431,8 @@ void btif_dm_acl_evt(tBTA_DM_ACL_EVT event, tBTA_DM_ACL* p_data) {
    case BTA_DM_LINK_DOWN_EVT: {
    case BTA_DM_LINK_DOWN_EVT: {
      bd_addr = p_data->link_down.bd_addr;
      bd_addr = p_data->link_down.bd_addr;
      btm_set_bond_type_dev(p_data->link_down.bd_addr, BOND_TYPE_UNKNOWN);
      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;
      bt_conn_direction_t direction;
      switch (btm_get_acl_disc_reason_code()) {
      switch (btm_get_acl_disc_reason_code()) {
+2 −1
Original line number Original line Diff line number Diff line
@@ -126,4 +126,5 @@ bt_status_t MockCoreInterface::toggleProfile(tBTA_SERVICE_ID /* service_id */,
void MockCoreInterface::removeDeviceFromProfiles(
void MockCoreInterface::removeDeviceFromProfiles(
    const RawAddress& /* bd_addr */){};
    const RawAddress& /* bd_addr */){};


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