From fed25ad2562661227343a68085376f1649ecbdd3 Mon Sep 17 00:00:00 2001 From: Zach Johnson Date: Wed, 15 Mar 2017 13:23:54 -0700 Subject: [PATCH] Fix MCT data transport for the BT HAL The vendor open interface command returns the total number of FDs opened. (2 or 4 if the interface is MCT) However, the list of FDs is always 4 in either case. If the open command returns 2, the FDs are shared cmd/event and data in/out. 2 FDs example [41, 41, 42, 42] 4 FDs example [41, 42, 43, 44] If we condition the registration of ACL_IN on the total number of FDs, then 2 FD MCT interfaces will not get data. Fixes: 36067612, 36035039, 36188793 Test: manual, pairing is quick and data does transfer Change-Id: Icc8728239ba81426d5fc0e678c5c5480fd9b5081 --- bluetooth/1.0/default/vendor_interface.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc index 26f52f7205..e6575b06aa 100644 --- a/bluetooth/1.0/default/vendor_interface.cc +++ b/bluetooth/1.0/default/vendor_interface.cc @@ -248,10 +248,9 @@ bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb, new hci::MctProtocol(fd_list, intercept_events, acl_cb); fd_watcher_.WatchFdForNonBlockingReads( fd_list[CH_EVT], [mct_hci](int fd) { mct_hci->OnEventDataReady(fd); }); - if (fd_count >= CH_ACL_IN) - fd_watcher_.WatchFdForNonBlockingReads( - fd_list[CH_ACL_IN], - [mct_hci](int fd) { mct_hci->OnAclDataReady(fd); }); + fd_watcher_.WatchFdForNonBlockingReads( + fd_list[CH_ACL_IN], + [mct_hci](int fd) { mct_hci->OnAclDataReady(fd); }); hci_ = mct_hci; }