Loading adb/adb.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1114,7 +1114,7 @@ HostRequestResult handle_host_request(std::string_view service, TransportType ty return true; } return false; }); }, true); if (!response.empty()) { response.resize(response.size() - 1); } Loading Loading @@ -1229,7 +1229,7 @@ HostRequestResult handle_host_request(std::string_view service, TransportType ty std::string response; atransport* t = acquire_one_transport(type, serial, transport_id, nullptr, &response, true); if (t != nullptr) { kick_transport(t); kick_transport(t, true); response = "reconnecting " + t->serial_name() + " [" + t->connection_state_name() + "]\n"; } Loading adb/client/usb_dispatch.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ int usb_close(usb_handle* h) { : native::usb_close(reinterpret_cast<native::usb_handle*>(h)); } void usb_reset(usb_handle* h) { should_use_libusb() ? libusb::usb_reset(reinterpret_cast<libusb::usb_handle*>(h)) : native::usb_reset(reinterpret_cast<native::usb_handle*>(h)); } void usb_kick(usb_handle* h) { should_use_libusb() ? libusb::usb_kick(reinterpret_cast<libusb::usb_handle*>(h)) : native::usb_kick(reinterpret_cast<native::usb_handle*>(h)); Loading adb/client/usb_libusb.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,11 @@ int usb_close(usb_handle* h) { return 0; } void usb_reset(usb_handle* h) { libusb_reset_device(h->device_handle); usb_kick(h); } void usb_kick(usb_handle* h) { h->Close(); } Loading adb/client/usb_linux.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,11 @@ int usb_read(usb_handle *h, void *_data, int len) return orig_len - len; } void usb_reset(usb_handle* h) { ioctl(h->fd, USBDEVFS_RESET); usb_kick(h); } void usb_kick(usb_handle* h) { std::lock_guard<std::mutex> lock(h->mutex); D("[ kicking %p (fd = %d) ]", h, h->fd); Loading adb/client/usb_osx.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -556,6 +556,13 @@ int usb_close(usb_handle *handle) return 0; } void usb_reset(usb_handle* handle) { if (!handle->dead) { (*handle->interface)->USBDeviceReEnumerate(handle->interface, 0); } usb_kick(handle); } static void usb_kick_locked(usb_handle *handle) { LOG(INFO) << "Kicking handle"; Loading Loading
adb/adb.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1114,7 +1114,7 @@ HostRequestResult handle_host_request(std::string_view service, TransportType ty return true; } return false; }); }, true); if (!response.empty()) { response.resize(response.size() - 1); } Loading Loading @@ -1229,7 +1229,7 @@ HostRequestResult handle_host_request(std::string_view service, TransportType ty std::string response; atransport* t = acquire_one_transport(type, serial, transport_id, nullptr, &response, true); if (t != nullptr) { kick_transport(t); kick_transport(t, true); response = "reconnecting " + t->serial_name() + " [" + t->connection_state_name() + "]\n"; } Loading
adb/client/usb_dispatch.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ int usb_close(usb_handle* h) { : native::usb_close(reinterpret_cast<native::usb_handle*>(h)); } void usb_reset(usb_handle* h) { should_use_libusb() ? libusb::usb_reset(reinterpret_cast<libusb::usb_handle*>(h)) : native::usb_reset(reinterpret_cast<native::usb_handle*>(h)); } void usb_kick(usb_handle* h) { should_use_libusb() ? libusb::usb_kick(reinterpret_cast<libusb::usb_handle*>(h)) : native::usb_kick(reinterpret_cast<native::usb_handle*>(h)); Loading
adb/client/usb_libusb.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,11 @@ int usb_close(usb_handle* h) { return 0; } void usb_reset(usb_handle* h) { libusb_reset_device(h->device_handle); usb_kick(h); } void usb_kick(usb_handle* h) { h->Close(); } Loading
adb/client/usb_linux.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,11 @@ int usb_read(usb_handle *h, void *_data, int len) return orig_len - len; } void usb_reset(usb_handle* h) { ioctl(h->fd, USBDEVFS_RESET); usb_kick(h); } void usb_kick(usb_handle* h) { std::lock_guard<std::mutex> lock(h->mutex); D("[ kicking %p (fd = %d) ]", h, h->fd); Loading
adb/client/usb_osx.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -556,6 +556,13 @@ int usb_close(usb_handle *handle) return 0; } void usb_reset(usb_handle* handle) { if (!handle->dead) { (*handle->interface)->USBDeviceReEnumerate(handle->interface, 0); } usb_kick(handle); } static void usb_kick_locked(usb_handle *handle) { LOG(INFO) << "Kicking handle"; Loading