adb: add `adb reconnect offline` to reconnect offline devices.
Add a command to reconnect offline/unauthorized devices, mainly for use
with the inotify-monitoring of vendor key directories added by 22cb70bd.
Bug: http://b/29273531
Test: manually tested with a sailfish + copying vendor keys
Change-Id: If34cccee4ae553ada65d128b57d03cba8c0d7c46
diff --git a/sockets.cpp b/sockets.cpp
index 3a57174..c05903f 100644
--- a/sockets.cpp
+++ b/sockets.cpp
@@ -791,11 +791,14 @@
}
#endif
- if (!(s->transport) || (s->transport->connection_state == kCsOffline)) {
+ if (!s->transport) {
+ SendFail(s->peer->fd, "device offline (no transport)");
+ goto fail;
+ } else if (s->transport->connection_state == kCsOffline) {
/* if there's no remote we fail the connection
** right here and terminate it
*/
- SendFail(s->peer->fd, "device offline (x)");
+ SendFail(s->peer->fd, "device offline (transport offline)");
goto fail;
}