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

Commit aa63bd26 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add code for two rc reconnect at same time, one rc cannot work" am:...

Merge "Add code for two rc reconnect at same time, one rc cannot work" am: 59953d55 am: 8cfc8e21 am: 9eabc374 am: 1933d860

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1902972

Change-Id: Ie84640190aaf66ffe091fb256d5408915efcfccc
parents 0c6d5bd2 1933d860
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -907,10 +907,15 @@ void bta_hh_close_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
void bta_hh_get_dscp_act(tBTA_HH_DEV_CB* p_cb,
void bta_hh_get_dscp_act(tBTA_HH_DEV_CB* p_cb,
                         UNUSED_ATTR const tBTA_HH_DATA* p_data) {
                         UNUSED_ATTR const tBTA_HH_DATA* p_data) {
  if (p_cb->is_le_device) {
  if (p_cb->is_le_device) {
    if (p_cb->hid_srvc.in_use) {
      p_cb->dscp_info.hid_handle = p_cb->hid_handle;
    }
    bta_hh_le_get_dscp_act(p_cb);
    bta_hh_le_get_dscp_act(p_cb);
  } else
  } else {
    p_cb->dscp_info.hid_handle = p_cb->hid_handle;
    (*bta_hh_cb.p_cback)(BTA_HH_GET_DSCP_EVT, (tBTA_HH*)&p_cb->dscp_info);
    (*bta_hh_cb.p_cback)(BTA_HH_GET_DSCP_EVT, (tBTA_HH*)&p_cb->dscp_info);
  }
  }
}


/*******************************************************************************
/*******************************************************************************
 *
 *
+1 −0
Original line number Original line Diff line number Diff line
@@ -225,6 +225,7 @@ typedef struct {


  uint8_t flag;
  uint8_t flag;
  tBTA_HH_DEV_DESCR descriptor;
  tBTA_HH_DEV_DESCR descriptor;
  uint8_t hid_handle;


  std::string ToString() const {
  std::string ToString() const {
    return base::StringPrintf("%04x::%04x::%04x", vendor_id, product_id,
    return base::StringPrintf("%04x::%04x::%04x", vendor_id, product_id,
+0 −1
Original line number Original line Diff line number Diff line
@@ -116,7 +116,6 @@ typedef struct {
  btif_hh_device_t devices[BTIF_HH_MAX_HID];
  btif_hh_device_t devices[BTIF_HH_MAX_HID];
  uint32_t device_num;
  uint32_t device_num;
  btif_hh_added_device_t added_devices[BTIF_HH_MAX_ADDED_DEV];
  btif_hh_added_device_t added_devices[BTIF_HH_MAX_ADDED_DEV];
  btif_hh_device_t* p_curr_dev;
  bool service_dereg_active;
  bool service_dereg_active;
  RawAddress pending_conn_address;
  RawAddress pending_conn_address;
} btif_hh_cb_t;
} btif_hh_cb_t;
+2 −3
Original line number Original line Diff line number Diff line
@@ -811,8 +811,6 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) {
          if (check_cod(&p_data->conn.bda, COD_HID_KEYBOARD) ||
          if (check_cod(&p_data->conn.bda, COD_HID_KEYBOARD) ||
              check_cod(&p_data->conn.bda, COD_HID_COMBO))
              check_cod(&p_data->conn.bda, COD_HID_COMBO))
            BTA_HhSetIdle(p_data->conn.handle, 0);
            BTA_HhSetIdle(p_data->conn.handle, 0);
          btif_hh_cb.p_curr_dev =
              btif_hh_find_connected_dev_by_handle(p_data->conn.handle);
          BTA_HhGetDscpInfo(p_data->conn.handle);
          BTA_HhGetDscpInfo(p_data->conn.handle);
          p_dev->dev_status = BTHH_CONN_STATE_CONNECTED;
          p_dev->dev_status = BTHH_CONN_STATE_CONNECTED;
          HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr),
          HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr),
@@ -956,10 +954,11 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) {
    case BTA_HH_GET_DSCP_EVT:
    case BTA_HH_GET_DSCP_EVT:
      len = p_data->dscp_info.descriptor.dl_len;
      len = p_data->dscp_info.descriptor.dl_len;
      BTIF_TRACE_DEBUG("BTA_HH_GET_DSCP_EVT: len = %d", len);
      BTIF_TRACE_DEBUG("BTA_HH_GET_DSCP_EVT: len = %d", len);
      p_dev = btif_hh_cb.p_curr_dev;
      p_dev = btif_hh_find_connected_dev_by_handle(p_data->dscp_info.hid_handle);
      if (p_dev == NULL) {
      if (p_dev == NULL) {
        BTIF_TRACE_ERROR(
        BTIF_TRACE_ERROR(
            "BTA_HH_GET_DSCP_EVT: No HID device is currently connected");
            "BTA_HH_GET_DSCP_EVT: No HID device is currently connected");
        p_data->dscp_info.hid_handle = BTA_HH_INVALID_HANDLE;
        return;
        return;
      }
      }
      if (p_dev->fd < 0) {
      if (p_dev->fd < 0) {