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

Commit d5f1667e authored by Michael Sun's avatar Michael Sun
Browse files

interop: force a MTU exchange for certain keyboards

Some HOGP keyboards expect a MTU exchange flow as part of the initialization to function properly. Trigger a MTU exchange for a device in the interop list.

Bug: 332761737
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: Manual test on Brya, Brydge keyboard working
Flag: EXEMPT, interop change and apply only to one and currently non-functioning device
Change-Id: I2efb78cae6072fb8fdd74a87628fb71804869164
parent 6ddf7c24
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -619,6 +619,13 @@ static void bta_hh_le_open_cmpl(tBTA_HH_DEV_CB* p_cb) {
    bta_hh_le_register_input_notif(p_cb, p_cb->mode, true);
    bta_hh_sm_execute(p_cb, BTA_HH_OPEN_CMPL_EVT, NULL);

    // Some HOGP devices requires MTU exchange be part of the initial setup to function. The size of
    // the requested MTU does not matter as long as the procedure is triggered.
    if (interop_match_vendor_product_ids(INTEROP_HOGP_FORCE_MTU_EXCHANGE, p_cb->dscp_info.vendor_id,
                                         p_cb->dscp_info.product_id)) {
      BTA_GATTC_ConfigureMTU(p_cb->conn_id, GATT_MAX_MTU_SIZE);
    }

    if (!com::android::bluetooth::flags::prevent_hogp_reconnect_when_connected()) {
      if (kBTA_HH_LE_RECONN && p_cb->status == BTA_HH_OK) {
        bta_hh_le_add_dev_bg_conn(p_cb);
+4 −0
Original line number Diff line number Diff line
@@ -872,3 +872,7 @@ BSK10 = Name_Based
# bytes).
[INTEROP_HOGP_LONG_REPORT]
0x03f6-0xa001 = Vndr_Prdt_Based

# Some HOGP devices requires MTU exchange be part of the initial setup to function.
[INTEROP_HOGP_FORCE_MTU_EXCHANGE]
0x03f6-0xa001 = Vndr_Prdt_Based
+3 −0
Original line number Diff line number Diff line
@@ -360,6 +360,9 @@ typedef enum {
  // bytes).
  INTEROP_HOGP_LONG_REPORT,

  // Some HOGP devices requires MTU exchange be part of the initial setup to function.
  INTEROP_HOGP_FORCE_MTU_EXCHANGE,

  END_OF_INTEROP_LIST
} interop_feature_t;

+1 −0
Original line number Diff line number Diff line
@@ -394,6 +394,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
    CASE_RETURN_STR(INTEROP_A2DP_SKIP_SDP_DURING_RECONNECTION);
    CASE_RETURN_STR(INTEROP_HID_PREF_CONN_ZERO_LATENCY);
    CASE_RETURN_STR(INTEROP_HOGP_LONG_REPORT);
    CASE_RETURN_STR(INTEROP_HOGP_FORCE_MTU_EXCHANGE);
  }
  return UNKNOWN_INTEROP_FEATURE;
}