Fix SeedTest

Bug 6158369

Only check that the events sent by monkey are the same. The test
was failing when it got a "// Rejected intent..." notice on the
first run but not the second run despite all the events being
the same.

Change-Id: I726faaa5ad8ebe15e798b1077f90dbc45d72002a
diff --git a/tests/appsecurity-tests/src/com/android/cts/monkey/SeedTest.java b/tests/appsecurity-tests/src/com/android/cts/monkey/SeedTest.java
index 062fb7d..4f8f842 100644
--- a/tests/appsecurity-tests/src/com/android/cts/monkey/SeedTest.java
+++ b/tests/appsecurity-tests/src/com/android/cts/monkey/SeedTest.java
@@ -35,19 +35,27 @@
     private void assertOutputs(String out1, String out2) {
         Scanner s1 = new Scanner(out1);
         Scanner s2 = new Scanner(out2);
-        while (s1.hasNextLine()) {
-            assertTrue(s2.hasNextLine());
-
-            String line1 = s1.nextLine().trim();
-            String line2 = s2.nextLine().trim();
-
-            if (line1.startsWith("//[calendar_time") || line1.startsWith("## Network stats")) {
-                // Skip these lines since they have timestamps.
-                continue;
+        int numEvents = 0;
+        while (true) {
+            String line1 = getNextLine(s1);
+            String line2 = getNextLine(s2);
+            if (line1 != null || line2 != null) {
+                assertEquals(line1, line2);
+                numEvents++;
+            } else {
+                break;
             }
-
-            assertEquals(line1, line2);
         }
-        assertFalse(s2.hasNextLine());
+        assertTrue(numEvents > 0);
+    }
+
+    private String getNextLine(Scanner sc) {
+        while (sc.hasNextLine()) {
+            String line = sc.nextLine().trim();
+            if (line.startsWith(":Sending")) {
+                return line;
+            }
+        }
+        return null;
     }
 }