adb: remove SendConnectOnHost.
This logic appears to be racy, and it shouldn't actually be needed, if
our devices follow the USB spec. Use libusb_set_interface_alt_setting
on device initialization as well, to add one more thing that should
reset the data toggles.
Bug: http://b/32952319
Test: python test_device.py
Change-Id: I392198af3d72c524b893e5056afa2b4617cea49c
diff --git a/adb/adb.cpp b/adb/adb.cpp
index 8c24bbb..6b30be8 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -257,19 +257,6 @@
send_packet(cp, t);
}
-#if ADB_HOST
-
-void SendConnectOnHost(atransport* t) {
- // Send an empty message before A_CNXN message. This is because the data toggle of the ep_out on
- // host and ep_in on device may not be the same.
- apacket* p = get_apacket();
- CHECK(p);
- send_packet(p, t);
- send_connect(t);
-}
-
-#endif
-
// qual_overwrite is used to overwrite a qualifier string. dst is a
// pointer to a char pointer. It is assumed that if *dst is non-NULL, it
// was malloc'ed and needs to freed. *dst will be set to a dup of src.
@@ -370,7 +357,7 @@
if (p->msg.arg0){
send_packet(p, t);
#if ADB_HOST
- SendConnectOnHost(t);
+ send_connect(t);
#endif
} else {
t->SetConnectionState(kCsOffline);