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

Commit 4bff76be authored by Jerry Zhang's avatar Jerry Zhang Committed by android-build-merger
Browse files

Merge "UsbDescriptor: Add finite timeout to control transfer"

am: 20dca26f

Change-Id: I86a916694a497bedb7d2df8a64dd17e0e15ce332
parents 8f66efbf 20dca26f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ public abstract class UsbDescriptor implements Reporting {
    public static final int REQUEST_GET_CONFIGURATION  = 0x08;
    public static final int REQUEST_SET_CONFIGURATION  = 0x09;

    // USB control transfer timeout
    public static final int USB_CONTROL_TRANSFER_TIMEOUT_MS = 200;

    /**
     * @throws IllegalArgumentException
     */
@@ -224,7 +227,7 @@ public abstract class UsbDescriptor implements Reporting {
                        0,
                        sStringBuffer,
                        0xFF,
                        0);
                        USB_CONTROL_TRANSFER_TIMEOUT_MS);
                if (rdo >= 0) {
                    usbStr = new String(sStringBuffer, 2, rdo - 2, "UTF-16LE");
                } else {