mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-21 15:34:20 +01:00
Log device opening errors during listing
Without this log, the user would have no way to know that a USB device is rejected because it could not be opened (typically due to insufficient permissions).
This commit is contained in:
@@ -38,6 +38,10 @@ sc_usb_read_device(libusb_device *device, struct sc_usb_device *out) {
|
|||||||
libusb_device_handle *handle;
|
libusb_device_handle *handle;
|
||||||
result = libusb_open(device, &handle);
|
result = libusb_open(device, &handle);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
|
// Log at debug level because it is expected that some non-Android USB
|
||||||
|
// devices present on the computer require special permissions
|
||||||
|
LOGD("Open USB device %04" PRIx16 ":%04" PRIx16 ": libusb error: %s",
|
||||||
|
desc.idVendor, desc.idProduct, libusb_strerror(result));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user