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/default/Usb.cpp b/usb/aidl/default/Usb.cpp
index 92b09a2..7e738c4 100644
--- a/usb/aidl/default/Usb.cpp
+++ b/usb/aidl/default/Usb.cpp
@@ -90,6 +90,22 @@
     return ScopedAStatus::ok();
 }
 
+ScopedAStatus Usb::resetUsbPort(const string& in_portName, int64_t in_transactionId) {
+
+    pthread_mutex_lock(&mLock);
+    if (mCallback != NULL) {
+        ScopedAStatus ret = mCallback->notifyResetUsbPortStatus(
+            in_portName, Status::NOT_SUPPORTED, in_transactionId);
+        if (!ret.isOk())
+            ALOGE("notifyResetUsbPortStatus error %s", ret.getDescription().c_str());
+    } else {
+        ALOGE("Not notifying the userspace. Callback is not set");
+    }
+    pthread_mutex_unlock(&mLock);
+
+    return ScopedAStatus::ok();
+}
+
 Status queryMoistureDetectionStatus(std::vector<PortStatus> *currentPortStatus) {
     string enabled, status, path, DetectedPath;