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

Commit 3698446c authored by Michael Sun's avatar Michael Sun Committed by Automerger Merge Worker
Browse files

Merge "Revert "interop: allow hid host to connect to not-first HOG service""...

Merge "Revert "interop: allow hid host to connect to not-first HOG service"" into main am: 4d65ae84

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3004552



Change-Id: I1c643b07a5620cf20f2090031ad4db657136cd12
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c499e6df 4d65ae84
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -66,8 +66,6 @@ constexpr bool kBTA_HH_LE_RECONN = false;

#define BTA_LE_HID_RTP_UUID_MAX 5

#define HID_PREFERRED_SERVICE_INDEX_3 3

namespace {

constexpr char kBtmLogTag[] = "LE HIDH";
@@ -1514,27 +1512,12 @@ static void bta_hh_le_srvc_search_cmpl(tBTA_GATTC_SEARCH_CMPL* p_data) {
  const gatt::Service* gap_service = nullptr;
  const gatt::Service* scp_service = nullptr;

  int num_hid_service = 0;
  bool have_hid = false;
  for (const gatt::Service& service : *services) {
    if (service.uuid == Uuid::From16Bit(UUID_SERVCLASS_LE_HID) &&
        service.is_primary && !have_hid) {
      have_hid = true;

      // TODO(b/286413526): The current implementation connects to the first HID
      // service, in the case of multiple HID services being present. As a
      // temporary mitigation, connect to the third HID service for some
      // particular devices. The long-term fix should refactor HID stack to
      // connect to multiple HID services simultaneously.
      if (interop_match_vendor_product_ids(
              INTEROP_MULTIPLE_HOGP_SERVICE_CHOOSE_THIRD,
              p_dev_cb->dscp_info.vendor_id, p_dev_cb->dscp_info.product_id)) {
        if (num_hid_service != HID_PREFERRED_SERVICE_INDEX_3) {
          num_hid_service++;
          continue;
        }
      }

      /* found HID primamry service */
      p_dev_cb->hid_srvc.state = BTA_HH_SERVICE_DISCOVERED;
      p_dev_cb->hid_srvc.srvc_inst_id = service.handle;
+0 −6
Original line number Diff line number Diff line
@@ -857,9 +857,3 @@ fc:3f:a6 = Address_Based
[INTEROP_SUSPEND_ATT_TRAFFIC_DURING_PAIRING]
ORN = Name_Based
EPG = Name_Based

# Some HID devices have more than one HID services, this rule ask the stack to connect to the
# specify one.
# 0X046D-0XBB01 - Logitech CASA Pop-Up Touch
[INTEROP_MULTIPLE_HOGP_SERVICE_CHOOSE_THIRD]
0X046D-0XBB01 = Vndr_Prdt_Based
+0 −3
Original line number Diff line number Diff line
@@ -347,9 +347,6 @@ typedef enum {
  // collision.
  INTEROP_DELAY_AUTH,

  // Some LE HID devices contain more than one HOGP service.
  INTEROP_MULTIPLE_HOGP_SERVICE_CHOOSE_THIRD,

  END_OF_INTEROP_LIST
} interop_feature_t;

+0 −1
Original line number Diff line number Diff line
@@ -395,7 +395,6 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
    CASE_RETURN_STR(INTEROP_SUSPEND_ATT_TRAFFIC_DURING_PAIRING);
    CASE_RETURN_STR(INTEROP_INSERT_CALL_WHEN_SCO_START);
    CASE_RETURN_STR(INTEROP_DELAY_AUTH);
    CASE_RETURN_STR(INTEROP_MULTIPLE_HOGP_SERVICE_CHOOSE_THIRD);
  }
  return UNKNOWN_INTEROP_FEATURE;
}