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

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

Merge "system/btif: Fix -Wmissing-prototypes errors" into main

parents 144eb1ec 0d017369
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -37,9 +37,11 @@
#include "audio_hal_interface/a2dp_encoding.h"
#include "bta/include/bta_av_api.h"
#include "bta/include/bta_av_ci.h"
#include "bta/include/bta_av_co.h"
#include "btif/include/bta_av_co_peer.h"
#include "btif/include/btif_a2dp_source.h"
#include "btif/include/btif_av.h"
#include "btif/include/btif_av_co.h"
#include "device/include/device_iot_config.h"
#include "include/hardware/bt_av.h"
#include "internal_include/bt_trace.h"
@@ -53,9 +55,6 @@
#include "stack/include/bt_uuid16.h"
#include "types/raw_address.h"

// TODO(b/369381361) Enfore -Wmissing-prototypes
#pragma GCC diagnostic ignored "-Wmissing-prototypes"

using namespace bluetooth;

// SCMS-T protect info
+8 −13
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <cerrno>

#include "bta_hh_api.h"
#include "btif_config.h"
#include "btif_hh.h"
#include "hci/controller_interface.h"
#include "main/shim/entry.h"
@@ -40,13 +41,6 @@
#include "osi/include/properties.h"
#include "storage/config_keys.h"
#include "types/raw_address.h"

// TODO(b/369381361) Enfore -Wmissing-prototypes
#pragma GCC diagnostic ignored "-Wmissing-prototypes"

const char* dev_path = "/dev/uhid";

#include "btif_config.h"
#define BTA_HH_NV_LOAD_MAX 16
static tBTA_HH_RPT_CACHE_ENTRY sReportCache[BTA_HH_NV_LOAD_MAX];
#define BTA_HH_CACHE_REPORT_VERSION 1
@@ -64,15 +58,16 @@ static tBTA_HH_RPT_CACHE_ENTRY sReportCache[BTA_HH_NV_LOAD_MAX];

using namespace bluetooth;

static const char kPropertyWaitMsAfterUhidOpen[] = "bluetooth.hid.wait_ms_after_uhid_open";
static constexpr char kDevPath[] = "/dev/uhid";
static constexpr char kPropertyWaitMsAfterUhidOpen[] = "bluetooth.hid.wait_ms_after_uhid_open";

static const bthh_report_type_t map_rtype_uhid_hh[] = {BTHH_FEATURE_REPORT, BTHH_OUTPUT_REPORT,
static constexpr bthh_report_type_t map_rtype_uhid_hh[] = {BTHH_FEATURE_REPORT, BTHH_OUTPUT_REPORT,
                                                           BTHH_INPUT_REPORT};

static void* btif_hh_poll_event_thread(void* arg);
static bool to_uhid_thread(int fd, const tBTA_HH_TO_UHID_EVT* ev, size_t data_len);

void uhid_set_non_blocking(int fd) {
static void uhid_set_non_blocking(int fd) {
  int opts = fcntl(fd, F_GETFL);
  if (opts < 0) {
    log::error("Getting flags failed ({})", strerror(errno));
@@ -508,7 +503,7 @@ static void uhid_fd_close(btif_hh_uhid_t* p_uhid) {
static bool uhid_fd_open(btif_hh_device_t* p_dev) {
  if (!com::android::bluetooth::flags::hid_report_queuing()) {
    if (p_dev->uhid.fd < 0) {
      p_dev->uhid.fd = open(dev_path, O_RDWR | O_CLOEXEC);
      p_dev->uhid.fd = open(kDevPath, O_RDWR | O_CLOEXEC);
      if (p_dev->uhid.fd < 0) {
        log::error("Failed to open uhid, err:{}", strerror(errno));
        return false;
@@ -680,7 +675,7 @@ static void* btif_hh_poll_event_thread(void* arg) {
  btif_hh_uhid_t* p_uhid = (btif_hh_uhid_t*)arg;

  if (com::android::bluetooth::flags::hid_report_queuing()) {
    p_uhid->fd = open(dev_path, O_RDWR | O_CLOEXEC);
    p_uhid->fd = open(kDevPath, O_RDWR | O_CLOEXEC);
    if (p_uhid->fd < 0) {
      log::error("Failed to open uhid, err:{}", strerror(errno));
      close(p_uhid->internal_recv_fd);
+2 −0
Original line number Diff line number Diff line
@@ -116,6 +116,8 @@ void btif_dm_set_event_filter_inquiry_result_all_devices();
void btif_dm_metadata_changed(const RawAddress& remote_bd_addr, int key,
                              std::vector<uint8_t> value);

void btif_dm_hh_open_failed(RawAddress* bdaddr);

/*callout for reading SMP properties from Text file*/
bool btif_dm_get_smp_config(tBTE_APPL_CFG* p_cfg);

+6 −0
Original line number Diff line number Diff line
@@ -158,6 +158,12 @@ void btif_hh_load_bonded_dev(const tAclLinkSpec& link_spec, tBTA_HH_ATTR_MASK at
                             uint8_t sub_class, uint8_t app_id, tBTA_HH_DEV_DSCP_INFO dscp_info,
                             bool reconnect_allowed);

int bta_hh_co_write(int fd, uint8_t* rpt, uint16_t len);
void bta_hh_co_close(btif_hh_device_t* p_dev);
void bta_hh_co_send_hid_info(btif_hh_device_t* p_dev, const char* dev_name, uint16_t vendor_id,
                             uint16_t product_id, uint16_t version, uint8_t ctry_code,
                             uint16_t dscp_len, uint8_t* p_dscp);

void DumpsysHid(int fd);

namespace fmt {
+7 −9
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@
#include "bta_hh_co.h"
#include "bta_sec_api.h"
#include "btif/include/btif_common.h"
#include "btif/include/btif_dm.h"
#include "btif/include/btif_hd.h"
#include "btif/include/btif_metrics_logging.h"
#include "btif/include/btif_profile_storage.h"
#include "btif/include/btif_storage.h"
@@ -141,21 +143,17 @@ static tHID_KB_LIST hid_kb_numlock_on_list[] = {
 ******************************************************************************/

static void btif_hh_transport_select(tAclLinkSpec& link_spec);

/*******************************************************************************
 *  Externs
 ******************************************************************************/

bool check_cod(const RawAddress* remote_bdaddr, uint32_t cod);
bool check_cod_hid(const RawAddress* remote_bdaddr);
bool check_cod_hid_major(const RawAddress& bd_addr, uint32_t cod);
void bta_hh_co_close(btif_hh_device_t* p_dev);
void bta_hh_co_send_hid_info(btif_hh_device_t* p_dev, const char* dev_name, uint16_t vendor_id,
                             uint16_t product_id, uint16_t version, uint8_t ctry_code,
                             uint16_t dscp_len, uint8_t* p_dscp);
void bta_hh_co_write(int fd, uint8_t* rpt, uint16_t len);

static void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data);
void btif_dm_hh_open_failed(RawAddress* bdaddr);
void btif_hd_service_registration();
void btif_hh_timer_timeout(void* data);
static void btif_hh_timer_timeout(void* data);

/*******************************************************************************
 *  Functions
@@ -1434,7 +1432,7 @@ static void btif_hh_handle_evt(uint16_t event, char* p_param) {
 *
 * Returns      void
 ******************************************************************************/
void btif_hh_timer_timeout(void* data) {
static void btif_hh_timer_timeout(void* data) {
  btif_hh_device_t* p_dev = (btif_hh_device_t*)data;
  tBTA_HH_EVT event = BTA_HH_VC_UNPLUG_EVT;
  tBTA_HH p_data;
Loading