From 99c053d4e0fdc67cfd057ac1413eb92843cef3e8 Mon Sep 17 00:00:00 2001 From: Himanshu Rawat Date: Tue, 18 Mar 2025 13:28:23 -0700 Subject: Add flag simpler_hid_connection_policy Test: mmm packages/modules/Bluetooth Flag: com.android.bluetooth.flags.simpler_hid_connection_policy Bug: 404590499 Bug: 315241296 Change-Id: I2464c31e743e559da0cd8cece1c62502cba73ee6 --- flags/hid.aconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flags/hid.aconfig b/flags/hid.aconfig index ee5728c94f..829352e859 100644 --- a/flags/hid.aconfig +++ b/flags/hid.aconfig @@ -128,3 +128,13 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "simpler_hid_connection_policy" + namespace: "bluetooth" + description: "Simplify native HID host connection policy enforcement" + bug: "404590499" + metadata { + purpose: PURPOSE_BUGFIX + } +} -- cgit v1.2.3-59-g8ed1b From 0b94e40b00450ba8105c196180ebd993016acc5e Mon Sep 17 00:00:00 2001 From: Himanshu Rawat Date: Tue, 18 Mar 2025 19:16:12 -0700 Subject: Add flag unrelated_device_smp_cancellation Test: mmm packages/modules/Bluetooth Flag: com.android.bluetooth.flags.unrelated_device_smp_cancellation Bug: 404658828 Bug: 315241296 Change-Id: I3659ccf93649ac94cf83cc90330dd1a372c65676 --- flags/pairing.aconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flags/pairing.aconfig b/flags/pairing.aconfig index f30410db17..faae7d2618 100644 --- a/flags/pairing.aconfig +++ b/flags/pairing.aconfig @@ -270,3 +270,13 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "unrelated_device_smp_cancellation" + namespace: "bluetooth" + description: "Don't cancel SMP pairing if encryption fails for unrelated device" + bug: "404658828" + metadata { + purpose: PURPOSE_BUGFIX + } +} -- cgit v1.2.3-59-g8ed1b From 843113734c8b08d57f2354b88667a17e6639642e Mon Sep 17 00:00:00 2001 From: Henri Chataing Date: Mon, 10 Mar 2025 17:30:48 -0700 Subject: Add avdtp_prevent_double_suspend Bug: 402241316 Bug: 315241296 Test: m com.android.bt Flag: com.android.bluetooth.flags.avdtp_prevent_double_suspend Change-Id: Icd5099cea230b4630613af923e43f393904435e7 --- flags/a2dp.aconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flags/a2dp.aconfig b/flags/a2dp.aconfig index ccf46f8bed..b7110062ea 100644 --- a/flags/a2dp.aconfig +++ b/flags/a2dp.aconfig @@ -145,3 +145,13 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "avdtp_prevent_double_suspend" + namespace: "bluetooth" + description: "Add state to prevent sending multiple AVDTP Suspend command in a row" + bug: "402241316" + metadata { + purpose: PURPOSE_BUGFIX + } +} -- cgit v1.2.3-59-g8ed1b From 3021ec9009e2bf2c1ee5aef3391056c333596e10 Mon Sep 17 00:00:00 2001 From: Archie Pusaka Date: Mon, 17 Mar 2025 04:32:39 +0000 Subject: Remove serialize_hogp_and_dis flag Also remove the TODO to implement multiservice HoGP since there are more interop cases which requires us to distinguish the peripherals before discovering HoGP services, e.g. INTEROP_HOGP_LONG_REPORT. Bug: 367910199 Test: m -j Flag: EXEMPT, flag removal Change-Id: Id0fd9d5a328b1e97a6733308cfdf5fe50c0db6ff --- flags/hid.aconfig | 10 ---------- system/bta/hh/bta_hh_le.cc | 27 +++++++-------------------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/flags/hid.aconfig b/flags/hid.aconfig index d40e55821f..ea0dc0304a 100644 --- a/flags/hid.aconfig +++ b/flags/hid.aconfig @@ -19,16 +19,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" diff --git a/system/bta/hh/bta_hh_le.cc b/system/bta/hh/bta_hh_le.cc index 6dc6365562..327059f379 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"); } /******************************************************************************* -- cgit v1.2.3-59-g8ed1b From aa4928932a228a95605dab92b5a23dcbcf7d46c4 Mon Sep 17 00:00:00 2001 From: Archie Pusaka Date: Mon, 17 Mar 2025 04:48:58 +0000 Subject: Remove forward_get_set_report_failure_to_uhid flag Bug: 369748430 Test: m -j Flag: EXEMPT, flag removal Change-Id: I4260c63046152360b5815ddfea82971b67387753 --- flags/hid.aconfig | 10 ---------- system/bta/hh/bta_hh_le.cc | 45 +++++++++------------------------------------ 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 @@ -29,16 +29,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" 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); } } -- cgit v1.2.3-59-g8ed1b From 14f78fd7813bec5eb429ed579c5a2e9c95d9aa78 Mon Sep 17 00:00:00 2001 From: Ömer Faruk Yılmaz Date: Wed, 19 Mar 2025 02:00:39 -0700 Subject: Temporarily @Ignore scanForUuid_remoteFound until investigation Bug: 404159990 Test: m com.android.bt Flag: EXEMPT test only Change-Id: I16bcee711334a9142b26df3870757fe4cd7567cf --- framework/tests/bumble/src/android/bluetooth/DckScanTest.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/tests/bumble/src/android/bluetooth/DckScanTest.kt b/framework/tests/bumble/src/android/bluetooth/DckScanTest.kt index 8660a4076b..845862b71a 100644 --- a/framework/tests/bumble/src/android/bluetooth/DckScanTest.kt +++ b/framework/tests/bumble/src/android/bluetooth/DckScanTest.kt @@ -32,6 +32,7 @@ import kotlinx.coroutines.flow.first import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withTimeout import org.junit.Assume.assumeTrue +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -99,6 +100,7 @@ class DckScanTest( } @Test + @Ignore("b/404159990") fun scanForUuid_remoteFound() { // Assume isRemoteAdvertisingWithUuid is true to skip tests in which // device is not advertising with UUID -- cgit v1.2.3-59-g8ed1b