summaryrefslogtreecommitdiffstats
path: root/btif/src/btif_hh.c
diff options
context:
space:
mode:
authorHemant Gupta <hemantg@codeaurora.org>2014-08-04 18:07:41 +0530
committerAndre Eisenbach <eisenbach@google.com>2015-06-23 12:53:01 -0700
commit0bcf0c6e6b5b09b9bc7f856f739e57321120f67b (patch)
tree6f770a3b704e366a20e5b2fad9ca8c41ccaed418 /btif/src/btif_hh.c
parenteeb249bd2844a14a5b6914f99bad99a38f165caf (diff)
downloadandroid_system_bt-0bcf0c6e6b5b09b9bc7f856f739e57321120f67b.tar.gz
android_system_bt-0bcf0c6e6b5b09b9bc7f856f739e57321120f67b.tar.bz2
android_system_bt-0bcf0c6e6b5b09b9bc7f856f739e57321120f67b.zip
HID: Allow reconnection from Host on paired HID Devices.
Host can send connection request when paired HID device is in disconnected state. We are not checking the NORMALLY_CONNECTABLE flags from sdp record, and by default sending this request from host, for subsequent user initiated connection to paired remote HID Devices. If the remote HID is in page scan mode, it will get connected and if not, connection will fail after retrying until HID_HOST_MAX_CONN_RETRY times. Without this patch, if remote hid device sdp record shows that device's NORMALLY_CONNECTABLE flag is false, host will not be able to create outgoing connection to remote device even if the device is in pairing mode until device is unpaired giving bad user experience. Bug: 22028876 Change-Id: I2b3c5c25dc7b08ab6ed0c3667897e5ea0f05f914
Diffstat (limited to 'btif/src/btif_hh.c')
-rw-r--r--btif/src/btif_hh.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/btif/src/btif_hh.c b/btif/src/btif_hh.c
index ee5d9e3ad..3b9220aef 100644
--- a/btif/src/btif_hh.c
+++ b/btif/src/btif_hh.c
@@ -652,22 +652,12 @@ bt_status_t btif_hh_connect(bt_bdaddr_t *bd_addr)
}
}
- if (added_dev == NULL ||
- (added_dev->attr_mask & HID_NORMALLY_CONNECTABLE) != 0 ||
- (added_dev->attr_mask & HID_RECONN_INIT) == 0)
- {
- tBTA_SEC sec_mask = BTUI_HH_SECURITY;
- btif_hh_cb.status = BTIF_HH_DEV_CONNECTING;
- BD_ADDR *bda = (BD_ADDR*)bd_addr;
- BTA_HhOpen(*bda, BTA_HH_PROTO_RPT_MODE, sec_mask);
- }
- else
- {
- // This device shall be connected from the host side.
- BTIF_TRACE_ERROR("%s: Error, device %s can only be reconnected from device side",
- __FUNCTION__, bda_str);
- return BT_STATUS_FAIL;
- }
+ /* 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 not in
+ pagescan mode, we will do 2 retries to connect before giving up */
+ tBTA_SEC sec_mask = BTUI_HH_SECURITY;
+ btif_hh_cb.status = BTIF_HH_DEV_CONNECTING;
+ BTA_HhOpen(*bda, BTA_HH_PROTO_RPT_MODE, sec_mask);
HAL_CBACK(bt_hh_callbacks, connection_state_cb, bd_addr, BTHH_CONN_STATE_CONNECTING);
return BT_STATUS_SUCCESS;