summaryrefslogtreecommitdiffstats
path: root/adb/transport.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-12-14 12:47:44 -0800
committerandroid-build-merger <android-build-merger@google.com>2015-12-14 12:47:44 -0800
commit2e83684537326b027ef042d5712d2b861af8e626 (patch)
tree5abebc576f0a4a245093b7e6c6e44f4e7950fcb3 /adb/transport.cpp
parent27c43dc44e81db6ac1081eb82f2696b8c9dcbda8 (diff)
parent40f80e25d3f399ece26d5f1ac145921ccb7f5f80 (diff)
downloadcore-2e83684537326b027ef042d5712d2b861af8e626.tar.gz
core-2e83684537326b027ef042d5712d2b861af8e626.tar.bz2
core-2e83684537326b027ef042d5712d2b861af8e626.zip
Merge "Share the new adb USB diagnostic code with fastboot." am: efd8c3289e
am: 40f80e25d3 * commit '40f80e25d3f399ece26d5f1ac145921ccb7f5f80': Share the new adb USB diagnostic code with fastboot.
Diffstat (limited to 'adb/transport.cpp')
-rw-r--r--adb/transport.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/adb/transport.cpp b/adb/transport.cpp
index 988007d74..f8c8c615f 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -35,6 +35,7 @@
#include "adb.h"
#include "adb_utils.h"
+#include "diagnose_usb.h"
static void transport_unref(atransport *t);
@@ -674,11 +675,9 @@ atransport* acquire_one_transport(TransportType type, const char* serial,
adb_mutex_lock(&transport_lock);
for (const auto& t : transport_list) {
if (t->connection_state == kCsNoPerm) {
+#if ADB_HOST
*error_out = UsbNoPermissionsLongHelpText();
- // If we couldn't figure out a reasonable help message default to something generic.
- if (error_out->empty()) {
- *error_out = "insufficient permissions for device";
- }
+#endif
continue;
}
@@ -759,10 +758,7 @@ const std::string atransport::connection_state_name() const {
case kCsDevice: return "device";
case kCsHost: return "host";
case kCsRecovery: return "recovery";
- case kCsNoPerm: {
- std::string message = UsbNoPermissionsShortHelpText();
- return message.empty() ? "no permissions" : message;
- }
+ case kCsNoPerm: return UsbNoPermissionsShortHelpText();
case kCsSideload: return "sideload";
case kCsUnauthorized: return "unauthorized";
default: return "unknown";