summaryrefslogtreecommitdiff
path: root/usb/aidl/default/Usb.cpp
diff options
context:
space:
mode:
authorRicky Niu <rickyniu@google.com>2021-12-07 20:27:37 +0800
committerRicky Niu <rickyniu@google.com>2022-01-24 21:28:45 +0800
commit45131a73095f00b9598c677d3270fb8fe41d0584 (patch)
tree7b4f36a95f5658e00962fbb569a7fec2aac4834f /usb/aidl/default/Usb.cpp
parentf883235915244d50bdbe59fa6317ed71094a3fe9 (diff)
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
Diffstat (limited to 'usb/aidl/default/Usb.cpp')
-rw-r--r--usb/aidl/default/Usb.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/usb/aidl/default/Usb.cpp b/usb/aidl/default/Usb.cpp
index 92b09a2b44..7e738c477f 100644
--- a/usb/aidl/default/Usb.cpp
+++ b/usb/aidl/default/Usb.cpp
@@ -90,6 +90,22 @@ ScopedAStatus Usb::enableUsbDataWhileDocked(const string& in_portName, int64_t i
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;