From 05824734ace954da0d2fabcd9862fd9f88813f29 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Thu, 16 Jun 2016 14:00:09 -0700 Subject: [PATCH] adb: make adb root not wait-for-device. `adb root` would hang for devices connected over TCP/IP, because they never come back. Unfortunately, there doesn't seem to be an easy way to find out what we're talking to, so replace it with a long sleep for now. Bug: http://b/27836058 Change-Id: Icd6e6bf817ca9e2124c2961665c37b2f31f7ef29 --- adb/commandline.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/adb/commandline.cpp b/adb/commandline.cpp index b815fef50..e651a3744 100644 --- a/adb/commandline.cpp +++ b/adb/commandline.cpp @@ -1093,12 +1093,10 @@ static bool adb_root(const char* command) { return true; } - // Give adbd 500ms to kill itself, then wait-for-device for it to come back up. - adb_sleep_ms(500); - TransportType type; - const char* serial; - adb_get_transport(&type, &serial); - return wait_for_device("wait-for-any", type, serial); + // Give adbd some time to kill itself and come back up. + // We can't use wait-for-device because devices (e.g. adb over network) might not come back. + adb_sleep_ms(3000); + return true; } // Connects to the device "shell" service with |command| and prints the