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

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

Snap for 7347062 from afb78dac to sc-release

Change-Id: I8a3a3b6fdaa1b7f58d5384a07e1df2ff8eb9aeec
parents be19cdde afb78dac
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1780,6 +1780,9 @@ static void write_report_cb(uint16_t conn_id, tGATT_STATUS status,

  const gatt::Characteristic* p_char =
      BTA_GATTC_GetCharacteristic(conn_id, handle);

  if (p_char == nullptr) return;

  uint16_t uuid = p_char->uuid.As16Bit();
  if (uuid != GATT_UUID_HID_REPORT && uuid != GATT_UUID_HID_BT_KB_INPUT &&
      uuid != GATT_UUID_HID_BT_MOUSE_INPUT &&
+4 −6
Original line number Diff line number Diff line
@@ -282,15 +282,13 @@ void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, uint16_t event,
    bta_hh_better_state_machine(p_cb, event, p_data);

    if (in_state != p_cb->state) {
      APPL_TRACE_DEBUG("HH State Change: [%s] -> [%s] after Event [%s]",
                       bta_hh_state_code(in_state),
                       bta_hh_state_code(p_cb->state),
      LOG_DEBUG("HHID State Change: [%s] -> [%s] after Event [%s]",
                bta_hh_state_code(in_state), bta_hh_state_code(p_cb->state),
                bta_hh_evt_code(debug_event));
    }
  }

  return;
}

/*******************************************************************************
 *
 * Function         bta_hh_hdl_event
+4 −1
Original line number Diff line number Diff line
@@ -229,7 +229,6 @@ static inline pthread_t create_thread(void* (*start_routine)(void*),
 ******************************************************************************/
static void* btif_hh_poll_event_thread(void* arg) {
  btif_hh_device_t* p_dev = (btif_hh_device_t*)arg;
  APPL_TRACE_DEBUG("%s: Thread created fd = %d", __func__, p_dev->fd);
  struct pollfd pfds[1];

  // This thread is created by bt_main_thread with RT priority. Lower the thread
@@ -241,7 +240,10 @@ static void* btif_hh_poll_event_thread(void* arg) {
    p_dev->hh_poll_thread_id = -1;
    return 0;
  }
  p_dev->pid = gettid();
  pthread_setname_np(pthread_self(), BT_HH_THREAD);
  LOG_DEBUG("Host hid polling thread created name:%s pid:%d fd:%d",
            BT_HH_THREAD, p_dev->pid, p_dev->fd);

  pfds[0].fd = p_dev->fd;
  pfds[0].events = POLLIN;
@@ -265,6 +267,7 @@ static void* btif_hh_poll_event_thread(void* arg) {
  }

  p_dev->hh_poll_thread_id = -1;
  p_dev->pid = -1;
  return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ inline std::string btif_hh_status_text(const BTIF_HH_STATUS& status) {
}
#undef CASE_RETURN_TEXT

// Shared with uhid polling thread
typedef struct {
  bthh_connection_state_t dev_status;
  uint8_t dev_handle;
@@ -85,6 +86,7 @@ typedef struct {
  int fd;
  bool ready_for_data;
  pthread_t hh_poll_thread_id;
  pid_t pid{-1};
  uint8_t hh_keep_polling;
  alarm_t* vup_timer;
  fixed_queue_t* get_rpt_id_queue;
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include "hal/hci_hal_host.h"

#include <netdb.h>
#include <netinet/in.h>
#include <poll.h>
#include <sys/socket.h>
#include <sys/types.h>
Loading