Loading cmds/dumpstate/dumpstate.cpp +14 −7 Original line number Diff line number Diff line Loading @@ -1672,7 +1672,7 @@ static void DumpstateRadioCommon(bool include_sensitive_info = true) { // information. This information MUST NOT identify user-installed packages (UIDs are OK, package // names are not), and MUST NOT contain logs of user application traffic. // TODO(b/148168577) rename this and other related fields/methods to "connectivity" instead. static void DumpstateTelephonyOnly() { static void DumpstateTelephonyOnly(const std::string& calling_package) { DurationReporter duration_reporter("DUMPSTATE"); const CommandOptions DUMPSYS_COMPONENTS_OPTIONS = CommandOptions::WithTimeout(60).Build(); Loading @@ -1695,11 +1695,18 @@ static void DumpstateTelephonyOnly() { RunDumpsys("DUMPSYS", {"connectivity"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); // TODO(b/146521742) build out an argument to include bound services here for user builds if (include_sensitive_info) { // Carrier apps' services will be dumped below in dumpsys activity service all-non-platform. RunDumpsys("DUMPSYS", {"carrier_config"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); } else { // If the caller is a carrier app and has a carrier service, dump it here since we aren't // running dumpsys activity service all-non-platform below. Due to the increased output, we // give a higher timeout as well. RunDumpsys("DUMPSYS", {"carrier_config", "--requesting-package", calling_package}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(30)); } RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); RunDumpsys("DUMPSYS", {"netpolicy"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); RunDumpsys("DUMPSYS", {"network_management"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); Loading Loading @@ -2587,7 +2594,7 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid, if (options_->telephony_only) { MaybeCheckUserConsent(calling_uid, calling_package); DumpstateTelephonyOnly(); DumpstateTelephonyOnly(calling_package); DumpstateBoard(); } else if (options_->wifi_only) { MaybeCheckUserConsent(calling_uid, calling_package); Loading cmds/installd/CrateManager.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #include "CrateManager.h" #ifdef ENABLE_STORAGE_CRATES #include <android-base/logging.h> #include <android-base/stringprintf.h> #include <android/log.h> Loading Loading @@ -127,3 +129,5 @@ void CrateManager::dump(std::unique_ptr<CrateMetadata>& CrateMetadata) { } // namespace installd } // namespace android #endif // ENABLE_STORAGE_CRATES No newline at end of file cmds/installd/CrateManager.h +7 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #ifndef ANDROID_INSTALLD_CRATE_INFO_MANAGER_H #define ANDROID_INSTALLD_CRATE_INFO_MANAGER_H #ifdef ENABLE_STORAGE_CRATES #include <android/os/storage/CrateMetadata.h> #include <cutils/multiuser.h> #include <fts.h> Loading Loading @@ -79,4 +81,9 @@ private: } // namespace installd } // namespace android #else // ENABLE_STORAGE_CRATES #include <android/os/storage/CrateMetadata.h> using android::os::storage::CrateMetadata; #endif // ENABLE_STORAGE_CRATES #endif // ANDROID_INSTALLD_CRATE_INFO_MANAGER_H cmds/installd/InstalldNativeService.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -2054,6 +2054,7 @@ binder::Status InstalldNativeService::getAppCrates( for (const auto& packageName : packageNames) { CHECK_ARGUMENT_PACKAGE_NAME(packageName); } #ifdef ENABLE_STORAGE_CRATES std::lock_guard<std::recursive_mutex> lock(mLock); auto retVector = std::make_unique<std::vector<std::unique_ptr<CrateMetadata>>>(); Loading Loading @@ -2083,6 +2084,14 @@ binder::Status InstalldNativeService::getAppCrates( #endif *_aidl_return = std::move(retVector); #else // ENABLE_STORAGE_CRATES *_aidl_return = nullptr; /* prevent compile warning fail */ if (userId < 0) { return error(); } #endif // ENABLE_STORAGE_CRATES return ok(); } Loading @@ -2091,6 +2100,7 @@ binder::Status InstalldNativeService::getUserCrates( std::unique_ptr<std::vector<std::unique_ptr<CrateMetadata>>>* _aidl_return) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); #ifdef ENABLE_STORAGE_CRATES std::lock_guard<std::recursive_mutex> lock(mLock); const char* uuid_ = uuid ? uuid->c_str() : nullptr; Loading Loading @@ -2118,6 +2128,14 @@ binder::Status InstalldNativeService::getUserCrates( #endif *_aidl_return = std::move(retVector); #else // ENABLE_STORAGE_CRATES *_aidl_return = nullptr; /* prevent compile warning fail */ if (userId < 0) { return error(); } #endif // ENABLE_STORAGE_CRATES return ok(); } Loading libs/binder/ndk/include_ndk/android/binder_interface_utils.h +6 −0 Original line number Diff line number Diff line Loading @@ -86,9 +86,15 @@ class SharedRefBase { return t->template ref<T>(); } static void operator delete(void* p) { std::free(p); } private: std::once_flag mFlagThis; std::weak_ptr<SharedRefBase> mThis; // Use 'SharedRefBase::make<T>(...)' to make. SharedRefBase has implicit // ownership. Making this operator private to avoid double-ownership. static void* operator new(size_t s) { return std::malloc(s); } }; /** Loading Loading
cmds/dumpstate/dumpstate.cpp +14 −7 Original line number Diff line number Diff line Loading @@ -1672,7 +1672,7 @@ static void DumpstateRadioCommon(bool include_sensitive_info = true) { // information. This information MUST NOT identify user-installed packages (UIDs are OK, package // names are not), and MUST NOT contain logs of user application traffic. // TODO(b/148168577) rename this and other related fields/methods to "connectivity" instead. static void DumpstateTelephonyOnly() { static void DumpstateTelephonyOnly(const std::string& calling_package) { DurationReporter duration_reporter("DUMPSTATE"); const CommandOptions DUMPSYS_COMPONENTS_OPTIONS = CommandOptions::WithTimeout(60).Build(); Loading @@ -1695,11 +1695,18 @@ static void DumpstateTelephonyOnly() { RunDumpsys("DUMPSYS", {"connectivity"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); // TODO(b/146521742) build out an argument to include bound services here for user builds if (include_sensitive_info) { // Carrier apps' services will be dumped below in dumpsys activity service all-non-platform. RunDumpsys("DUMPSYS", {"carrier_config"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); } else { // If the caller is a carrier app and has a carrier service, dump it here since we aren't // running dumpsys activity service all-non-platform below. Due to the increased output, we // give a higher timeout as well. RunDumpsys("DUMPSYS", {"carrier_config", "--requesting-package", calling_package}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(30)); } RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); RunDumpsys("DUMPSYS", {"netpolicy"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); RunDumpsys("DUMPSYS", {"network_management"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); Loading Loading @@ -2587,7 +2594,7 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid, if (options_->telephony_only) { MaybeCheckUserConsent(calling_uid, calling_package); DumpstateTelephonyOnly(); DumpstateTelephonyOnly(calling_package); DumpstateBoard(); } else if (options_->wifi_only) { MaybeCheckUserConsent(calling_uid, calling_package); Loading
cmds/installd/CrateManager.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #include "CrateManager.h" #ifdef ENABLE_STORAGE_CRATES #include <android-base/logging.h> #include <android-base/stringprintf.h> #include <android/log.h> Loading Loading @@ -127,3 +129,5 @@ void CrateManager::dump(std::unique_ptr<CrateMetadata>& CrateMetadata) { } // namespace installd } // namespace android #endif // ENABLE_STORAGE_CRATES No newline at end of file
cmds/installd/CrateManager.h +7 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #ifndef ANDROID_INSTALLD_CRATE_INFO_MANAGER_H #define ANDROID_INSTALLD_CRATE_INFO_MANAGER_H #ifdef ENABLE_STORAGE_CRATES #include <android/os/storage/CrateMetadata.h> #include <cutils/multiuser.h> #include <fts.h> Loading Loading @@ -79,4 +81,9 @@ private: } // namespace installd } // namespace android #else // ENABLE_STORAGE_CRATES #include <android/os/storage/CrateMetadata.h> using android::os::storage::CrateMetadata; #endif // ENABLE_STORAGE_CRATES #endif // ANDROID_INSTALLD_CRATE_INFO_MANAGER_H
cmds/installd/InstalldNativeService.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -2054,6 +2054,7 @@ binder::Status InstalldNativeService::getAppCrates( for (const auto& packageName : packageNames) { CHECK_ARGUMENT_PACKAGE_NAME(packageName); } #ifdef ENABLE_STORAGE_CRATES std::lock_guard<std::recursive_mutex> lock(mLock); auto retVector = std::make_unique<std::vector<std::unique_ptr<CrateMetadata>>>(); Loading Loading @@ -2083,6 +2084,14 @@ binder::Status InstalldNativeService::getAppCrates( #endif *_aidl_return = std::move(retVector); #else // ENABLE_STORAGE_CRATES *_aidl_return = nullptr; /* prevent compile warning fail */ if (userId < 0) { return error(); } #endif // ENABLE_STORAGE_CRATES return ok(); } Loading @@ -2091,6 +2100,7 @@ binder::Status InstalldNativeService::getUserCrates( std::unique_ptr<std::vector<std::unique_ptr<CrateMetadata>>>* _aidl_return) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); #ifdef ENABLE_STORAGE_CRATES std::lock_guard<std::recursive_mutex> lock(mLock); const char* uuid_ = uuid ? uuid->c_str() : nullptr; Loading Loading @@ -2118,6 +2128,14 @@ binder::Status InstalldNativeService::getUserCrates( #endif *_aidl_return = std::move(retVector); #else // ENABLE_STORAGE_CRATES *_aidl_return = nullptr; /* prevent compile warning fail */ if (userId < 0) { return error(); } #endif // ENABLE_STORAGE_CRATES return ok(); } Loading
libs/binder/ndk/include_ndk/android/binder_interface_utils.h +6 −0 Original line number Diff line number Diff line Loading @@ -86,9 +86,15 @@ class SharedRefBase { return t->template ref<T>(); } static void operator delete(void* p) { std::free(p); } private: std::once_flag mFlagThis; std::weak_ptr<SharedRefBase> mThis; // Use 'SharedRefBase::make<T>(...)' to make. SharedRefBase has implicit // ownership. Making this operator private to avoid double-ownership. static void* operator new(size_t s) { return std::malloc(s); } }; /** Loading