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 Original line Diff line number Diff line
@@ -380,6 +380,11 @@ public class UsbHostManager {
            return false;
            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);
        UsbDescriptorParser parser = new UsbDescriptorParser(deviceAddress, descriptors);
        if (deviceClass == UsbConstants.USB_CLASS_PER_INTERFACE
        if (deviceClass == UsbConstants.USB_CLASS_PER_INTERFACE
                && !checkUsbInterfacesDenyListed(parser)) {
                && !checkUsbInterfacesDenyListed(parser)) {
@@ -462,8 +467,7 @@ public class UsbHostManager {
                }
                }


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


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