GetUsbDeviceInfoTool
Reports detailed descriptor info for one connected USB device, looked up by device_name in UsbManager.getDeviceList. Enumerates interfaces and their endpoints.
No permissions required (descriptor metadata only; actual data transfer would need user-granted device permission). Returns an error if USB host mode is unsupported or the device is absent. Read-only.
serial_number needs device-specific permission on API 29+ (UsbManager.hasPermission); when missing, UsbDevice.getSerialNumber() throws SecurityException rather than returning null — caught here so serial_number is simply null instead of failing the whole call. Check has_permission to distinguish "denied" from "device has no serial."
Output keys: name, vendor_id, product_id, device_class, device_subclass, device_protocol, manufacturer, product, serial_number, version, interface_count, interfaces (each with id, class, subclass, protocol, endpoint_count, endpoints), has_permission.