Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cb9c6c4 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6214566 from 31cf0a0d to rvc-release

Change-Id: Iee423377f39f09215f255cb8f173750959d63824
parents f44b2eaa 31cf0a0d
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -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();
@@ -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));
@@ -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);
+4 −0
Original line number Diff line number Diff line
@@ -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>
@@ -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
+7 −0
Original line number Diff line number Diff line
@@ -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>
@@ -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
+18 −0
Original line number Diff line number Diff line
@@ -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>>>();
@@ -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();
}

@@ -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;
@@ -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();
}

+6 −0
Original line number Diff line number Diff line
@@ -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