NoReadLogsPermissionTest: Fix false positives.

Logcat will print lines like:

  * --------- beginning of /dev/log/main
  * --------- beginning of /dev/log/system

even if no messages match the allowed pattern. These messages cause
this CTS test to fail inappropriately.

Fix the test.

Bug: 6298070
Change-Id: I9361b22621e163ddae58f54ca74be8d5e9bfa9a9
diff --git a/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
index 32f231b..2e09a49 100644
--- a/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
@@ -50,8 +50,11 @@
             reader = new BufferedReader(new InputStreamReader(logcatProc.getInputStream()));
 
             int lineCt = 0;
-            while (reader.readLine() != null) {
-                lineCt++;
+            String line;
+            while ((line = reader.readLine()) != null) {
+                if (!line.startsWith("--------- beginning of /dev/log")) {
+                    lineCt++;
+                }
             }
 
             // no permission get an empty log buffer.
@@ -60,7 +63,7 @@
 
             assertEquals("Unexpected logcat entries. Are you running the "
                        + "the latest logger.c from the Android kernel?",
-                    1, lineCt);
+                    0, lineCt);
 
         } finally {
             if (reader != null) {