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

Commit fa19162a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Starting querying logcat events 1 min before start of the gesture" into ub-launcher3-master

parents 5f8c9a4e 05f3a21f
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1249,13 +1249,14 @@ public final class LauncherInstrumentation {
    private Map<String, List<String>> getEvents() {
        final Map<String, List<String>> events = new HashMap<>();
        try {
            // Logcat may skip events after the specified time. Querying for events starting 1 sec
            // Logcat may skip events after the specified time. Querying for events starting 1 min
            // earlier.
            final Date startTime = new Date(mStartRecordingTime.getTime() - 10000);
            final String logcatEvents = mDevice.executeShellCommand(
                    "logcat -d -v year --pid=" + getPid() + " -t "
            final Date startTime = new Date(mStartRecordingTime.getTime() - 60000);
            final String logcatCommand = "logcat -d -v year --pid=" + getPid() + " -t "
                    + DATE_TIME_FORMAT.format(startTime).replaceAll(" ", "")
                            + " -s " + TestProtocol.TAPL_EVENTS_TAG);
                    + " -s " + TestProtocol.TAPL_EVENTS_TAG;
            log("Events query command: " + logcatCommand);
            final String logcatEvents = mDevice.executeShellCommand(logcatCommand);
            final Matcher matcher = EVENT_LOG_ENTRY.matcher(logcatEvents);
            while (matcher.find()) {
                // Skip events before recording start time.