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
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index 26f52f7..e6575b0 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -248,10 +248,9 @@
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;
}