Don't check hash while generating hash.

A common usecase of -Lhash is to add a new hash to
a current.txt file. However, doing so requires removing
old hashes which then must be re-added for correctness.

This is because hashes of released interfaces should never be
removed.

Here I've made it so that -Lhash will return a hash for
valid interfaces even if the hash fails. I've also added
this to hidl_hash_test.

Test: hidl_hash_test
Bug: 62858322
Change-Id: I840086ae59656c73c7109b20c142da27b47f80f8
diff --git a/AST.cpp b/AST.cpp
index cecdabd..2dfd7fa 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -116,7 +116,7 @@
 
         for (const auto &subFQName : packageInterfaces) {
             // Do not enforce restrictions on imports.
-            AST *ast = mCoordinator->parse(subFQName, &mImportedASTs, false /* enforce */);
+            AST* ast = mCoordinator->parse(subFQName, &mImportedASTs, Coordinator::Enforce::NONE);
             if (ast == nullptr) {
                 return false;
             }
@@ -135,7 +135,7 @@
     // assume it is an interface, and try to import it.
     const FQName interfaceName = fqName.getTopLevelType();
     // Do not enforce restrictions on imports.
-    importAST = mCoordinator->parse(interfaceName, &mImportedASTs, false /* enforce */);
+    importAST = mCoordinator->parse(interfaceName, &mImportedASTs, Coordinator::Enforce::NONE);
 
     if (importAST != nullptr) {
         // cases like android.hardware.foo@1.0::IFoo.Internal
@@ -165,7 +165,7 @@
     FQName typesFQName = fqName.getTypesForPackage();
 
     // Do not enforce restrictions on imports.
-    importAST = mCoordinator->parse(typesFQName, &mImportedASTs, false /* enforce */);
+    importAST = mCoordinator->parse(typesFQName, &mImportedASTs, Coordinator::Enforce::NONE);
 
     if (importAST != nullptr) {
         // Attempt to find Abc.Internal in types.
@@ -524,7 +524,7 @@
 void AST::getAllImportedNames(std::set<FQName> *allImportNames) const {
     for (const auto& name : mImportedNames) {
         allImportNames->insert(name);
-        AST *ast = mCoordinator->parse(name, nullptr /* imported */, false /* enforce */);
+        AST* ast = mCoordinator->parse(name, nullptr /* imported */, Coordinator::Enforce::NONE);
         ast->getAllImportedNames(allImportNames);
     }
 }