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

Commit 448c1370 authored by Vinod Benure's avatar Vinod Benure
Browse files

Adds an option to disable capture logcat in proto file

bug: b/326318293

Test: atest FrameworksInProcessTests CrossUserPackageVisibilityTests SdkSandboxInprocessTests
Change-Id: I774f9b81f1507ccbff6fd9c55a47d48911113089
parent ccaa40d1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -183,6 +183,8 @@ public class Am extends BaseCommand {
                instrument.disableTestApiChecks = false;
            } else if (opt.equals("--no-isolated-storage")) {
                instrument.disableIsolatedStorage = true;
            } else if (opt.equals("--no-logcat")) {
                instrument.captureLogcat = false;
            } else if (opt.equals("--user")) {
                instrument.userId = parseUserArg(nextArgRequired());
            } else if (opt.equals("--abi")) {
+11 −8
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public class Instrument {
    public String profileFile = null;
    public boolean wait = false;
    public boolean rawMode = false;
    public boolean captureLogcat = true;
    boolean protoStd = false;  // write proto to stdout
    boolean protoFile = false;  // write proto to a file
    String logPath = null;
@@ -266,16 +267,18 @@ public class Instrument {
            proto.write(InstrumentationData.TestStatus.RESULT_CODE, resultCode);
            writeBundle(proto, InstrumentationData.TestStatus.RESULTS, results);

            if (captureLogcat) {
                if (resultCode == STATUS_TEST_STARTED) {
                    // Logcat -T takes wall clock time (!?)
                    mTestStartMs = System.currentTimeMillis();
                } else {
                    if (mTestStartMs > 0) {
                    proto.write(InstrumentationData.TestStatus.LOGCAT, readLogcat(mTestStartMs));
                        proto.write(InstrumentationData.TestStatus.LOGCAT,
                                readLogcat(mTestStartMs));
                    }
                    mTestStartMs = 0;
                }

            }
            proto.end(testStatusToken);

            outputProto(proto);