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

Commit 1e24bf60 authored by Alan Stokes's avatar Alan Stokes
Browse files

Tidy up DexLoggerIntegrationTests.

Addressing comments from ag/3381420.
I also fixed two lines that were slightly too long.

Bug: 63927552
Test: atest DexLoggerIntegrationTests
Change-Id: I258d0aa2068c76175d30c0be9ba95482d3db9437
parent e780e8d2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -57,11 +57,11 @@ import java.util.List;
@RunWith(JUnit4.class)
public final class DexLoggerIntegrationTests {

    private static final String TAG = DexLoggerIntegrationTests.class.getSimpleName();

    private static final String PACKAGE_NAME = "com.android.frameworks.dexloggertest";

    // Event log tag used for SNET related events
    private static final int SNET_TAG = 0x534e4554;
    // Subtag used to distinguish dynamic code loading events
    private static final String DCL_SUBTAG = "dcl";

    // Obtained via "echo -n copied.jar | sha256sum"
@@ -77,7 +77,8 @@ public final class DexLoggerIntegrationTests {

        // Copy the jar from our Java resources to a private data directory
        File privateCopy = new File(context.getDir("jars", Context.MODE_PRIVATE), "copied.jar");
        try (InputStream input = DexLoggerIntegrationTests.class.getResourceAsStream("/javalib.jar");
        Class<?> thisClass = DexLoggerIntegrationTests.class;
        try (InputStream input = thisClass.getResourceAsStream("/javalib.jar");
                OutputStream output = new FileOutputStream(privateCopy)) {
            byte[] buffer = new byte[1024];
            while (true) {
@@ -112,7 +113,8 @@ public final class DexLoggerIntegrationTests {

        // There may already be events in the event log - figure out the most recent one
        EventLog.readEvents(tagList, events);
        long previousEventNanos = events.isEmpty() ? 0 : events.get(events.size() - 1).getTimeNanos();
        long previousEventNanos =
                events.isEmpty() ? 0 : events.get(events.size() - 1).getTimeNanos();
        events.clear();

        Process process = Runtime.getRuntime().exec(