Bug 199185

Summary: [devel/android-tools-adb][patch] Accept devices w/o serial number
Product: Ports & Packages Reporter: Marcin Cieślak <saper>
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Only Me CC: hselasky, jbeich, kevlo, usb
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Teach usb_libusb.c to use devices without serial number
none
Ignore non-ASCII languages none

Description Marcin Cieślak 2015-04-05 20:17:16 UTC
Created attachment 155214 [details]
Teach usb_libusb.c to use devices without serial number

"adb devices" does not accept my old Huawei Ideos phone running CyanogenMod. It turns out it thinks it really needs a serial number on the USB interface.

I wanted to submit this upstream, but it turns out somebody deleted the BSD support in AOSP master:

https://android-review.googlesource.com/#/c/127904
Comment 1 Jan Beich freebsd_committer freebsd_triage 2015-06-21 20:44:42 UTC
Created attachment 157953 [details]
Ignore non-ASCII languages

Comparing with libusb code by hselasky for fastboot, working around serial number language may not be necessary. So, try the following patch instead. adb itself should accept empty serial just fine.

https://android.googlesource.com/platform/system/core/+/c840653%5E!/
https://android.googlesource.com/platform/system/core/+/0927bf9%5E!/

$ adb devices
List of devices attached
????????????    device

or

$ adb devices
List of devices attached
(no serial number)      device
Comment 2 Jan Beich freebsd_committer freebsd_triage 2015-06-21 21:08:44 UTC
Kevin is the maintainer, so he should review the patch(es) -> assignee.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2015-08-26 13:53:47 UTC
Ping. Can someone from usb@ help with review?
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2015-08-27 08:06:04 UTC
Hi,

This patch belongs upstream. I'll to a more through review once they restore the libusb support.

--HPS
Comment 5 Hans Petter Selasky freebsd_committer freebsd_triage 2015-08-27 08:06:22 UTC
(In reply to Hans Petter Selasky from comment #4)
s/to/do
Comment 6 Marcin Cieślak 2015-08-27 08:08:32 UTC
Will they?
Comment 7 Jan Beich freebsd_committer freebsd_triage 2015-08-30 19:18:25 UTC
Unlikely. usb_libusb.c was basically unmaintained, see my cleanup in ports r390138. My main gripe with working upstream are the following disrespectful requirments:

- Sign up for Google Account (over Tor doesn't work)
- Sign CLA to submit patches

libusb backend in fastboot was abandoned by upstream as well. At least, it was in better shape.

https://code.google.com/p/android/issues/detail?id=15749
https://svnweb.freebsd.org/ports/head/devel/android-tools-fastboot-devel/files/usb_freebsd.cpp
Comment 8 Jan Beich freebsd_committer freebsd_triage 2015-10-09 16:18:27 UTC
Assign to new maintainer after ports r398924. usb_libusb.cpp still needs more love, at least in -devel port e.g., try merging

https://android.googlesource.com/platform/system/core/+/3d2904c%5E!/
https://android.googlesource.com/platform/system/core/+/812f030%5E!/
Comment 9 commit-hook freebsd_committer freebsd_triage 2016-09-28 09:44:09 UTC
A commit references this bug:

Author: jbeich
Date: Wed Sep 28 09:43:39 UTC 2016
New revision: 422863
URL: https://svnweb.freebsd.org/changeset/ports/422863

Log:
  devel/android-tools-adb{,-devel}: drop unnecessary non-ASCII serial handling

  Linux replaced the code as well in
  https://android.googlesource.com/platform/system/core/+/9309ecbcec42%5E!/

  PR:		199185

Changes:
  head/devel/android-tools-adb/Makefile
  head/devel/android-tools-adb/files/usb_libusb.cpp
  head/devel/android-tools-adb-devel/Makefile
  head/devel/android-tools-adb-devel/files/usb_libusb.cpp