Merge "Fix test failure when checking if model is supported"
diff --git a/src/com/android/nn/benchmark/core/Processor.java b/src/com/android/nn/benchmark/core/Processor.java
index c92a512..e74084c 100644
--- a/src/com/android/nn/benchmark/core/Processor.java
+++ b/src/com/android/nn/benchmark/core/Processor.java
@@ -133,6 +133,14 @@
                     String.format("Error trying to check support for model %s on accelerator %s",
                             testModelEntry.mModelName, acceleratorName), e);
             return false;
+        }  catch (NnApiDelegationFailure nnApiDelegationFailure) {
+            if (nnApiDelegationFailure.getNnApiErrno() == 4 /*ANEURALNETWORKS_BAD_DATA*/) {
+                // Compilation will fail with ANEURALNETWORKS_BAD_DATA if the device is not
+                // supporting all operation in the model
+                return false;
+            }
+
+            throw nnApiDelegationFailure;
         }
     }