Date: Mon, 3 Jun 2019 13:53:11 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r503390 - head/devel/android-tools-adb/files Message-ID: <201906031353.x53DrBUY023933@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Mon Jun 3 13:53:10 2019 New Revision: 503390 URL: https://svnweb.freebsd.org/changeset/ports/503390 Log: devel/android-tools-adb: switch to LIBUSB_CAP_HAS_HOTPLUG whitelist $ adb connect 1.2.3.4 * daemon not running; starting now at tcp:5037 ADB server didn't ACK Full server startup log: /tmp/adb.1000.log Server had pid: 1193 --- adb starting (pid 1193) --- adb I 12-31 10:41:58 1193 1 main.cpp:56] Android Debug Bridge version 1.0.40 adb I 12-31 10:41:58 1193 1 main.cpp:56] Version 28.0.0-0 adb I 12-31 10:41:58 1193 1 main.cpp:56] Installed as /usr/pkg/bin/adb adb I 12-31 10:41:58 1193 1 main.cpp:56] adb F 12-31 10:41:58 1193 1 usb_libusb.cpp:517] failed to register libusb hotplug callback * failed to start daemon error: cannot connect to daemon Modified: head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp (contents, props changed) Modified: head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp ============================================================================== --- head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp Mon Jun 3 13:46:44 2019 (r503389) +++ head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp Mon Jun 3 13:53:10 2019 (r503390) @@ -9,11 +9,13 @@ #include <android-base/file.h> #include <android-base/logging.h> -@@ -39,6 +39,7 @@ +@@ -39,6 +39,9 @@ #include "adb.h" #include "adb_utils.h" ++#if !defined(__linux__) && !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__HAIKU__) +#include "sysdeps/chrono.h" ++#endif #include "transport.h" #include "usb.h" @@ -33,7 +35,7 @@ static auto& usb_handles = *new std::unordered_map<std::string, std::unique_ptr<usb_handle>>(); static auto& usb_handles_mutex = *new std::mutex(); -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) static libusb_hotplug_callback_handle hotplug_handle; +#else +static std::thread* device_poll_thread = nullptr; @@ -48,7 +50,7 @@ LOG(INFO) << "registered new usb device '" << device_serial << "'"; } -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) static std::atomic<int> connecting_devices(0); static void device_connected(libusb_device* device) { @@ -88,7 +90,7 @@ LOG(FATAL) << "failed to initialize libusb: " << libusb_error_name(rc); } -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) // Register the hotplug callback. rc = libusb_hotplug_register_callback( nullptr, static_cast<libusb_hotplug_event>(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | @@ -105,14 +107,14 @@ } }).detach(); + -+#if !defined(LIBUSB_API_VERSION) || LIBUSB_API_VERSION < 0x01000102 ++#if !defined(__linux__) && !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__HAIKU__) + std::unique_lock<std::mutex> lock(device_poll_mutex); + device_poll_thread = new std::thread(poll_for_devices); +#endif } void usb_cleanup() { -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) libusb_hotplug_deregister_callback(nullptr, hotplug_handle); +#else + {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906031353.x53DrBUY023933>