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

Commit 53aa93fe authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Automerger Merge Worker
Browse files

Merge "Let dumpstate call "cmd window trace save-for-bugreport"" am: 92be5232

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1595528

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I178ca19d89d4ef7f0c389f00a62d139987abb00a
parents 00e0bf8f 92be5232
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2908,6 +2908,10 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid,
        // own activity pushes out interesting data from the trace ring buffer.
        // The trace file is added to the zip by MaybeAddSystemTraceToZip().
        MaybeSnapshotSystemTrace();

        // If a winscope trace is running, snapshot it now. It will be pulled into bugreport later
        // from WMTRACE_DATA_DIR.
        MaybeSnapshotWinTrace();
    }
    onUiIntensiveBugreportDumpsFinished(calling_uid);
    MaybeCheckUserConsent(calling_uid, calling_package);
@@ -3019,6 +3023,14 @@ void Dumpstate::MaybeSnapshotSystemTrace() {
    // file in the later stages.
}

void Dumpstate::MaybeSnapshotWinTrace() {
    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", "window", "tracing", "save-for-bugreport"},
        CommandOptions::WithTimeout(10).Always().DropRoot().RedirectStderr().Build());
}

void Dumpstate::onUiIntensiveBugreportDumpsFinished(int32_t calling_uid) {
    if (calling_uid == AID_SHELL || !CalledByApi()) {
        return;
+1 −0
Original line number Diff line number Diff line
@@ -549,6 +549,7 @@ class Dumpstate {

    void MaybeTakeEarlyScreenshot();
    void MaybeSnapshotSystemTrace();
    void MaybeSnapshotWinTrace();

    void onUiIntensiveBugreportDumpsFinished(int32_t calling_uid);