Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84fbc6b6 authored by Jiabin Huang's avatar Jiabin Huang Committed by Android (Google) Code Review
Browse files

Merge "Use the descriptor passed in when adding USB device instead of querying again." into main

parents 511dd169 66d75130
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -380,6 +380,11 @@ public class UsbHostManager {
            return false;
        }

        if (descriptors == null) {
            Slog.e(TAG, "Failed to add device as the descriptor is null");
            return false;
        }

        UsbDescriptorParser parser = new UsbDescriptorParser(deviceAddress, descriptors);
        if (deviceClass == UsbConstants.USB_CLASS_PER_INTERFACE
                && !checkUsbInterfacesDenyListed(parser)) {
@@ -462,8 +467,7 @@ public class UsbHostManager {
                }

                // Tracking
                addConnectionRecord(deviceAddress, ConnectionRecord.CONNECT,
                        parser.getRawDescriptors());
                addConnectionRecord(deviceAddress, ConnectionRecord.CONNECT, descriptors);

                // Stats collection
                FrameworkStatsLog.write(FrameworkStatsLog.USB_DEVICE_ATTACHED,