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

Commit e2c91752 authored by Pablo Gamito's avatar Pablo Gamito Committed by Automerger Merge Worker
Browse files

Merge "Save transition trace in bugreports" into udc-dev am: 93b5d6a3 am: 60867d3e

parents c9e9fd36 60867d3e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -108,8 +108,10 @@ public class BugreportManagerTest {
            Paths.get("/data/misc/wmtrace/ime_trace_managerservice.winscope"),
            Paths.get("/data/misc/wmtrace/ime_trace_service.winscope"),
            Paths.get("/data/misc/wmtrace/wm_trace.winscope"),
            Paths.get("/data/misc/wmtrace/wm_log.winscope"),
            Paths.get("/data/misc/wmtrace/layers_trace.winscope"),
            Paths.get("/data/misc/wmtrace/transactions_trace.winscope"),
            Paths.get("/data/misc/wmtrace/transition_trace.winscope"),
    };
    private static final Path[] UI_TRACES_GENERATED_DURING_BUGREPORT = {
            Paths.get("/data/misc/wmtrace/layers_trace_from_transactions.winscope"),
+18 −0
Original line number Diff line number Diff line
@@ -365,6 +365,24 @@ public class TransitionTracer {
        Trace.endSection();
    }

    /**
     * Being called while taking a bugreport so that tracing files can be included in the bugreport.
     *
     * @param pw Print writer
     */
    public void saveForBugreport(@Nullable PrintWriter pw) {
        if (IS_USER) {
            LogAndPrintln.e(pw, "Tracing is not supported on user builds.");
            return;
        }
        Trace.beginSection("TransitionTracer#saveForBugreport");
        synchronized (mEnabledLock) {
            final File outputFile = new File(TRACE_FILE);
            writeTraceToFileLocked(pw, outputFile);
        }
        Trace.endSection();
    }

    boolean isActiveTracingEnabled() {
        return mActiveTracingEnabled;
    }
+3 −0
Original line number Diff line number Diff line
@@ -1301,6 +1301,9 @@ public class WindowManagerShellCommand extends ShellCommand {
            case "stop":
                mInternal.mTransitionTracer.stopTrace(pw);
                break;
            case "save-for-bugreport":
                mInternal.mTransitionTracer.saveForBugreport(pw);
                break;
            default:
                getErrPrintWriter()
                        .println("Error: expected 'start' or 'stop', but got '" + arg + "'");