Merge changes I824c99fa,I1ce03549

* changes:
  Usb: Remove unused interface methods and constants
  Usb: Fix incorrect mapping of port mode constants
This commit is contained in:
Treehugger Robot
2023-06-21 04:52:28 +00:00
committed by Gerrit Code Review
4 changed files with 3 additions and 74 deletions

View File

@@ -66,10 +66,6 @@ public final class UsbGadgetAidl implements UsbGadgetHal {
return GADGET_HAL_V2_0; return GADGET_HAL_V2_0;
} }
@Override
public void systemReady() {
}
public void serviceDied() { public void serviceDied() {
logAndPrint(Log.ERROR, mPw, "Usb Gadget AIDL hal service died"); logAndPrint(Log.ERROR, mPw, "Usb Gadget AIDL hal service died");
synchronized (mGadgetProxyLock) { synchronized (mGadgetProxyLock) {

View File

@@ -28,69 +28,6 @@ import java.lang.String;
* @hide * @hide
*/ */
public interface UsbGadgetHal { public interface UsbGadgetHal {
/**
* Power role: This USB port can act as a source (provide power).
* @hide
*/
public static final int HAL_POWER_ROLE_SOURCE = 1;
/**
* Power role: This USB port can act as a sink (receive power).
* @hide
*/
public static final int HAL_POWER_ROLE_SINK = 2;
@IntDef(prefix = { "HAL_POWER_ROLE_" }, value = {
HAL_POWER_ROLE_SOURCE,
HAL_POWER_ROLE_SINK
})
@Retention(RetentionPolicy.SOURCE)
@interface HalUsbPowerRole{}
/**
* Data role: This USB port can act as a host (access data services).
* @hide
*/
public static final int HAL_DATA_ROLE_HOST = 1;
/**
* Data role: This USB port can act as a device (offer data services).
* @hide
*/
public static final int HAL_DATA_ROLE_DEVICE = 2;
@IntDef(prefix = { "HAL_DATA_ROLE_" }, value = {
HAL_DATA_ROLE_HOST,
HAL_DATA_ROLE_DEVICE
})
@Retention(RetentionPolicy.SOURCE)
@interface HalUsbDataRole{}
/**
* This USB port can act as a downstream facing port (host).
*
* @hide
*/
public static final int HAL_MODE_DFP = 1;
/**
* This USB port can act as an upstream facing port (device).
*
* @hide
*/
public static final int HAL_MODE_UFP = 2;
@IntDef(prefix = { "HAL_MODE_" }, value = {
HAL_MODE_DFP,
HAL_MODE_UFP,
})
@Retention(RetentionPolicy.SOURCE)
@interface HalUsbPortMode{}
/**
* UsbPortManager would call this when the system is done booting.
*/
public void systemReady();
/** /**
* This function is used to query the USB functions included in the * This function is used to query the USB functions included in the
* current USB configuration. * current USB configuration.

View File

@@ -123,10 +123,6 @@ public final class UsbGadgetHidl implements UsbGadgetHal {
} }
} }
@Override
public void systemReady() {
}
static boolean isServicePresent(IndentingPrintWriter pw) { static boolean isServicePresent(IndentingPrintWriter pw) {
try { try {
IUsbGadget.getService(true); IUsbGadget.getService(true);

View File

@@ -70,17 +70,17 @@ public interface UsbPortHal {
* *
* @hide * @hide
*/ */
public static final int HAL_MODE_DFP = 1; public static final int HAL_MODE_UFP = 1;
/** /**
* This USB port can act as an upstream facing port (device). * This USB port can act as an upstream facing port (device).
* *
* @hide * @hide
*/ */
public static final int HAL_MODE_UFP = 2; public static final int HAL_MODE_DFP = 2;
@IntDef(prefix = { "HAL_MODE_" }, value = { @IntDef(prefix = { "HAL_MODE_" }, value = {
HAL_MODE_DFP,
HAL_MODE_UFP, HAL_MODE_UFP,
HAL_MODE_DFP,
}) })
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@interface HalUsbPortMode{} @interface HalUsbPortMode{}