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

Commit a1a7051d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12428866 from 0f2f4523 to 25Q2-release

Change-Id: Ifaef051a4a8cc8df0ed9a2aa2b8d5539de504329
parents 5bee715d 0f2f4523
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@ void add_mountinfo();
#define ALT_PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops-0"
#define BLK_DEV_SYS_DIR "/sys/block"

#define AFLAGS "/system/bin/aflags"
#define RECOVERY_DIR "/cache/recovery"
#define RECOVERY_DATA_DIR "/data/misc/recovery"
#define UPDATE_ENGINE_LOG_DIR "/data/misc/update_engine_log"
@@ -1792,6 +1793,10 @@ Dumpstate::RunStatus Dumpstate::dumpstate() {

    RunCommand("ACONFIG FLAGS", {PRINT_FLAGS},
               CommandOptions::WithTimeout(10).Always().DropRoot().Build());
    RunCommand("ACONFIG FLAGS DUMP", {AFLAGS, "list"},
               CommandOptions::WithTimeout(10).Always().AsRootIfAvailable().Build());
    RunCommand("WHICH ACONFIG FLAG STORAGE", {AFLAGS, "which-backing"},
               CommandOptions::WithTimeout(10).Always().AsRootIfAvailable().Build());

    RunCommand("STORAGED IO INFO", {"storaged", "-u", "-p"});

@@ -3533,7 +3538,7 @@ std::future<std::string> Dumpstate::MaybeSnapshotSystemTraceAsync() {
            // the dumpstate's own activity which is irrelevant.
            RunCommand(
                SERIALIZE_PERFETTO_TRACE_TASK, {"perfetto", "--save-for-bugreport"},
                CommandOptions::WithTimeout(10).DropRoot().CloseAllFileDescriptorsOnExec().Build(),
                CommandOptions::WithTimeout(30).DropRoot().CloseAllFileDescriptorsOnExec().Build(),
                false, outFd);
            // MaybeAddSystemTraceToZip() will take care of copying the trace in the zip
            // file in the later stages.
+18 −7
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#pragma once

#include <functional>
#include <map>
#include <memory>
#include <optional>
@@ -75,12 +76,13 @@ public:
     * the event is ready to consume.
     * @param looper needs to be sp and not shared_ptr because it inherits from
     * RefBase
     * @param resampler the resampling strategy to use. If null, no resampling will be
     * performed.
     * @param resamplerCreator callable that returns the resampling strategy to be used. If null, no
     * resampling will be performed. resamplerCreator must never return nullptr.
     */
    explicit InputConsumerNoResampling(const std::shared_ptr<InputChannel>& channel,
                                       sp<Looper> looper, InputConsumerCallbacks& callbacks,
                                       std::unique_ptr<Resampler> resampler);
    explicit InputConsumerNoResampling(
            const std::shared_ptr<InputChannel>& channel, sp<Looper> looper,
            InputConsumerCallbacks& callbacks,
            std::function<std::unique_ptr<Resampler>()> resamplerCreator);

    ~InputConsumerNoResampling();

@@ -117,7 +119,13 @@ private:
    std::shared_ptr<InputChannel> mChannel;
    sp<Looper> mLooper;
    InputConsumerCallbacks& mCallbacks;
    std::unique_ptr<Resampler> mResampler;
    const std::function<std::unique_ptr<Resampler>()> mResamplerCreator;

    /**
     * A map to manage multidevice resampling. Each contained resampler is never null. This map is
     * only modified by handleMessages.
     */
    std::map<DeviceId, std::unique_ptr<Resampler>> mResamplers;

    // Looper-related infrastructure
    /**
@@ -190,7 +198,10 @@ private:
    /**
     * Batch messages that can be batched. When an unbatchable message is encountered, send it
     * to the InputConsumerCallbacks immediately. If there are batches remaining,
     * notify InputConsumerCallbacks.
     * notify InputConsumerCallbacks. If a resampleable ACTION_DOWN message is received, then a
     * resampler is inserted for that deviceId in mResamplers. If a resampleable ACTION_UP or
     * ACTION_CANCEL message is received then the resampler associated to that deviceId is erased
     * from mResamplers.
     */
    void handleMessages(std::vector<InputMessage>&& messages);
    /**
+0 −6
Original line number Diff line number Diff line
@@ -91,12 +91,6 @@ private:
        }
    };

    /**
     * Keeps track of the previous MotionEvent deviceId to enable comparison between the previous
     * and the current deviceId.
     */
    std::optional<DeviceId> mPreviousDeviceId;

    /**
     * Up to two latest samples from MotionEvent. Updated every time resampleMotionEvent is called.
     * Note: We store up to two samples in order to simplify the implementation. Although,
+18 −5
Original line number Diff line number Diff line
@@ -34,37 +34,47 @@ using AidlServiceManager = android::os::IServiceManager;
using IAccessor = android::os::IAccessor;

static const char* kStaticCachableList[] = {
        // go/keep-sorted start
        "accessibility",
        "account",
        "activity",
        "android.hardware.thermal.IThermal/default",
        "android.hardware.power.IPower/default",
        "android.frameworks.stats.IStats/default",
        "android.system.suspend.ISystemSuspend/default",
        "alarm",
        "android.system.keystore2.IKeystoreService/default",
        "appops",
        "audio",
        "batterystats",
        "carrier_config",
        "connectivity",
        "content",
        "content_capture",
        "device_policy",
        "display",
        "dropbox",
        "econtroller",
        "graphicsstats",
        "input",
        "input_method",
        "isub",
        "jobscheduler",
        "legacy_permission",
        "location",
        "media.extractor",
        "media.metrics",
        "media.player",
        "media.resource_manager",
        "media_resource_monitor",
        "mount",
        "netd_listener",
        "netstats",
        "network_management",
        "nfc",
        "notification",
        "package",
        "package_native",
        "performance_hint",
        "permission",
        "permissionmgr",
        "permission_checker",
        "permissionmgr",
        "phone",
        "platform_compat",
        "power",
@@ -76,9 +86,12 @@ static const char* kStaticCachableList[] = {
        "time_detector",
        "trust",
        "uimode",
        "user",
        "virtualdevice",
        "virtualdevice_native",
        "webviewupdate",
        "window",
        // go/keep-sorted end
};

bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) {
+38 −6
Original line number Diff line number Diff line
@@ -157,12 +157,21 @@ protected:

class AccessorProvider {
public:
    AccessorProvider(RpcAccessorProvider&& provider) : mProvider(std::move(provider)) {}
    sp<IBinder> provide(const String16& name) { return mProvider(name); }
    AccessorProvider(std::set<std::string>&& instances, RpcAccessorProvider&& provider)
          : mInstances(std::move(instances)), mProvider(std::move(provider)) {}
    sp<IBinder> provide(const String16& name) {
        if (mInstances.count(String8(name).c_str()) > 0) {
            return mProvider(name);
        } else {
            return nullptr;
        }
    }
    const std::set<std::string>& instances() { return mInstances; }

private:
    AccessorProvider() = delete;

    std::set<std::string> mInstances;
    RpcAccessorProvider mProvider;
};

@@ -318,10 +327,32 @@ sp<IServiceManager> getServiceManagerShimFromAidlServiceManagerForTests(
    return sp<CppBackendShim>::make(sp<BackendUnifiedServiceManager>::make(sm));
}

std::weak_ptr<AccessorProvider> addAccessorProvider(RpcAccessorProvider&& providerCallback) {
// gAccessorProvidersMutex must be locked already
static bool isInstanceProvidedLocked(const std::string& instance) {
    return gAccessorProviders.end() !=
            std::find_if(gAccessorProviders.begin(), gAccessorProviders.end(),
                         [&instance](const AccessorProviderEntry& entry) {
                             return entry.mProvider->instances().count(instance) > 0;
                         });
}

std::weak_ptr<AccessorProvider> addAccessorProvider(std::set<std::string>&& instances,
                                                    RpcAccessorProvider&& providerCallback) {
    if (instances.empty()) {
        ALOGE("Set of instances is empty! Need a non empty set of instances to provide for.");
        return std::weak_ptr<AccessorProvider>();
    }
    std::lock_guard<std::mutex> lock(gAccessorProvidersMutex);
    for (const auto& instance : instances) {
        if (isInstanceProvidedLocked(instance)) {
            ALOGE("The instance %s is already provided for by a previously added "
                  "RpcAccessorProvider.",
                  instance.c_str());
            return std::weak_ptr<AccessorProvider>();
        }
    }
    std::shared_ptr<AccessorProvider> provider =
            std::make_shared<AccessorProvider>(std::move(providerCallback));
            std::make_shared<AccessorProvider>(std::move(instances), std::move(providerCallback));
    std::weak_ptr<AccessorProvider> receipt = provider;
    gAccessorProviders.push_back(AccessorProviderEntry(std::move(provider)));

@@ -331,8 +362,9 @@ std::weak_ptr<AccessorProvider> addAccessorProvider(RpcAccessorProvider&& provid
status_t removeAccessorProvider(std::weak_ptr<AccessorProvider> wProvider) {
    std::shared_ptr<AccessorProvider> provider = wProvider.lock();
    if (provider == nullptr) {
        ALOGE("The provider supplied to removeAccessorProvider has already been removed.");
        return NAME_NOT_FOUND;
        ALOGE("The provider supplied to removeAccessorProvider has already been removed or the "
              "argument to this function was nullptr.");
        return BAD_VALUE;
    }
    std::lock_guard<std::mutex> lock(gAccessorProvidersMutex);
    size_t sizeBefore = gAccessorProviders.size();
Loading