diff options
-rw-r--r-- | flags/hid.aconfig | 10 | ||||
-rw-r--r-- | system/bta/hh/bta_hh_le.cc | 45 | ||||
-rw-r--r-- | system/btif/src/btif_hh.cc | 4 |
3 files changed, 10 insertions, 49 deletions
diff --git a/flags/hid.aconfig b/flags/hid.aconfig index ea0dc0304a..e7f8ef50cb 100644 --- a/flags/hid.aconfig +++ b/flags/hid.aconfig @@ -30,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 327059f379..9cbd8569ab 100644 --- a/system/bta/hh/bta_hh_le.cc +++ b/system/bta/hh/bta_hh_le.cc @@ -1847,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; } @@ -1871,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; @@ -1924,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; } @@ -1969,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; } @@ -1987,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 { @@ -2020,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; } @@ -2034,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 7288abe98c..d11a23f689 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); } } |