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

Commit c4a1fad1 authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

hidhost: Don't attempt to reconnect hidhost

The upper layer may call bthh_interface_t->connect when HidHost is
already connected for that remote device. In that case, we should not
attempt to connect again to prevent btif_hh_cb.status from being stuck
at CONNECTING, which will cause subsequent HidHost connects to always
fail.

Bug: 216352373
Tag: #floss
Test: Chrome OS bluetooth_AdapterMDHealth.md_two_connections_test.floss

Change-Id: Ie822fc44d70194cd91557794e0c65dc679b871c9
parent a1eb90e9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -586,6 +586,12 @@ bt_status_t btif_hh_connect(const RawAddress* bd_addr) {
    }
  }

  if (dev && dev->dev_status == BTHH_CONN_STATE_CONNECTED) {
    LOG_DEBUG("HidHost profile already connected for %s",
              PRIVATE_ADDRESS((*bd_addr)));
    return BT_STATUS_SUCCESS;
  }

  /* Not checking the NORMALLY_Connectible flags from sdp record, and anyways
   sending this
   request from host, for subsequent user initiated connection. If the remote is