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

Commit 90a7f5b5 authored by Avichal Rakesh's avatar Avichal Rakesh
Browse files

UsbGadget AIDL migration cleanup

This CL does the following:
  - Add fields to AIDL UsbSpeed that were added in HIDL's UsbSpeed 1.2.
  - Fix the values of the AIDL speeds. The values of fields in UsbSpeed
    didn't match their HIDL counterparts so this CL fixes the values
    as well.
  - Remove unused import from IUsbGadget and IUsbGadgetCallback.

Test: Manually tested that UsbManager reports the correct speed when
      using the AIDL interface
Bug: 218791946
Change-Id: Ic94bb382c11a88a29da5e61ca751138f271f54ac
parent 0cc4f07a
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -34,11 +34,15 @@
package android.hardware.usb.gadget;
@Backing(type="int") @VintfStability
enum UsbSpeed {
  UNKNOWN = 0,
  LOWSPEED = 1,
  FULLSPEED = 2,
  HIGHSPEED = 3,
  SUPERSPEED = 4,
  SUPERSPEED_10Gb = 5,
  SUPERSPEED_20Gb = 6,
  UNKNOWN = (-1),
  LOWSPEED = 0,
  FULLSPEED = 1,
  HIGHSPEED = 2,
  SUPERSPEED = 3,
  SUPERSPEED_10Gb = 4,
  SUPERSPEED_20Gb = 5,
  USB4_GEN2_10Gb = 6,
  USB4_GEN2_20Gb = 7,
  USB4_GEN3_20Gb = 8,
  USB4_GEN3_40Gb = 9,
}
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.hardware.usb.gadget;

import android.hardware.usb.gadget.GadgetFunction;
import android.hardware.usb.gadget.IUsbGadgetCallback;

@VintfStability
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.hardware.usb.gadget;

import android.hardware.usb.gadget.GadgetFunction;
import android.hardware.usb.gadget.Status;
import android.hardware.usb.gadget.UsbSpeed;

+33 −7
Original line number Diff line number Diff line
@@ -22,29 +22,55 @@ enum UsbSpeed {
    /**
     * UNKNOWN - Not Connected or Unsupported Speed
     */
    UNKNOWN = 0,
    UNKNOWN = -1,

    /**
     * USB Low Speed
     */
    LOWSPEED = 1,
    LOWSPEED = 0,

    /**
     * USB Full Speed
     */
    FULLSPEED = 2,
    FULLSPEED = 1,

    /**
     * USB High Speed
     */
    HIGHSPEED = 3,
    HIGHSPEED = 2,

    /**
     * USB Super Speed
     */
    SUPERSPEED = 4,
    SUPERSPEED = 3,

    /**
     * USB Super Speed 10Gbps
     */
    SUPERSPEED_10Gb = 5,
    SUPERSPEED_10Gb = 4,

    /**
     * USB Super Speed 20Gbps
     */
    SUPERSPEED_20Gb = 6,
    SUPERSPEED_20Gb = 5,

    /**
     * USB4 Gen2 x 1 (10Gbps)
     */
    USB4_GEN2_10Gb = 6,

    /**
     * USB4 Gen2 x 2 (20Gbps)
     */
    USB4_GEN2_20Gb = 7,

    /**
     * USB4 Gen3 x 1 (20Gbps)
     */
    USB4_GEN3_20Gb = 8,

    /**
     * USB4 Gen3 x 2 (40Gbps)
     */
    USB4_GEN3_40Gb = 9,
}