adb: clean up transport disconnect operations.
Move operations from global functions into member functions.
Add unit test.
Change-Id: Id4543d8e78541eb08c8e629f180c605c699737ec
diff --git a/adb.cpp b/adb.cpp
index 49cf123..fa935f6 100644
--- a/adb.cpp
+++ b/adb.cpp
@@ -244,11 +244,11 @@
//Close the associated usb
t->online = 0;
- // This is necessary to avoid a race condition that occured when a transport closes
+ // This is necessary to avoid a race condition that occurred when a transport closes
// while a client socket is still active.
close_all_sockets(t);
- run_transport_disconnects(t);
+ t->RunDisconnects();
}
#if DEBUG_PACKETS