summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Archie Pusaka <apusaka@google.com> 2025-03-18 23:40:45 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-18 23:40:45 -0700
commitd457d788be608640e9bc4270b8687fd9eff25933 (patch)
tree0bd35ecaa78c3808e4805a1b71e697959a795981
parenta1e2e5241b28ab59791dc67993d3916b0bd6d7b5 (diff)
parentaa4928932a228a95605dab92b5a23dcbcf7d46c4 (diff)
Merge changes I4260c630,Id0fd9d5a into main
* changes: Remove forward_get_set_report_failure_to_uhid flag Remove serialize_hogp_and_dis flag
-rw-r--r--flags/hid.aconfig20
-rw-r--r--system/bta/hh/bta_hh_le.cc72
-rw-r--r--system/btif/src/btif_hh.cc4
3 files changed, 17 insertions, 79 deletions
diff --git a/flags/hid.aconfig b/flags/hid.aconfig
index 829352e859..350367818b 100644
--- a/flags/hid.aconfig
+++ b/flags/hid.aconfig
@@ -20,16 +20,6 @@ flag {
}
flag {
- name: "serialize_hogp_and_dis"
- namespace: "bluetooth"
- description: "start HOGP service discovery only after DIS discovery is finished"
- bug: "367910199"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
-
-flag {
name: "dont_send_hid_set_idle"
namespace: "bluetooth"
description: "Don't send the SET IDLE HID message"
@@ -40,16 +30,6 @@ flag {
}
flag {
- name: "forward_get_set_report_failure_to_uhid"
- namespace: "bluetooth"
- description: "Forward GET/SET REPORT reply to UHID even when the request fails"
- bug: "369748430"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
-
-flag {
name: "remove_pending_hid_connection"
namespace: "bluetooth"
description: "Remove the pending BTA HH connection instance when the device is removed"
diff --git a/system/bta/hh/bta_hh_le.cc b/system/bta/hh/bta_hh_le.cc
index 6dc6365562..9cbd8569ab 100644
--- a/system/bta/hh/bta_hh_le.cc
+++ b/system/bta/hh/bta_hh_le.cc
@@ -925,14 +925,8 @@ static void bta_hh_le_dis_cback(const RawAddress& addr, tDIS_VALUE* p_dis_value)
p_cb->dscp_info.version = p_dis_value->pnp_id.product_version;
}
- /* TODO(b/367910199): un-serialize once multiservice HoGP is implemented */
- if (com::android::bluetooth::flags::serialize_hogp_and_dis()) {
- Uuid pri_srvc = Uuid::From16Bit(UUID_SERVCLASS_LE_HID);
- BTA_GATTC_ServiceSearchRequest(p_cb->conn_id, pri_srvc);
- return;
- }
-
- bta_hh_le_open_cmpl(p_cb);
+ Uuid pri_srvc = Uuid::From16Bit(UUID_SERVCLASS_LE_HID);
+ BTA_GATTC_ServiceSearchRequest(p_cb->conn_id, pri_srvc);
}
/*******************************************************************************
@@ -950,23 +944,16 @@ static void bta_hh_le_pri_service_discovery(tBTA_HH_DEV_CB* p_cb) {
p_cb->disc_active |= (BTA_HH_LE_DISC_HIDS | BTA_HH_LE_DISC_DIS);
- /* read DIS info */
+ /* read DIS info. If failed, continue to discover HoGP services. */
if (!DIS_ReadDISInfo(p_cb->link_spec.addrt.bda, bta_hh_le_dis_cback, DIS_ATTR_PNP_ID_BIT)) {
log::error("read DIS failed");
p_cb->disc_active &= ~BTA_HH_LE_DISC_DIS;
- } else {
- /* TODO(b/367910199): un-serialize once multiservice HoGP is implemented */
- if (com::android::bluetooth::flags::serialize_hogp_and_dis()) {
- log::debug("Waiting for DIS result before starting HoGP service discovery");
- return;
- }
+ Uuid pri_srvc = Uuid::From16Bit(UUID_SERVCLASS_LE_HID);
+ BTA_GATTC_ServiceSearchRequest(p_cb->conn_id, pri_srvc);
+ return;
}
- /* in parallel */
- /* start primary service discovery for HID service */
- Uuid pri_srvc = Uuid::From16Bit(UUID_SERVCLASS_LE_HID);
- BTA_GATTC_ServiceSearchRequest(p_cb->conn_id, pri_srvc);
- return;
+ log::debug("Waiting for DIS result before starting HoGP service discovery");
}
/*******************************************************************************
@@ -1860,17 +1847,13 @@ static void read_report_cb(tCONN_ID conn_id, tGATT_STATUS status, uint16_t handl
log::warn("Unexpected Read response, w4_evt={}", bta_hh_event_text(p_dev_cb->w4_evt));
return;
}
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- p_dev_cb->w4_evt = BTA_HH_EMPTY_EVT;
- }
+ p_dev_cb->w4_evt = BTA_HH_EMPTY_EVT;
uint8_t hid_handle = p_dev_cb->hid_handle;
const gatt::Characteristic* p_char = BTA_GATTC_GetCharacteristic(conn_id, handle);
if (p_char == nullptr) {
log::error("Unknown handle");
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- send_read_report_reply(hid_handle, BTA_HH_ERR, nullptr);
- }
+ send_read_report_reply(hid_handle, BTA_HH_ERR, nullptr);
return;
}
@@ -1884,16 +1867,10 @@ static void read_report_cb(tCONN_ID conn_id, tGATT_STATUS status, uint16_t handl
break;
default:
log::error("Unexpected Read UUID: {}", p_char->uuid.ToString());
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- send_read_report_reply(hid_handle, BTA_HH_ERR, nullptr);
- }
+ send_read_report_reply(hid_handle, BTA_HH_ERR, nullptr);
return;
}
- if (!com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- p_dev_cb->w4_evt = BTA_HH_EMPTY_EVT;
- }
-
if (status != GATT_SUCCESS) {
send_read_report_reply(hid_handle, BTA_HH_ERR, nullptr);
return;
@@ -1937,9 +1914,7 @@ static void bta_hh_le_get_rpt(tBTA_HH_DEV_CB* p_cb, tBTA_HH_RPT_TYPE r_type, uin
if (p_rpt == nullptr) {
log::error("no matching report");
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- send_read_report_reply(p_cb->hid_handle, BTA_HH_ERR, nullptr);
- }
+ send_read_report_reply(p_cb->hid_handle, BTA_HH_ERR, nullptr);
return;
}
@@ -1982,17 +1957,13 @@ static void write_report_cb(tCONN_ID conn_id, tGATT_STATUS status, uint16_t hand
}
log::verbose("w4_evt:{}", bta_hh_event_text(p_dev_cb->w4_evt));
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- p_dev_cb->w4_evt = BTA_HH_EMPTY_EVT;
- }
+ p_dev_cb->w4_evt = BTA_HH_EMPTY_EVT;
uint8_t hid_handle = p_dev_cb->hid_handle;
const gatt::Characteristic* p_char = BTA_GATTC_GetCharacteristic(conn_id, handle);
if (p_char == nullptr) {
log::error("Unknown characteristic handle: {}", handle);
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- send_write_report_reply(hid_handle, BTA_HH_ERR, cb_evt);
- }
+ send_write_report_reply(hid_handle, BTA_HH_ERR, cb_evt);
return;
}
@@ -2000,17 +1971,10 @@ static void write_report_cb(tCONN_ID conn_id, tGATT_STATUS status, uint16_t hand
if (uuid16 != GATT_UUID_HID_REPORT && uuid16 != GATT_UUID_HID_BT_KB_INPUT &&
uuid16 != GATT_UUID_HID_BT_MOUSE_INPUT && uuid16 != GATT_UUID_HID_BT_KB_OUTPUT) {
log::error("Unexpected characteristic UUID: {}", p_char->uuid.ToString());
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- send_write_report_reply(hid_handle, BTA_HH_ERR, cb_evt);
- }
+ send_write_report_reply(hid_handle, BTA_HH_ERR, cb_evt);
return;
}
- /* Set Report finished */
- if (!com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- p_dev_cb->w4_evt = BTA_HH_EMPTY_EVT;
- }
-
if (status == GATT_SUCCESS) {
send_write_report_reply(hid_handle, BTA_HH_OK, cb_evt);
} else {
@@ -2033,9 +1997,7 @@ static void bta_hh_le_write_rpt(tBTA_HH_DEV_CB* p_cb, tBTA_HH_RPT_TYPE r_type, B
if (p_buf == NULL || p_buf->len == 0) {
log::error("Illegal data");
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- send_write_report_reply(p_cb->hid_handle, BTA_HH_ERR, w4_evt);
- }
+ send_write_report_reply(p_cb->hid_handle, BTA_HH_ERR, w4_evt);
return;
}
@@ -2047,9 +2009,7 @@ static void bta_hh_le_write_rpt(tBTA_HH_DEV_CB* p_cb, tBTA_HH_RPT_TYPE r_type, B
p_rpt = bta_hh_le_find_rpt_by_idtype(p_cb->hid_srvc.report, p_cb->mode, r_type, rpt_id);
if (p_rpt == NULL) {
log::error("no matching report");
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- send_write_report_reply(p_cb->hid_handle, BTA_HH_ERR, w4_evt);
- }
+ send_write_report_reply(p_cb->hid_handle, BTA_HH_ERR, w4_evt);
osi_free(p_buf);
return;
}
diff --git a/system/btif/src/btif_hh.cc b/system/btif/src/btif_hh.cc
index 36ad3d148e..28ed77113d 100644
--- a/system/btif/src/btif_hh.cc
+++ b/system/btif/src/btif_hh.cc
@@ -749,9 +749,7 @@ static void hh_get_rpt_handler(tBTA_HH_HSDATA& hs_data) {
HAL_CBACK(bt_hh_callbacks, handshake_cb, (RawAddress*)&(p_dev->link_spec.addrt.bda),
p_dev->link_spec.addrt.type, p_dev->link_spec.transport,
(bthh_status_t)hs_data.status);
- if (com::android::bluetooth::flags::forward_get_set_report_failure_to_uhid()) {
- bta_hh_co_get_rpt_rsp(p_dev->dev_handle, (tBTA_HH_STATUS)hs_data.status, NULL, 0);
- }
+ bta_hh_co_get_rpt_rsp(p_dev->dev_handle, (tBTA_HH_STATUS)hs_data.status, NULL, 0);
}
}