Loading adb/adb.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1129,6 +1129,18 @@ int handle_host_request(const char* service, TransportType type, return 0; } #if ADB_HOST if (!strcmp(service, "host-features")) { FeatureSet features = supported_features(); // Abuse features to report libusb status. if (should_use_libusb()) { features.insert(kFeatureLibusb); } SendOkay(reply_fd, FeatureSetToString(features)); return 0; } #endif // remove TCP transport if (!strncmp(service, "disconnect:", 11)) { const std::string address(service + 11); Loading adb/adb.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ constexpr size_t LINUX_MAX_SOCKET_SIZE = 4194304; std::string adb_version(); // Increment this when we want to force users to start a new adb server. #define ADB_SERVER_VERSION 38 #define ADB_SERVER_VERSION 39 class atransport; Loading adb/client/usb_dispatch.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -17,11 +17,6 @@ #include <android-base/logging.h> #include "usb.h" static bool should_use_libusb() { static bool enable = getenv("ADB_LIBUSB") && strcmp(getenv("ADB_LIBUSB"), "1") == 0; return enable; } void usb_init() { if (should_use_libusb()) { LOG(DEBUG) << "using libusb backend"; Loading adb/commandline.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -1929,8 +1929,7 @@ int adb_commandline(int argc, const char** argv) { else if (!strcmp(argv[0], "--version") || !strcmp(argv[0], "version")) { fprintf(stdout, "%s", adb_version().c_str()); return 0; } else if (!strcmp(argv[0], "features")) { } else if (!strcmp(argv[0], "features")) { // Only list the features common to both the adb client and the device. FeatureSet features; std::string error; Loading @@ -1945,6 +1944,8 @@ int adb_commandline(int argc, const char** argv) { } } return 0; } else if (!strcmp(argv[0], "host-features")) { return adb_query_command("host:host-features"); } else if (!strcmp(argv[0], "reconnect")) { if (argc == 1) { return adb_query_command("host:reconnect"); Loading adb/transport.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ static std::mutex& transport_lock = *new std::mutex(); const char* const kFeatureShell2 = "shell_v2"; const char* const kFeatureCmd = "cmd"; const char* const kFeatureStat2 = "stat_v2"; const char* const kFeatureLibusb = "libusb"; static std::string dump_packet(const char* name, const char* func, apacket* p) { unsigned command = p->msg.command; Loading Loading
adb/adb.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1129,6 +1129,18 @@ int handle_host_request(const char* service, TransportType type, return 0; } #if ADB_HOST if (!strcmp(service, "host-features")) { FeatureSet features = supported_features(); // Abuse features to report libusb status. if (should_use_libusb()) { features.insert(kFeatureLibusb); } SendOkay(reply_fd, FeatureSetToString(features)); return 0; } #endif // remove TCP transport if (!strncmp(service, "disconnect:", 11)) { const std::string address(service + 11); Loading
adb/adb.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ constexpr size_t LINUX_MAX_SOCKET_SIZE = 4194304; std::string adb_version(); // Increment this when we want to force users to start a new adb server. #define ADB_SERVER_VERSION 38 #define ADB_SERVER_VERSION 39 class atransport; Loading
adb/client/usb_dispatch.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -17,11 +17,6 @@ #include <android-base/logging.h> #include "usb.h" static bool should_use_libusb() { static bool enable = getenv("ADB_LIBUSB") && strcmp(getenv("ADB_LIBUSB"), "1") == 0; return enable; } void usb_init() { if (should_use_libusb()) { LOG(DEBUG) << "using libusb backend"; Loading
adb/commandline.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -1929,8 +1929,7 @@ int adb_commandline(int argc, const char** argv) { else if (!strcmp(argv[0], "--version") || !strcmp(argv[0], "version")) { fprintf(stdout, "%s", adb_version().c_str()); return 0; } else if (!strcmp(argv[0], "features")) { } else if (!strcmp(argv[0], "features")) { // Only list the features common to both the adb client and the device. FeatureSet features; std::string error; Loading @@ -1945,6 +1944,8 @@ int adb_commandline(int argc, const char** argv) { } } return 0; } else if (!strcmp(argv[0], "host-features")) { return adb_query_command("host:host-features"); } else if (!strcmp(argv[0], "reconnect")) { if (argc == 1) { return adb_query_command("host:reconnect"); Loading
adb/transport.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ static std::mutex& transport_lock = *new std::mutex(); const char* const kFeatureShell2 = "shell_v2"; const char* const kFeatureCmd = "cmd"; const char* const kFeatureStat2 = "stat_v2"; const char* const kFeatureLibusb = "libusb"; static std::string dump_packet(const char* name, const char* func, apacket* p) { unsigned command = p->msg.command; Loading