From 242debae75d823e9d359f43174b95326c31c384d Mon Sep 17 00:00:00 2001 From: kierancyphus Date: Thu, 1 Dec 2022 17:20:45 +0800 Subject: [PATCH 1/5] Dumpstate.cpp: use new history dir and inc more files Modify the logging mask file path to instead point to the new history directory, as well as include more files (right now only logging mask history and logging enabled history). Bug: 259174982 Test: Manually build and inspect bugreport to make sure files are included Change-Id: I1a57e0f4fea66929803fac350547b706d7442b26 Merged-In: I1a57e0f4fea66929803fac350547b706d7442b26 --- dumpstate/DumpstateDevice.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 2f6f1b75..f3910326 100644 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -33,7 +33,7 @@ #define MODEM_LOG_DIRECTORY "/data/vendor/radio/logs/always-on" #define MODEM_EXTENDED_LOG_DIRECTORY "/data/vendor/radio/extended_logs" -#define MODEM_LOG_MASK_HISTORY_DIRECTORY "/data/vendor/radio/logs/mask_history" +#define MODEM_LOG_HISTORY_DIRECTORY "/data/vendor/radio/logs/history" #define RIL_LOG_DIRECTORY "/data/vendor/radio" #define RIL_LOG_DIRECTORY_PROPERTY "persist.vendor.ril.log.base_dir" #define RIL_LOG_NUMBER_PROPERTY "persist.vendor.ril.log.num_file" @@ -1085,7 +1085,7 @@ void DumpstateDevice::dumpModemSection(int fd) { static void *dumpModemThread(void *data) { std::string modemLogDir = MODEM_LOG_DIRECTORY; std::string extendedLogDir = MODEM_EXTENDED_LOG_DIRECTORY; - std::string modemLogMaskHistoryDir = MODEM_LOG_MASK_HISTORY_DIRECTORY; + std::string modemLogHistoryDir = MODEM_LOG_HISTORY_DIRECTORY; std::string tcpdumpLogDir = TCPDUMP_LOG_DIRECTORY; static const std::string sectionName = "modem"; @@ -1148,7 +1148,7 @@ static void *dumpModemThread(void *data) { } dumpLogs(STDOUT_FILENO, extendedLogDir, modemLogAllDir, 50, EXTENDED_LOG_PREFIX); - dumpLogs(STDOUT_FILENO, modemLogMaskHistoryDir, modemLogAllDir, 1, "LoggingMask"); + dumpLogs(STDOUT_FILENO, modemLogHistoryDir, modemLogAllDir, 2, "Logging"); dumpRilLogs(STDOUT_FILENO, modemLogAllDir); dumpNetmgrLogs(modemLogAllDir); dumpModemEFS(modemLogAllDir); From a381b21dfc846816ac5a11c20f15251ed792cdaf Mon Sep 17 00:00:00 2001 From: kierancyphus Date: Thu, 1 Dec 2022 17:20:45 +0800 Subject: [PATCH 2/5] Dumpstate.cpp: use new history dir and inc more files Modify the logging mask file path to instead point to the new history directory, as well as include more files (right now only logging mask history and logging enabled history). Bug: 259174982 Test: Manually build and inspect bugreport to make sure files are included Change-Id: I1a57e0f4fea66929803fac350547b706d7442b26 --- dumpstate/Dumpstate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index 11142f5f..9be29e84 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -34,7 +34,7 @@ #define MODEM_LOG_DIRECTORY "/data/vendor/radio/logs/always-on" #define MODEM_EXTENDED_LOG_DIRECTORY "/data/vendor/radio/extended_logs" -#define MODEM_LOG_MASK_HISTORY_DIRECTORY "/data/vendor/radio/logs/mask_history" +#define MODEM_LOG_HISTORY_DIRECTORY "/data/vendor/radio/logs/history" #define RIL_LOG_DIRECTORY "/data/vendor/radio" #define RIL_LOG_DIRECTORY_PROPERTY "persist.vendor.ril.log.base_dir" #define RIL_LOG_NUMBER_PROPERTY "persist.vendor.ril.log.num_file" @@ -617,7 +617,7 @@ static void *dumpModemThread(void *data) { ATRACE_ASYNC_BEGIN("dumpModemThread", 0); std::string modemLogDir = MODEM_LOG_DIRECTORY; std::string extendedLogDir = MODEM_EXTENDED_LOG_DIRECTORY; - std::string modemLogMaskHistoryDir = MODEM_LOG_MASK_HISTORY_DIRECTORY; + std::string modemLogHistoryDir = MODEM_LOG_HISTORY_DIRECTORY; std::string tcpdumpLogDir = TCPDUMP_LOG_DIRECTORY; static const std::string sectionName = "modem"; @@ -680,7 +680,7 @@ static void *dumpModemThread(void *data) { } dumpLogs(STDOUT_FILENO, extendedLogDir, modemLogAllDir, 50, EXTENDED_LOG_PREFIX); - dumpLogs(STDOUT_FILENO, modemLogMaskHistoryDir, modemLogAllDir, 1, "LoggingMask"); + dumpLogs(STDOUT_FILENO, modemLogHistoryDir, modemLogAllDir, 2, "Logging"); dumpRilLogs(STDOUT_FILENO, modemLogAllDir); dumpNetmgrLogs(modemLogAllDir); dumpModemEFS(modemLogAllDir); From 3507989979fe6a03b6deab8e5677917ffb202438 Mon Sep 17 00:00:00 2001 From: Chien Kun Niu Date: Wed, 7 Dec 2022 00:32:18 +0000 Subject: [PATCH 3/5] Revert "Migrate IUsbGadget implementation to AIDL" This reverts commit bbcd013c419c6fb63ceb9ecb908ac67183d64e18. Reason for revert: Increase the boot time to cause the below bug. b/261027750 | P0 | Broken test: v2/android-perfetto-dev-team/apct/perfetto/perfetto_integrationtests on git_master on oriole_hwasan-userdebug at 9355690 Change-Id: Idba7322ca86e70cf5d8e170936696586caa8c1c2 --- usb/gadget/Android.bp | 14 +- usb/gadget/UsbGadget.cpp | 213 ++++++++---------- usb/gadget/UsbGadget.h | 60 ++--- ...roid.hardware.usb.gadget-service.gs101.rc} | 2 +- ...hardware.usb.gadget@1.2-service.gs101.xml} | 5 +- usb/gadget/service_gadget.cpp | 38 ++-- usb/usb/Android.bp | 1 - usb/usb/Usb.cpp | 2 +- 8 files changed, 156 insertions(+), 179 deletions(-) rename usb/gadget/{android.hardware.usb.gadget-service.rc => android.hardware.usb.gadget-service.gs101.rc} (93%) rename usb/gadget/{android.hardware.usb.gadget-service.xml => android.hardware.usb.gadget@1.2-service.gs101.xml} (70%) diff --git a/usb/gadget/Android.bp b/usb/gadget/Android.bp index ab5bc383..ab7ac325 100644 --- a/usb/gadget/Android.bp +++ b/usb/gadget/Android.bp @@ -27,11 +27,10 @@ package { cc_binary { name: "android.hardware.usb.gadget-service.gs101", relative_install_path: "hw", - init_rc: ["android.hardware.usb.gadget-service.rc"], + init_rc: ["android.hardware.usb.gadget-service.gs101.rc"], vintf_fragments: [ - "android.hardware.usb.gadget-service.xml", + "android.hardware.usb.gadget@1.2-service.gs101.xml", ], - vendor: true, srcs: ["service_gadget.cpp", "UsbGadget.cpp"], cflags: ["-Wall", "-Werror"], shared_libs: [ @@ -41,16 +40,13 @@ cc_binary { "liblog", "libutils", "libhardware", - "android.hardware.usb.gadget-V1-ndk", - "android.frameworks.stats-V1-ndk", + "android.hardware.usb.gadget@1.0", + "android.hardware.usb.gadget@1.1", + "android.hardware.usb.gadget@1.2", "libcutils", - "libbinder_ndk", ], static_libs: [ "libpixelusb", ], proprietary: true, - export_shared_lib_headers: [ - "android.frameworks.stats-V1-ndk", - ], } diff --git a/usb/gadget/UsbGadget.cpp b/usb/gadget/UsbGadget.cpp index 93138635..b6d1dd39 100644 --- a/usb/gadget/UsbGadget.cpp +++ b/usb/gadget/UsbGadget.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.usb.gadget.aidl-service" +#define LOG_TAG "android.hardware.usb.gadget@1.2-service.gs101" #include "UsbGadget.h" #include @@ -26,13 +26,12 @@ #include #include -#include - -namespace aidl { namespace android { namespace hardware { namespace usb { namespace gadget { +namespace V1_2 { +namespace implementation { string enabledPath; constexpr char kHsi2cPath[] = "/sys/devices/platform/10d50000.hsi2c"; @@ -47,7 +46,7 @@ UsbGadget::UsbGadget() : mGadgetIrqPath("") { } } -Status UsbGadget::getUsbGadgetIrqPath() { +V1_0::Status UsbGadget::getUsbGadgetIrqPath() { std::string irqs; size_t read_pos = 0; size_t found_pos = 0; @@ -94,20 +93,17 @@ void currentFunctionsAppliedCallback(bool functionsApplied, void *payload) { gadget->mCurrentUsbFunctionsApplied = functionsApplied; } -ScopedAStatus UsbGadget::getCurrentUsbFunctions(const shared_ptr &callback, - int64_t in_transactionId) { - ScopedAStatus ret = callback->getCurrentUsbFunctionsCb( +Return UsbGadget::getCurrentUsbFunctions(const sp &callback) { + Return ret = callback->getCurrentUsbFunctionsCb( mCurrentUsbFunctions, - mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED : Status::FUNCTIONS_NOT_APPLIED, - in_transactionId); + mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED : Status::FUNCTIONS_NOT_APPLIED); if (!ret.isOk()) - ALOGE("Call to getCurrentUsbFunctionsCb failed %s", ret.getDescription().c_str()); + ALOGE("Call to getCurrentUsbFunctionsCb failed %s", ret.description().c_str()); - return ScopedAStatus::ok(); + return Void(); } -ScopedAStatus UsbGadget::getUsbSpeed(const shared_ptr &callback, - int64_t in_transactionId) { +Return UsbGadget::getUsbSpeed(const sp &callback) { std::string current_speed; if (ReadFileToString(SPEED_PATH, ¤t_speed)) { current_speed = Trim(current_speed); @@ -125,26 +121,25 @@ ScopedAStatus UsbGadget::getUsbSpeed(const shared_ptr &callb else if (current_speed == "UNKNOWN") mUsbSpeed = UsbSpeed::UNKNOWN; else - mUsbSpeed = UsbSpeed::UNKNOWN; + mUsbSpeed = UsbSpeed::RESERVED_SPEED; } else { ALOGE("Fail to read current speed"); mUsbSpeed = UsbSpeed::UNKNOWN; } if (callback) { - ScopedAStatus ret = callback->getUsbSpeedCb(mUsbSpeed, in_transactionId); + Return ret = callback->getUsbSpeedCb(mUsbSpeed); if (!ret.isOk()) - ALOGE("Call to getUsbSpeedCb failed %s", ret.getDescription().c_str()); + ALOGE("Call to getUsbSpeedCb failed %s", ret.description().c_str()); } - return ScopedAStatus::ok(); + return Void(); } -Status UsbGadget::tearDownGadget() { - if (Status(resetGadget()) != Status::SUCCESS){ +V1_0::Status UsbGadget::tearDownGadget() { + if (resetGadget() != Status::SUCCESS) return Status::ERROR; - } if (monitorFfs.isMonitorRunning()) { monitorFfs.reset(); @@ -154,152 +149,139 @@ Status UsbGadget::tearDownGadget() { return Status::SUCCESS; } -static Status validateAndSetVidPid(uint64_t functions) { - Status ret = Status::SUCCESS; +static V1_0::Status validateAndSetVidPid(uint64_t functions) { + V1_0::Status ret = Status::SUCCESS; std::string vendorFunctions = getVendorFunctions(); switch (functions) { - case GadgetFunction::MTP: + case static_cast(GadgetFunction::MTP): if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee1")); + ret = setVidPid("0x18d1", "0x4ee1"); } break; - case GadgetFunction::ADB | - GadgetFunction::MTP: + case GadgetFunction::ADB | GadgetFunction::MTP: if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee2")); + ret = setVidPid("0x18d1", "0x4ee2"); } break; - case GadgetFunction::RNDIS: - case GadgetFunction::RNDIS | - GadgetFunction::NCM: + case static_cast(GadgetFunction::RNDIS): + case GadgetFunction::RNDIS | GadgetFunction::NCM: if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee3")); + ret = setVidPid("0x18d1", "0x4ee3"); } break; - case GadgetFunction::ADB | - GadgetFunction::RNDIS: - case GadgetFunction::ADB | - GadgetFunction::RNDIS | - GadgetFunction::NCM: + case GadgetFunction::ADB | GadgetFunction::RNDIS: + case GadgetFunction::ADB | GadgetFunction::RNDIS | GadgetFunction::NCM: if (vendorFunctions == "dm") { - ret = Status(setVidPid("0x04e8", "0x6862")); + ret = setVidPid("0x04e8", "0x6862"); } else { if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee4")); + ret = setVidPid("0x18d1", "0x4ee4"); } } break; - case GadgetFunction::PTP: + case static_cast(GadgetFunction::PTP): if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee5")); + ret = setVidPid("0x18d1", "0x4ee5"); } break; - case GadgetFunction::ADB | - GadgetFunction::PTP: + case GadgetFunction::ADB | GadgetFunction::PTP: if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee6")); + ret = setVidPid("0x18d1", "0x4ee6"); } break; - case GadgetFunction::ADB: + case static_cast(GadgetFunction::ADB): if (vendorFunctions == "dm") { - ret = Status(setVidPid("0x04e8", "0x6862")); + ret = setVidPid("0x04e8", "0x6862"); } else if (vendorFunctions == "etr_miu") { - ret = Status(setVidPid("0x18d1", "0x4ee2")); + ret = setVidPid("0x18d1", "0x4ee2"); } else if (vendorFunctions == "uwb_acm"){ - ret = Status(setVidPid("0x18d1", "0x4ee2")); + ret = setVidPid("0x18d1", "0x4ee2"); } else { if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee7")); + ret = setVidPid("0x18d1", "0x4ee7"); } } break; - case GadgetFunction::MIDI: + case static_cast(GadgetFunction::MIDI): if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee8")); + ret = setVidPid("0x18d1", "0x4ee8"); } break; - case GadgetFunction::ADB | - GadgetFunction::MIDI: + case GadgetFunction::ADB | GadgetFunction::MIDI: if (!(vendorFunctions == "user" || vendorFunctions == "")) { ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); ret = Status::CONFIGURATION_NOT_SUPPORTED; } else { - ret = Status(setVidPid("0x18d1", "0x4ee9")); + ret = setVidPid("0x18d1", "0x4ee9"); } break; - case GadgetFunction::ACCESSORY: + case static_cast(GadgetFunction::ACCESSORY): if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x2d00")); + ret = setVidPid("0x18d1", "0x2d00"); break; - case GadgetFunction::ADB | - GadgetFunction::ACCESSORY: + case GadgetFunction::ADB | GadgetFunction::ACCESSORY: if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x2d01")); + ret = setVidPid("0x18d1", "0x2d01"); break; - case GadgetFunction::AUDIO_SOURCE: + case static_cast(GadgetFunction::AUDIO_SOURCE): if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x2d02")); + ret = setVidPid("0x18d1", "0x2d02"); break; - case GadgetFunction::ADB | - GadgetFunction::AUDIO_SOURCE: + case GadgetFunction::ADB | GadgetFunction::AUDIO_SOURCE: if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x2d03")); + ret = setVidPid("0x18d1", "0x2d03"); break; - case GadgetFunction::ACCESSORY | - GadgetFunction::AUDIO_SOURCE: + case GadgetFunction::ACCESSORY | GadgetFunction::AUDIO_SOURCE: if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x2d04")); + ret = setVidPid("0x18d1", "0x2d04"); break; - case GadgetFunction::ADB | - GadgetFunction::ACCESSORY | - GadgetFunction::AUDIO_SOURCE: + case GadgetFunction::ADB | GadgetFunction::ACCESSORY | GadgetFunction::AUDIO_SOURCE: if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x2d05")); + ret = setVidPid("0x18d1", "0x2d05"); break; - case GadgetFunction::NCM: + case static_cast(GadgetFunction::NCM): if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x4eeb")); + ret = setVidPid("0x18d1", "0x4eeb"); break; - case GadgetFunction::ADB | - GadgetFunction::NCM: + case GadgetFunction::ADB | GadgetFunction::NCM: if (vendorFunctions == "dm") { - ret = Status(setVidPid("0x04e8", "0x6862")); + ret = setVidPid("0x04e8", "0x6862"); } else { if (!(vendorFunctions == "user" || vendorFunctions == "")) ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); - ret = Status(setVidPid("0x18d1", "0x4eec")); + ret = setVidPid("0x18d1", "0x4eec"); } break; default: @@ -309,33 +291,31 @@ static Status validateAndSetVidPid(uint64_t functions) { return ret; } -ScopedAStatus UsbGadget::reset() { +Return UsbGadget::reset() { ALOGI("USB Gadget reset"); if (!WriteStringToFile("none", PULLUP_PATH)) { ALOGI("Gadget cannot be pulled down"); - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Gadget cannot be pulled down"); + return Status::ERROR; } usleep(kDisconnectWaitUs); if (!WriteStringToFile(kGadgetName, PULLUP_PATH)) { ALOGI("Gadget cannot be pulled up"); - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Gadget cannot be pulled up"); + return Status::ERROR; } - return ScopedAStatus::ok(); + return Status::SUCCESS; } -Status UsbGadget::setupFunctions(long functions, - const shared_ptr &callback, uint64_t timeout, - int64_t in_transactionId) { +V1_0::Status UsbGadget::setupFunctions(uint64_t functions, + const sp &callback, + uint64_t timeout) { bool ffsEnabled = false; int i = 0; - if (Status(addGenericAndroidFunctions(&monitorFfs, functions, &ffsEnabled, &i)) != + if (addGenericAndroidFunctions(&monitorFfs, functions, &ffsEnabled, &i) != Status::SUCCESS) return Status::ERROR; @@ -345,7 +325,7 @@ Status UsbGadget::setupFunctions(long functions, ALOGI("enable usbradio debug functions"); if ((functions & GadgetFunction::RNDIS) != 0) { if (linkFunction("acm.gs6", i++)) - return Status::ERROR; + return Status::ERROR; if (linkFunction("dm.gs7", i++)) return Status::ERROR; } else { @@ -353,7 +333,7 @@ Status UsbGadget::setupFunctions(long functions, return Status::ERROR; if (linkFunction("acm.gs6", i++)) return Status::ERROR; - } + } } else if (vendorFunctions == "etr_miu") { ALOGI("enable etr_miu functions"); if (linkFunction("etr_miu.gs11", i++)) @@ -366,7 +346,7 @@ Status UsbGadget::setupFunctions(long functions, if ((functions & GadgetFunction::ADB) != 0) { ffsEnabled = true; - if (Status(addAdb(&monitorFfs, &i)) != Status::SUCCESS) + if (addAdb(&monitorFfs, &i) != Status::SUCCESS) return Status::ERROR; } @@ -382,7 +362,7 @@ Status UsbGadget::setupFunctions(long functions, return Status::ERROR; mCurrentUsbFunctionsApplied = true; if (callback) - callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS, in_transactionId); + callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS); return Status::SUCCESS; } @@ -397,13 +377,12 @@ Status UsbGadget::setupFunctions(long functions, if (callback) { bool pullup = monitorFfs.waitForPullUp(timeout); - ScopedAStatus ret = callback->setCurrentUsbFunctionsCb( - functions, pullup ? Status::SUCCESS : Status::ERROR, in_transactionId); - if (!ret.isOk()) { - ALOGE("setCurrentUsbFunctionsCb error %s", ret.getDescription().c_str()); - return Status::ERROR; - } + Return ret = callback->setCurrentUsbFunctionsCb( + functions, pullup ? Status::SUCCESS : Status::ERROR); + if (!ret.isOk()) + ALOGE("setCurrentUsbFunctionsCb error %s", ret.description().c_str()); } + return Status::SUCCESS; } @@ -430,10 +409,9 @@ Status getI2cBusHelper(string *name) { return Status::ERROR; } -ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, - const shared_ptr &callback, - int64_t timeout, - int64_t in_transactionId) { +Return UsbGadget::setCurrentUsbFunctions(uint64_t functions, + const sp &callback, + uint64_t timeout) { std::unique_lock lk(mLockSetCurrentFunction); std::string current_usb_power_operation_mode, current_usb_type; std::string usb_limit_sink_enable; @@ -452,7 +430,7 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, getUsbGadgetIrqPath(); // Unlink the gadget and stop the monitor if running. - Status status = tearDownGadget(); + V1_0::Status status = tearDownGadget(); if (status != Status::SUCCESS) { goto error; } @@ -462,15 +440,13 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, // Leave the gadget pulled down to give time for the host to sense disconnect. usleep(kDisconnectWaitUs); - if (functions == GadgetFunction::NONE) { + if (functions == static_cast(GadgetFunction::NONE)) { if (callback == NULL) - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "callback == NULL"); - ScopedAStatus ret = callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS, in_transactionId); + return Void(); + Return ret = callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS); if (!ret.isOk()) - ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.getDescription().c_str()); - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Error while calling setCurrentUsbFunctionsCb"); + ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.description().c_str()); + return Void(); } status = validateAndSetVidPid(functions); @@ -479,7 +455,7 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, goto error; } - status = setupFunctions(functions, callback, timeout, in_transactionId); + status = setupFunctions(functions, callback, timeout); if (status != Status::SUCCESS) { goto error; } @@ -519,23 +495,20 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, } ALOGI("Usb Gadget setcurrent functions called successfully"); - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Usb Gadget setcurrent functions called successfully"); - + return Void(); error: ALOGI("Usb Gadget setcurrent functions failed"); if (callback == NULL) - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Usb Gadget setcurrent functions failed"); - ScopedAStatus ret = callback->setCurrentUsbFunctionsCb(functions, status, in_transactionId); + return Void(); + Return ret = callback->setCurrentUsbFunctionsCb(functions, status); if (!ret.isOk()) - ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.getDescription().c_str()); - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Error while calling setCurrentUsbFunctionsCb"); + ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.description().c_str()); + return Void(); } +} // namespace implementation +} // namespace V1_2 } // namespace gadget } // namespace usb } // namespace hardware } // namespace android -} // aidl diff --git a/usb/gadget/UsbGadget.h b/usb/gadget/UsbGadget.h index d7e20a6c..8a2f7fdd 100644 --- a/usb/gadget/UsbGadget.h +++ b/usb/gadget/UsbGadget.h @@ -21,13 +21,11 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -37,17 +35,14 @@ #include #include -namespace aidl { namespace android { namespace hardware { namespace usb { namespace gadget { +namespace V1_2 { +namespace implementation { -using ::aidl::android::hardware::usb::gadget::GadgetFunction; -using ::aidl::android::hardware::usb::gadget::IUsbGadgetCallback; -using ::aidl::android::hardware::usb::gadget::IUsbGadget; -using ::aidl::android::hardware::usb::gadget::Status; -using ::aidl::android::hardware::usb::gadget::UsbSpeed; +using ::android::sp; using ::android::base::GetProperty; using ::android::base::SetProperty; using ::android::base::ParseUint; @@ -55,6 +50,12 @@ using ::android::base::unique_fd; using ::android::base::ReadFileToString; using ::android::base::Trim; using ::android::base::WriteStringToFile; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; using ::android::hardware::google::pixel::usb::addAdb; using ::android::hardware::google::pixel::usb::addEpollFd; using ::android::hardware::google::pixel::usb::getVendorFunctions; @@ -65,8 +66,10 @@ using ::android::hardware::google::pixel::usb::MonitorFfs; using ::android::hardware::google::pixel::usb::resetGadget; using ::android::hardware::google::pixel::usb::setVidPid; using ::android::hardware::google::pixel::usb::unlinkFunctions; -using ::ndk::ScopedAStatus; -using ::std::shared_ptr; +using ::android::hardware::usb::gadget::V1_0::Status; +using ::android::hardware::usb::gadget::V1_0::IUsbGadgetCallback; +using ::android::hardware::usb::gadget::V1_2::IUsbGadget; +using ::android::hardware::usb::gadget::V1_2::GadgetFunction; using ::std::string; constexpr char kGadgetName[] = "11110000.dwc3"; @@ -90,39 +93,36 @@ static MonitorFfs monitorFfs(kGadgetName); #define CURRENT_USB_TYPE_PATH POWER_SUPPLY_PATH "usb_type" #define CURRENT_USB_POWER_OPERATION_MODE_PATH USB_PORT0_PATH "power_operation_mode" -struct UsbGadget : public BnUsbGadget { +struct UsbGadget : public IUsbGadget { UsbGadget(); // Makes sure that only one request is processed at a time. std::mutex mLockSetCurrentFunction; std::string mGadgetIrqPath; - long mCurrentUsbFunctions; + uint64_t mCurrentUsbFunctions; bool mCurrentUsbFunctionsApplied; UsbSpeed mUsbSpeed; - ScopedAStatus setCurrentUsbFunctions(long functions, - const shared_ptr &callback, - int64_t timeout, int64_t in_transactionId) override; + Return setCurrentUsbFunctions(uint64_t functions, + const sp &callback, + uint64_t timeout) override; - ScopedAStatus getCurrentUsbFunctions(const shared_ptr &callback, - int64_t in_transactionId) override; + Return getCurrentUsbFunctions(const sp &callback) override; - ScopedAStatus reset() override; + Return reset() override; - ScopedAStatus getUsbSpeed(const shared_ptr &callback, - int64_t in_transactionId) override; - - ScopedAStatus setVidPid(const char *vid,const char *pid); + Return getUsbSpeed(const sp &callback) override; private: Status tearDownGadget(); Status getUsbGadgetIrqPath(); - Status setupFunctions(long functions, const shared_ptr &callback, - uint64_t timeout, int64_t in_transactionId); + Status setupFunctions(uint64_t functions, const sp &callback, + uint64_t timeout); }; +} // namespace implementation +} // namespace V1_2 } // namespace gadget } // namespace usb } // namespace hardware } // namespace android -} // aidl diff --git a/usb/gadget/android.hardware.usb.gadget-service.rc b/usb/gadget/android.hardware.usb.gadget-service.gs101.rc similarity index 93% rename from usb/gadget/android.hardware.usb.gadget-service.rc rename to usb/gadget/android.hardware.usb.gadget-service.gs101.rc index 3c9c1cce..8fa88680 100644 --- a/usb/gadget/android.hardware.usb.gadget-service.rc +++ b/usb/gadget/android.hardware.usb.gadget-service.gs101.rc @@ -1,4 +1,4 @@ -service vendor.usb-gadget-hal /vendor/bin/hw/android.hardware.usb.gadget-service.gs101 +service vendor.usb-gadget-hal-1-2 /vendor/bin/hw/android.hardware.usb.gadget-service.gs101 class hal user system group system shell mtp wakelock diff --git a/usb/gadget/android.hardware.usb.gadget-service.xml b/usb/gadget/android.hardware.usb.gadget@1.2-service.gs101.xml similarity index 70% rename from usb/gadget/android.hardware.usb.gadget-service.xml rename to usb/gadget/android.hardware.usb.gadget@1.2-service.gs101.xml index e7eebc35..8557f6ff 100644 --- a/usb/gadget/android.hardware.usb.gadget-service.xml +++ b/usb/gadget/android.hardware.usb.gadget@1.2-service.gs101.xml @@ -1,7 +1,8 @@ - + android.hardware.usb.gadget - 1 + hwbinder + 1.2 IUsbGadget default diff --git a/usb/gadget/service_gadget.cpp b/usb/gadget/service_gadget.cpp index e40f6896..d0908ee4 100644 --- a/usb/gadget/service_gadget.cpp +++ b/usb/gadget/service_gadget.cpp @@ -16,27 +16,35 @@ #define LOG_TAG "android.hardware.usb.gadget-service.gs101" -#include -#include -#include -#include +#include #include "UsbGadget.h" -using android::OK; using android::sp; + +// libhwbinder: +using android::hardware::configureRpcThreadpool; +using android::hardware::joinRpcThreadpool; + +// Generated HIDL files +using android::hardware::usb::gadget::V1_2::IUsbGadget; +using android::hardware::usb::gadget::V1_2::implementation::UsbGadget; + +using android::OK; using android::status_t; -using aidl::android::hardware::usb::gadget::UsbGadget; - int main() { - ABinderProcess_setThreadPoolMaxThreadCount(0); - std::shared_ptr usbgadget = ndk::SharedRefBase::make(); + android::sp service = new UsbGadget(); + configureRpcThreadpool(2, true /*callerWillJoin*/); + status_t status = service->registerAsService(); - const std::string instance = std::string() + UsbGadget::descriptor + "/default"; - binder_status_t status = AServiceManager_addService(usbgadget->asBinder().get(), instance.c_str()); - CHECK(status == STATUS_OK); + if (status != OK) { + ALOGE("Cannot register USB Gadget HAL service"); + return 1; + } - ALOGV("AIDL USB Gadget HAL about to start"); - ABinderProcess_joinThreadPool(); - return -1; // Should never be reached + ALOGI("USB gadget HAL Ready."); + joinRpcThreadpool(); + // Under noraml cases, execution will not reach this line. + ALOGI("USB gadget HAL failed to join thread pool."); + return 1; } diff --git a/usb/usb/Android.bp b/usb/usb/Android.bp index 8680b06c..7d42a76b 100644 --- a/usb/usb/Android.bp +++ b/usb/usb/Android.bp @@ -44,7 +44,6 @@ cc_binary { "android.hardware.thermal@2.0", "android.hardware.usb.gadget@1.0", "android.hardware.usb-V2-ndk", - "android.hardware.usb.gadget-V1-ndk", "libcutils", "android.frameworks.stats-V1-ndk", "pixelatoms-cpp", diff --git a/usb/usb/Usb.cpp b/usb/usb/Usb.cpp index 6afbde30..f69dca53 100644 --- a/usb/usb/Usb.cpp +++ b/usb/usb/Usb.cpp @@ -39,7 +39,7 @@ #include "Usb.h" #include -#include +#include #include using aidl::android::frameworks::stats::IStats; From da4c29371261fa57fe233d81cf4a96785069176c Mon Sep 17 00:00:00 2001 From: Nicole Lee Date: Wed, 7 Dec 2022 18:19:30 +0800 Subject: [PATCH 4/5] Update pixel stability logging mask - Enable _Normal logs in group GP_CH_COMM, GP_CH_NR GP_CP_COMM, GP_CP_NR, GP_DP_NR_H, GP_DP_NR_L, GP_SMPF_TASK Bug: 261136798 Change-Id: I1da78e487947431769fefc9370257a84de6e4141 --- radio/config/Pixel_stability.nprf | Bin 9467 -> 9472 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/radio/config/Pixel_stability.nprf b/radio/config/Pixel_stability.nprf index c2ce485f424e6916b746bbd2dc5e3f4e74556dc2..fc031883b5a6cb37d47e72d83b079d8188251312 100644 GIT binary patch delta 2617 zcmV-93dZ&ONq|a_^$`kof>rTqMxibt007*k1OQW$;UhbfrX(A)Tmk0?e=JK017Y}; zbi8gc;4mc_Fu~i3a^b=%FI8UN-wvZr1{j+DE${#Sd`CIS*WKwPKv%B2(%f{XYj;B* z3Rh*ngIR{=(42L19=5?%Q*(IpjONfB#hi3*CWE=3NoAg;#>S;5A4K+znUqnI=4ukqa+bcW6-&Rl7) z@im=vhwfgy?xpR1Y z`L*_&{E{cVp*N~Gmwh#UEQ-=l8daJrjWw=vC=cb)lMVqt@j++kjOI+&J6F%Qe?i$@qdRm*aVHc@ z>ToxQ>QJ3Eb)J8FHSUXJUa#?_G{vDftKwYg4)8`B&7nD~=1kv=%d=`!hRUof6Q0jk zH@pH$Z|KdcH_LDAxXsIKG>7J_m{WA+;M!v!+U7hh*%Y8Pv}WC!#je1Pl^V^VIqT+J zb_I4U(WnfSxvq>af84x6<52-hLupo}SuW6cK8@l~oKE-J; zhKy1d&9~<=WE7#!&t=Fc!hL-%LrM{7`ds(6N5a!!x87%iJ<-5A)`B2IEtq+vg)tAb zF!pg42pML<%%d!fd5|{%e=?gP^rtj3vTvY`n(Wm`doKRf%iBmqi)|`554K9+oL`Do;V}`pGb2I zK4IoCEJ_1<3I+KooLx|X?1rAB&i1ut9(1;^HowOlf5TGqd(1H`G~@RtGORMAD(4k! z_DpJSj`L?y6SH&kXHqk>TdZr;-orv1RcFLP7**%PLKNMp6Jjxl?$kLkkD)ttO3Xv( z&eU}{MbM!Oho|Q-bN4R$b6W~n_UC>{f9~4Uovg3b%gwCG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vqW z4cLX|RQ#a&( Date: Thu, 21 Jul 2022 14:45:34 -0700 Subject: [PATCH 5/5] Import prebuilt kernel modules like fips140.ko Add support for copying prebuilt kernel modules like fips140.ko into the vendor ramdisk. These kernel modules are different in the following ways: - They do not appear in vendor_boot.modules.load provided by the kernel build system. - We want to put their names at the very beginning of the output modules.load file to ensure that they are loaded prior to all other modules. We define a new Makefile variable named BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES. For every filename on this list, we verify that the file exists in $(KERNEL_MODULE_DIR), and if it does, we include its name in the modules.load for the vendor boot ramdisk. Bug: 194712883 Change-Id: Iff8923c2492296b8eb4d24ec94bbfccc19f4e8f5 --- BoardConfig-common.mk | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk index cb8072d7..0538b86c 100644 --- a/BoardConfig-common.mk +++ b/BoardConfig-common.mk @@ -352,11 +352,20 @@ KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko) BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist -BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_boot.modules.load)) -ifndef BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD +# Prebuilt kernel modules that are *not* listed in vendor_boot.modules.load +BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES = fips140/fips140.ko +BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA = $(foreach k,$(BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES),$(if $(wildcard $(KERNEL_MODULE_DIR)/$(k)), $(k))) +KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA)) + +# Kernel modules that are listed in vendor_boot.modules.load +BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_boot.modules.load)) +ifndef BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE $(error vendor_boot.modules.load not found or empty) endif -BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD))) +BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA) +BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE) +BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA)) +BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE))) BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load)) ifndef BOARD_VENDOR_KERNEL_MODULES_LOAD