Be tolerant of devices that don't report serials.
The USB spec explicitly says this is optional, so we shouldn't be
relying on it.
Bug: http://b/20883914
Change-Id: Icf38405b00275199bcf51a70c47d428ae7264f2b
diff --git a/adb/transport.cpp b/adb/transport.cpp
index 5c50c0a..2cd6ac2 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -855,7 +855,8 @@
#if ADB_HOST
-static void append_transport_info(std::string* result, const char* key, const char* value, bool sanitize) {
+static void append_transport_info(std::string* result, const char* key,
+ const char* value, bool sanitize) {
if (value == nullptr || *value == '\0') {
return;
}
@@ -871,7 +872,7 @@
static void append_transport(atransport* t, std::string* result, bool long_listing) {
const char* serial = t->serial;
if (!serial || !serial[0]) {
- serial = "????????????";
+ serial = "(no serial number)";
}
if (!long_listing) {