From cf6843151ad3f5cfc784fd75e448e8aec2e61c0e Mon Sep 17 00:00:00 2001 From: Ricky Niu Date: Thu, 12 Jan 2023 14:48:53 +0800 Subject: [PATCH] Fixed the build break in cf_x86_tv-userdebug Change the long to int64_t in function setCurrentUsbFunctions Note:: This is a cherry-pick of ag/20605909 Test: Build Pass Bug: 260947383 Merged-In: I4832e2890ea561c8ad377e5a62bfa22dae35bf0f Change-Id: I4832e2890ea561c8ad377e5a62bfa22dae35bf0f Signed-off-by: Ricky Niu --- usb/gadget/aidl/default/UsbGadget.cpp | 11 ++++++----- usb/gadget/aidl/default/UsbGadget.h | 4 ++-- usb/gadget/aidl/default/service_gadget.cpp | 5 ----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/usb/gadget/aidl/default/UsbGadget.cpp b/usb/gadget/aidl/default/UsbGadget.cpp index 17e1da72d3..72cf681e5d 100644 --- a/usb/gadget/aidl/default/UsbGadget.cpp +++ b/usb/gadget/aidl/default/UsbGadget.cpp @@ -146,7 +146,9 @@ ScopedAStatus UsbGadget::reset() { Status UsbGadget::setupFunctions(long functions, const shared_ptr& callback, uint64_t timeout, int64_t in_transactionId) { bool ffsEnabled = false; - ALOGI("functions: %ld, timeout: %ld", functions, timeout); + if (timeout == 0) { + ALOGI("timeout not setup"); + } if ((functions & GadgetFunction::ADB) != 0) { ffsEnabled = true; @@ -190,16 +192,15 @@ Status getI2cBusHelper(string* name) { return Status::ERROR; } -ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, +ScopedAStatus UsbGadget::setCurrentUsbFunctions(int64_t functions, const shared_ptr& callback, - int64_t timeout, int64_t in_transactionId) { + int64_t timeoutMs, int64_t in_transactionId) { std::unique_lock lk(mLockSetCurrentFunction); std::string current_usb_power_operation_mode, current_usb_type; std::string usb_limit_sink_enable; string accessoryCurrentLimitEnablePath, accessoryCurrentLimitPath, path; - ALOGI("enter setCurrentUsbFunctions, in_transactionId=%ld , %ld", in_transactionId, timeout); mCurrentUsbFunctions = functions; mCurrentUsbFunctionsApplied = false; @@ -232,7 +233,7 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, -1, "Error while calling setCurrentUsbFunctionsCb"); } - status = setupFunctions(functions, callback, timeout, in_transactionId); + status = setupFunctions(functions, callback, timeoutMs, in_transactionId); if (status != Status::SUCCESS) { goto error; } diff --git a/usb/gadget/aidl/default/UsbGadget.h b/usb/gadget/aidl/default/UsbGadget.h index 4060021acb..5060194268 100644 --- a/usb/gadget/aidl/default/UsbGadget.h +++ b/usb/gadget/aidl/default/UsbGadget.h @@ -89,9 +89,9 @@ struct UsbGadget : public BnUsbGadget { bool mCurrentUsbFunctionsApplied; UsbSpeed mUsbSpeed; - ScopedAStatus setCurrentUsbFunctions(long functions, + ScopedAStatus setCurrentUsbFunctions(int64_t functions, const shared_ptr& callback, - int64_t timeout, int64_t in_transactionId) override; + int64_t timeoutMs, int64_t in_transactionId) override; ScopedAStatus getCurrentUsbFunctions(const shared_ptr& callback, int64_t in_transactionId) override; diff --git a/usb/gadget/aidl/default/service_gadget.cpp b/usb/gadget/aidl/default/service_gadget.cpp index 18d268df69..88678ab9e0 100644 --- a/usb/gadget/aidl/default/service_gadget.cpp +++ b/usb/gadget/aidl/default/service_gadget.cpp @@ -17,11 +17,6 @@ #include #include #include "UsbGadget.h" -/*using android::OK; -using android::hardware::configureRpcThreadpool; -using android::hardware::joinRpcThreadpool; -using android::sp; -using android::status_t;*/ using ::aidl::android::hardware::usb::gadget::UsbGadget; int main() { ABinderProcess_setThreadPoolMaxThreadCount(0);