Add resetUsbPort in USB HAL interface
Bug: 197300598
Test: Verify the API working manually
Signed-off-by: Ricky Niu <rickyniu@google.com>
Change-Id: I52de859244145cb8699f6138ee73a7fe47fdd67b
diff --git a/usb/aidl/android/hardware/usb/IUsb.aidl b/usb/aidl/android/hardware/usb/IUsb.aidl
index d296fbb..90ad115 100644
--- a/usb/aidl/android/hardware/usb/IUsb.aidl
+++ b/usb/aidl/android/hardware/usb/IUsb.aidl
@@ -104,4 +104,13 @@
* @param transactionId ID to be used when invoking the callback.
*/
void limitPowerTransfer(in String portName, boolean limit, long transactionId);
+
+ /**
+ * This function is used to reset the port role of a specific port.
+ * For instance, when data transfer through the port fails.
+ *
+ * @param portName name of the port that is being reset
+ * @param transactionId ID to be used when invoking the callback.
+ */
+ void resetUsbPort(in String portName, long transactionId);
}
diff --git a/usb/aidl/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/android/hardware/usb/IUsbCallback.aidl
index e33672a..2ae10d9 100644
--- a/usb/aidl/android/hardware/usb/IUsbCallback.aidl
+++ b/usb/aidl/android/hardware/usb/IUsbCallback.aidl
@@ -105,4 +105,13 @@
* @param transactionId ID sent during limitPowerTransfer request.
*/
void notifyLimitPowerTransferStatus(in String portName, boolean limit, in Status retval, long transactionId);
+
+ /**
+ * Used to notify the result of requesting resetUsbPort.
+ *
+ * @param portName name of the port that was being reset.
+ * @param retval SUCCESS if current request succeeded. FAILURE otherwise.
+ * @param transactionId current transactionId sent during resetUsbPort request.
+ */
+ void notifyResetUsbPortStatus(in String portName, in Status retval, long transactionId);
}