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

Commit 2767c20b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7098088 from 981ba6d3 to sc-release

Change-Id: Ie599e34049974823fada657d0d373a4b1fb7a65e
parents bbc3a3d1 981ba6d3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -94,7 +94,11 @@ fluoride_defaults {
fluoride_defaults {
    name: "fluoride_defaults",
    defaults: ["fluoride_defaults_fuzzable", "fluoride_types_defaults"],
    shared_libs: ["libstatslog"],
    shared_libs: [
        "libgrpc++",
        "libgrpc_wrap",
        "libstatslog"
    ],
    sanitize: {
        misc_undefined: ["bounds"],
    },
+38 −0
Original line number Diff line number Diff line
@@ -163,6 +163,8 @@ cc_defaults {
        "libchrome",
        "libcrypto",
        "libflatbuffers-cpp",
        "libgrpc++",
        "libgrpc_wrap",
    ],
    static_libs: [
        "libbluetooth-protos",
@@ -237,7 +239,9 @@ cc_binary {
        "libbacktrace",
        "libchrome",
        "libcrypto",
        "libgrpc++",
        "libgrpc++_unsecure",
        "libgrpc_wrap",
        "libprotobuf-cpp-full",
    ],
    target: {
@@ -248,6 +252,10 @@ cc_binary {
                "libutils",
                "libcutils",
            ],
            static_libs: [
                "libbt_common_sys_prop_cxx",
                "libbt_hidl_hal_cxx",
            ],
        },
        host: {
            required: [
@@ -295,6 +303,10 @@ cc_test {
                "libutils",
                "libcutils",
            ],
            static_libs: [
                "libbt_common_sys_prop_cxx",
                "libbt_hidl_hal_cxx",
            ],
        },
    },
    srcs: [
@@ -335,6 +347,8 @@ cc_test {
    shared_libs: [
        "libchrome",
        "libcrypto",
        "libgrpc++",
        "libgrpc_wrap",
    ],
    sanitize: {
        address: true,
@@ -370,6 +384,24 @@ cc_test {
        "libcxxbridge05",
        "libchrome",
    ],
    shared_libs: [
        "libgrpc++",
        "libgrpc_wrap",
    ],
    target: {
        android: {
            shared_libs: [
                "android.hardware.bluetooth@1.0",
                "libhidlbase",
                "libutils",
                "libcutils",
            ],
            static_libs: [
                "libbt_common_sys_prop_cxx",
                "libbt_hidl_hal_cxx",
            ],
        },
    },
}

cc_defaults {
@@ -397,6 +429,8 @@ cc_defaults {
    shared_libs: [
        "libcrypto",
        "libflatbuffers-cpp",
        "libgrpc++",
        "libgrpc_wrap",
    ],
    cflags: [
        "-DFUZZ_TARGET",
@@ -409,6 +443,10 @@ cc_defaults {
                "libhidlbase",
                "libutils",
            ],
            static_libs: [
                "libbt_common_sys_prop_cxx",
                "libbt_hidl_hal_cxx",
            ],
        },
    },
}
+28 −27
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@

#include <base/location.h>
#include <base/strings/stringprintf.h>

#include <time.h>

#include <chrono>
#include <cstdint>
#include <functional>
@@ -588,6 +588,8 @@ struct bluetooth::shim::legacy::Acl::impl {

  void EnqueueClassicPacket(
      HciHandle handle, std::unique_ptr<bluetooth::packet::RawBuilder> packet) {
    ASSERT_LOG(IsClassicAcl(handle), "handle %d is not a classic connection",
               handle);
    handle_to_classic_connection_map_[handle]->EnqueuePacket(std::move(packet));
  }

@@ -596,32 +598,30 @@ struct bluetooth::shim::legacy::Acl::impl {
           handle_to_le_connection_map_.end();
  }

  bool ClassicConnectionExists(HciHandle handle) {
    return handle_to_classic_connection_map_.find(handle) !=
           handle_to_classic_connection_map_.end();
  }

  void EnqueueLePacket(HciHandle handle,
                       std::unique_ptr<bluetooth::packet::RawBuilder> packet) {
    if (ClassicConnectionExists(handle))
    ASSERT_LOG(IsLeAcl(handle), "handle %d is not a LE connection", handle);
    handle_to_le_connection_map_[handle]->EnqueuePacket(std::move(packet));
  }

  void HoldMode(HciHandle handle, uint16_t max_interval,
                uint16_t min_interval) {
    if (ClassicConnectionExists(handle))
    ASSERT_LOG(IsClassicAcl(handle), "handle %d is not a classic connection",
               handle);
    handle_to_classic_connection_map_[handle]->HoldMode(max_interval,
                                                        min_interval);
  }

  void ExitSniffMode(HciHandle handle) {
    if (ClassicConnectionExists(handle))
    ASSERT_LOG(IsClassicAcl(handle), "handle %d is not a classic connection",
               handle);
    handle_to_classic_connection_map_[handle]->ExitSniffMode();
  }

  void SniffMode(HciHandle handle, uint16_t max_interval, uint16_t min_interval,
                 uint16_t attempt, uint16_t timeout) {
    if (ClassicConnectionExists(handle))
    ASSERT_LOG(IsClassicAcl(handle), "handle %d is not a classic connection",
               handle);
    handle_to_classic_connection_map_[handle]->SniffMode(
        max_interval, min_interval, attempt, timeout);
  }
@@ -629,15 +629,16 @@ struct bluetooth::shim::legacy::Acl::impl {
  void SniffSubrating(HciHandle handle, uint16_t maximum_latency,
                      uint16_t minimum_remote_timeout,
                      uint16_t minimum_local_timeout) {
    if (ClassicConnectionExists(handle))
    ASSERT_LOG(IsClassicAcl(handle), "handle %d is not a classic connection",
               handle);
    handle_to_classic_connection_map_[handle]->SniffSubrating(
        maximum_latency, minimum_remote_timeout, minimum_local_timeout);
  }

  void SetConnectionEncryption(HciHandle handle, hci::Enable enable) {
    if (ClassicConnectionExists(handle))
      handle_to_classic_connection_map_[handle]->SetConnectionEncryption(
          enable);
    ASSERT_LOG(IsClassicAcl(handle), "handle %d is not a classic connection",
               handle);
    handle_to_classic_connection_map_[handle]->SetConnectionEncryption(enable);
  }

  void DumpConnectionHistory() const {
@@ -922,9 +923,9 @@ void bluetooth::shim::legacy::Acl::OnLeLinkDisconnected(HciHandle handle,
  hci::AddressWithType remote_address_with_type =
      pimpl_->handle_to_le_connection_map_[handle]->GetRemoteAddressWithType();
  CreationTime creation_time =
      pimpl_->handle_to_classic_connection_map_[handle]->GetCreationTime();
      pimpl_->handle_to_le_connection_map_[handle]->GetCreationTime();
  bool is_locally_initiated =
      pimpl_->handle_to_classic_connection_map_[handle]->IsLocallyInitiated();
      pimpl_->handle_to_le_connection_map_[handle]->IsLocallyInitiated();

  TeardownTime teardown_time = std::chrono::system_clock::now();

+4 −6
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ void btm_sco_conn_req(const RawAddress& bda, DEV_CLASS dev_class,
 * Returns          void
 *
 ******************************************************************************/
void btm_sco_connected(uint8_t hci_status, const RawAddress* bda,
void btm_sco_connected(uint8_t hci_status, const RawAddress& bda,
                       uint16_t hci_handle, tBTM_ESCO_DATA* p_esco_data) {
  tSCO_CONN* p = &btm_cb.sco_cb.sco_db[0];
  uint16_t xx;
@@ -693,7 +693,7 @@ void btm_sco_connected(uint8_t hci_status, const RawAddress* bda,
  for (xx = 0; xx < BTM_MAX_SCO_LINKS; xx++, p++) {
    if (((p->state == SCO_ST_CONNECTING) || (p->state == SCO_ST_LISTENING) ||
         (p->state == SCO_ST_W4_CONN_RSP)) &&
        (p->rem_bd_known) && (!bda || p->esco.data.bd_addr == *bda)) {
        (p->rem_bd_known) && (p->esco.data.bd_addr == bda)) {
      if (hci_status != HCI_SUCCESS) {
        /* Report the error if originator, otherwise remain in Listen mode */
        if (p->is_orig) {
@@ -726,15 +726,13 @@ void btm_sco_connected(uint8_t hci_status, const RawAddress* bda,
      p->state = SCO_ST_CONNECTED;
      p->hci_handle = hci_handle;

      RawAddress bd_addr(*bda);

      if (hci_status == HCI_SUCCESS) {
        BTM_LogHistory(kBtmLogTag, bd_addr, "Connection success",
        BTM_LogHistory(kBtmLogTag, bda, "Connection success",
                       base::StringPrintf("handle:0x%04x %s", hci_handle,
                                          (spt) ? "listener" : "initiator"));
      } else {
        BTM_LogHistory(
            kBtmLogTag, bd_addr, "Connection failed",
            kBtmLogTag, bda, "Connection failed",
            base::StringPrintf(
                "reason:%s",
                hci_reason_code_text(static_cast<tHCI_REASON>(hci_status))
+2 −4
Original line number Diff line number Diff line
@@ -962,7 +962,7 @@ static void btu_hcif_connection_comp_evt(uint8_t* p, uint8_t evt_len) {
    memset(&esco_data, 0, sizeof(tBTM_ESCO_DATA));
    /* esco_data.link_type = HCI_LINK_TYPE_SCO; already zero */
    esco_data.bd_addr = bda;
    btm_sco_connected(status, &bda, handle, &esco_data);
    btm_sco_connected(status, bda, handle, &esco_data);
  }
}

@@ -1178,7 +1178,7 @@ static void btu_hcif_esco_connection_comp_evt(uint8_t* p) {
  handle = HCID_GET_HANDLE(handle);

  data.bd_addr = bda;
  btm_sco_connected(status, &bda, handle, &data);
  btm_sco_connected(status, bda, handle, &data);
}

/*******************************************************************************
@@ -1437,8 +1437,6 @@ static void btu_hcif_hdl_command_status(uint16_t opcode, uint8_t status,
        // Determine if initial connection failed or is a change of setup
        if (btm_is_sco_active(handle)) {
          btm_esco_proc_conn_chg(status, handle, 0, 0, 0, 0);
        } else {
          btm_sco_connected(status, nullptr, handle, nullptr);
        }
      }
      break;
Loading