Fix USB resets when adb daemon is started (#1470740)

This commit is contained in:
Bastien Nocera 2018-02-27 19:11:05 +01:00
commit 6ded5b3ec8
3 changed files with 1238 additions and 1 deletions

View file

@ -0,0 +1,40 @@
From 5d002b8d6ae0a1eeefe09309ae6687a16e82ed08 Mon Sep 17 00:00:00 2001
From: Yabin Cui <yabinc@google.com>
Date: Tue, 4 Apr 2017 10:29:21 -0700
Subject: [PATCH] adb: don't reset usb when connecting it.
Calling libusb_reset_device() resets the usb connection with device
on linux platform. It can interfere with other usb interfaces and only
works on linux.
Removing it only affects when adb server is killed while doing IO with
device, which will be solved in later patches.
Bug: http://b/32952319
Test: none
Change-Id: I19522435eadd938ff95d49cbae3bcaa5c8f6d184
---
adb/client/usb_libusb.cpp | 8 --------
1 file changed, 8 deletions(-)
diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp
index 7adb26213..c48a2517b 100644
--- a/adb/client/usb_libusb.cpp
+++ b/adb/client/usb_libusb.cpp
@@ -306,14 +306,6 @@ static void poll_for_devices() {
}
device_serial.resize(rc);
- // Try to reset the device.
- rc = libusb_reset_device(handle_raw);
- if (rc != 0) {
- LOG(WARNING) << "failed to reset opened device '" << device_serial
- << "': " << libusb_error_name(rc);
- continue;
- }
-
// WARNING: this isn't released via RAII.
rc = libusb_claim_interface(handle.get(), interface_num);
if (rc != 0) {
--
2.14.3

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,7 @@
Name: android-tools
Version: %{date}git%{git_commit}
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Android platform tools(adb, fastboot)
Group: Applications/System
@ -45,6 +45,9 @@ Patch1: 0001-Add-string-h.patch
Patch2: 0002-libusb-modifications.patch
Patch3: 0003-atomic-fix.patch
Patch4: 0004-bz1441234.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1470740
Patch5: 0001-adb-don-t-reset-usb-when-connecting-it.patch
Patch6: 0001-adb-fix-two-device-offline-problems.patch
Requires(post): systemd
Requires(preun): systemd
@ -98,6 +101,8 @@ setup between the host and the target phone as adb.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
cp -p %{SOURCE5} 51-android.rules
@ -134,6 +139,9 @@ install -p -D -m 0644 %{SOURCE6} \
%changelog
* Tue Feb 27 2018 Bastien Nocera <bnocera@redhat.com> - 20170311gite7195be7725a-7
- Fix USB resets when adb daemon is started (#1470740)
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170311gite7195be7725a-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild