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

Commit 4c16fc6d authored by Archie Pusaka's avatar Archie Pusaka Committed by Archie Pusaka
Browse files

hh: Don't send SET IDLE

SET IDLE command is deprecated in HID spec v1.1.1 (adopted in 2015).
Furthermore, this might race with the reply of GET REPORT or other
commands from UHID.

Therefore, let's not send this command.

Bug: 307923455
Bug: 369310847
Test: m -j
Test: Pair with a Keychron KB and plug in a security key.
      Verify the security key is usable.
Flag: com.android.bluetooth.flags.dont_send_hid_set_idle
Change-Id: I984a67a4203edb4564b48da3c74343bc86e65ebc
parent 57b26681
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -637,11 +637,15 @@ static void hh_open_handler(tBTA_HH_CONN& conn) {
    p_dev->dev_status = BTHH_CONN_STATE_CONNECTED;
  }
  hh_connect_complete(conn, BTHH_CONN_STATE_CONNECTED);

  if (!com::android::bluetooth::flags::dont_send_hid_set_idle()) {
    // Send set_idle if the peer_device is a keyboard
    // TODO (b/307923455): clean this, set idle is deprecated in HID spec v1.1.1
    if (check_cod_hid_major(conn.link_spec.addrt.bda, COD_HID_KEYBOARD) ||
        check_cod_hid_major(conn.link_spec.addrt.bda, COD_HID_COMBO)) {
      BTA_HhSetIdle(conn.handle, 0);
    }
  }
  BTA_HhGetDscpInfo(conn.handle);
}