Fix parallelNoCache perf test

This change catches exceptions while parsing and ensures that we add
something to the queue being analyzed, else we block until timeout for
each failure for each iteration leading to test timeouts on devices with
APKs that won't parse (some for expected reasons).

Fixes: 179430570
Test: atest PackageParsingPerfTest
Change-Id: I5287c48a8fa54cd44cf8b7433f8bb2536a3743b3
diff --git a/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt b/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
index d5ed95f..90dca25 100644
--- a/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
+++ b/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
@@ -159,7 +159,15 @@
             PARALLEL_MAX_THREADS, "package-parsing-test",
             Process.THREAD_PRIORITY_FOREGROUND)
 
-        fun submit(file: File) = service.submit { queue.put(parse(file)) }
+        fun submit(file: File) {
+                service.submit {
+                    try {
+                        queue.put(parse(file))
+                    } catch (e: Exception) {
+                        queue.put(e)
+                    }
+                }
+        }
 
         fun take() = queue.poll(QUEUE_POLL_TIMEOUT_SECONDS, TimeUnit.SECONDS)