Merge "WA: Fix adb wait-for-device command"

This commit is contained in:
Josh Gao 2016-01-07 01:19:19 +00:00 committed by Gerrit Code Review
commit bf867cac7e

View file

@ -368,8 +368,9 @@ static void wait_for_state(int fd, void* data) {
while (true) {
bool is_ambiguous = false;
std::string error = "unknown error";
atransport* t = acquire_one_transport(sinfo->transport_type, sinfo->serial.c_str(),
&is_ambiguous, &error);
const char* serial = sinfo->serial.length() ? sinfo->serial.c_str() : NULL;
atransport* t = acquire_one_transport(sinfo->transport_type, serial, &is_ambiguous, &error);
if (t != nullptr && t->connection_state == sinfo->state) {
SendOkay(fd);
break;