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

Commit 50d3de63 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

HidHost: Enforce connection policy on incoming connection

HidHostService tracks state change from DISCONNECTED to CONNECTED to
enforce the connection policy on incoming connections.
aosp/2215365 introduced the intermediate CONNECTING state before the
CONNECTED state when connection is initiated by the remote device. This
prevented the connection policy logic to trigger in HidHostService.

Test: mmm packages/modules/Bluetooth
Test: Manual | Pair and connect a HID device, disable input, enable the
flag, restart BT, initiate connection from the HID device
Bug: 330865052
Bug: 320762367

Change-Id: I6b28ac91c5c6eeb26932c2abf7ff54773c787fdd
parent ebca85b5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -437,7 +437,11 @@ static void hh_open_handler(tBTA_HH_CONN& conn) {
      return;
    }
  }

  if (!IS_FLAG_ENABLED(allow_switching_hid_and_hogp)) {
    BTHH_STATE_UPDATE(conn.link_spec, BTHH_CONN_STATE_CONNECTING);
  }

  btif_hh_cb.pending_link_spec = {};

  if (conn.status != BTA_HH_OK) {