summaryrefslogtreecommitdiffstats
path: root/adb/transport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'adb/transport.cpp')
-rw-r--r--adb/transport.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/adb/transport.cpp b/adb/transport.cpp
index 2cd6ac2..5ae49d3 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -821,8 +821,10 @@ retry:
result = NULL;
}
- /* check for required connection state */
- if (result && state != CS_ANY && result->connection_state != state) {
+ /* check for required connection state */
+ if (result && state != CS_ANY && ((state != CS_ONLINE && result->connection_state != state)
+ || (state == CS_ONLINE && !(result->connection_state == CS_DEVICE
+ || result->connection_state == CS_RECOVERY)))) {
if (error_out) *error_out = "invalid device state";
result = NULL;
}