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

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

Snap for 10025836 from 1861463b to udc-release

Change-Id: I396a19a70aad3ecfa57d9c89327bcc4b46760d8d
parents 8a65ff9c 1861463b
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -3362,23 +3362,25 @@ void Dumpstate::MaybeSnapshotUiTraces() {
        return;
    }

    // Include the proto logging from WMShell.
    RunCommand(
        // Empty name because it's not intended to be classified as a bugreport section.
        // Actual logging files can be found as "/data/misc/wmtrace/shell_log.winscope"
        // in the bugreport.
        "", {"dumpsys", "activity", "service", "SystemUIService",
             "WMShell", "protolog", "save-for-bugreport"},
        CommandOptions::WithTimeout(10).Always().DropRoot().RedirectStderr().Build());
    const std::vector<std::vector<std::string>> dumpTracesForBugReportCommands = {
        {"dumpsys", "activity", "service", "SystemUIService", "WMShell", "protolog",
         "save-for-bugreport"},
        {"dumpsys", "activity", "service", "SystemUIService", "WMShell", "transitions", "tracing",
         "save-for-bugreport"},
        {"cmd", "input_method", "tracing", "save-for-bugreport"},
        {"cmd", "window", "tracing", "save-for-bugreport"},
        {"cmd", "window", "shell", "tracing", "save-for-bugreport"},
    };

    for (const auto& service : {"input_method", "window", "window shell"}) {
    for (const auto& command : dumpTracesForBugReportCommands) {
        RunCommand(
            // Empty name because it's not intended to be classified as a bugreport section.
            // Actual tracing files can be found in "/data/misc/wmtrace/" in the bugreport.
            "", {"cmd", service, "tracing", "save-for-bugreport"},
            "", command,
            CommandOptions::WithTimeout(10).Always().DropRoot().RedirectStderr().Build());
    }

    // This command needs to be run as root
    static const auto SURFACEFLINGER_COMMAND_SAVE_ALL_TRACES = std::vector<std::string> {
        "service", "call", "SurfaceFlinger", "1042"
    };
+14 −9
Original line number Diff line number Diff line
@@ -997,17 +997,22 @@ TEST_F(DumpstateTest, DumpPool_withParallelRunDisabled_isNull) {
    EXPECT_FALSE(ds.dump_pool_);
}

TEST_F(DumpstateBaseTest, PreDumpUiData) {
    // SurfaceFlinger's transactions trace is always enabled, i.e. it is always pre-dumped
    static const auto kTransactionsTrace =
            std::filesystem::path {"/data/misc/wmtrace/transactions_trace.winscope"};
TEST_F(DumpstateTest, PreDumpUiData) {
    // These traces are always enabled, i.e. they are always pre-dumped
    const std::vector<std::filesystem::path> uiTraces = {
        std::filesystem::path{"/data/misc/wmtrace/transactions_trace.winscope"},
        std::filesystem::path{"/data/misc/wmtrace/transition_trace.winscope"},
        std::filesystem::path{"/data/misc/wmtrace/shell_transition_trace.winscope"},
    };

    std::system(("rm " + kTransactionsTrace.string()).c_str());
    EXPECT_FALSE(std::filesystem::exists(kTransactionsTrace));
    for (const auto traceFile : uiTraces) {
        std::system(("rm -f " + traceFile.string()).c_str());
        EXPECT_FALSE(std::filesystem::exists(traceFile)) << traceFile << " was not deleted.";

        Dumpstate& ds_ = Dumpstate::GetInstance();
        ds_.PreDumpUiData();
    EXPECT_TRUE(std::filesystem::exists(kTransactionsTrace));
        EXPECT_TRUE(std::filesystem::exists(traceFile)) << traceFile << " was not created.";
    }
}

class ZippedBugReportStreamTest : public DumpstateBaseTest {
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ namespace installd {
// platform dependent logic.

int rm_package_dir(const std::string& package_dir) {
    return delete_dir_contents_and_dir(package_dir);
    return rename_delete_dir_contents_and_dir(package_dir);
}

}  // namespace installd
+8 −1
Original line number Diff line number Diff line
@@ -676,7 +676,6 @@ InputDispatcher::InputDispatcher(const sp<InputDispatcherPolicyInterface>& polic
    SurfaceComposerClient::getDefault()->addWindowInfosListener(mWindowInfoListener);
#endif
    mKeyRepeatState.lastKeyEntry = nullptr;
    policy->getDispatcherConfiguration(&mConfig);
}

InputDispatcher::~InputDispatcher() {
@@ -6606,6 +6605,14 @@ void InputDispatcher::cancelCurrentTouch() {
    mLooper->wake();
}

void InputDispatcher::requestRefreshConfiguration() {
    InputDispatcherConfiguration config;
    mPolicy->getDispatcherConfiguration(&config);

    std::scoped_lock _l(mLock);
    mConfig = config;
}

void InputDispatcher::setMonitorDispatchingTimeoutForTest(std::chrono::nanoseconds timeout) {
    std::scoped_lock _l(mLock);
    mMonitorDispatchingTimeout = timeout;
+3 −1
Original line number Diff line number Diff line
@@ -149,6 +149,8 @@ public:

    void cancelCurrentTouch() override;

    void requestRefreshConfiguration() override;

    // Public to allow tests to verify that a Monitor can get ANR.
    void setMonitorDispatchingTimeoutForTest(std::chrono::nanoseconds timeout);

@@ -166,7 +168,7 @@ private:
    std::unique_ptr<InputThread> mThread;

    sp<InputDispatcherPolicyInterface> mPolicy;
    android::InputDispatcherConfiguration mConfig;
    android::InputDispatcherConfiguration mConfig GUARDED_BY(mLock);

    std::mutex mLock;

Loading