Make operation validation return Result<Version>

Bug: N/A
Test: mma
Test: NeuralNetworksTest_static
Change-Id: I47c12e13fcb41f832e31043b3f14e7b93472b0f8
Merged-In: I47c12e13fcb41f832e31043b3f14e7b93472b0f8
(cherry picked from commit 83378c27535b08cae50f6dedcd5485b379466279)
diff --git a/common/operations/BidirectionalSequenceRNN.cpp b/common/operations/BidirectionalSequenceRNN.cpp
index f6b4c30..5a020d1 100644
--- a/common/operations/BidirectionalSequenceRNN.cpp
+++ b/common/operations/BidirectionalSequenceRNN.cpp
@@ -313,7 +313,7 @@
 
 }  // namespace
 
-bool validate(const IOperationValidationContext* context) {
+Result<Version> validate(const IOperationValidationContext* context) {
     NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs);
     // Exact number is dependent on the mergeOutputs parameter and checked
     // during preparation.
@@ -323,9 +323,8 @@
 
     OperandType inputType = context->getInputType(kInputTensor);
     if (inputType != OperandType::TENSOR_FLOAT16 && inputType != OperandType::TENSOR_FLOAT32) {
-        LOG(ERROR) << "Unsupported input operand type for UNIDIRECTIONAL_SEQUENCE_RNN op: "
-                   << inputType;
-        return false;
+        return NN_ERROR() << "Unsupported input operand type for UNIDIRECTIONAL_SEQUENCE_RNN op: "
+                          << inputType;
     }
     NN_RET_CHECK(validateInputTypes(
             context, {inputType, inputType, inputType, inputType, inputType, inputType, inputType,
@@ -339,7 +338,7 @@
     if (numOutputs == kNumOutputsWithState || numOutputs == kNumOutputsMergedWithState) {
         minSupportedVersion = Version::ANDROID_R;
     }
-    return validateVersion(context, minSupportedVersion);
+    return minSupportedVersion;
 }
 
 bool prepare(IOperationExecutionContext* context) {