Merge "Reland^2 "hash checks ensure package is consistent""
diff --git a/Coordinator.cpp b/Coordinator.cpp
index bd46667..9c7c13f 100644
--- a/Coordinator.cpp
+++ b/Coordinator.cpp
@@ -872,6 +872,10 @@
     std::set<FQName> imported;
     ast->getImportedPackages(&imported);
 
+    // consider current package as dependency for types.hal and also to make
+    // sure that if anything is frozen in a package, everything is.
+    imported.insert(fqName.getPackageAndVersion());
+
     // no circular dependency is already guaranteed by parsing
     // indirect dependencies will be checked when the imported interface frozen checks are done
     for (const FQName& importedPackage : imported) {
@@ -921,7 +925,7 @@
 
                 if (!unfrozenDependencies.empty()) {
                     std::cerr << "ERROR: Frozen interface " << currentFQName.string()
-                              << " cannot depend on unfrozen thing(s):" << std::endl;
+                              << " cannot depend or be adjacent to unfrozen thing(s):" << std::endl;
                     for (const FQName& name : unfrozenDependencies) {
                         std::cerr << " (unfrozen) " << name.string() << std::endl;
                     }
diff --git a/test/hash_test/Android.bp b/test/hash_test/Android.bp
index 3a1db9f..b1decbe 100644
--- a/test/hash_test/Android.bp
+++ b/test/hash_test/Android.bp
@@ -10,7 +10,7 @@
         "&&" +
         "!($(location hidl-gen) -F -L check " +
         "    -r android.hidl:system/libhidl/transport" +
-        "    -r test.hash:system/tools/hidl/test/hash_test/correct_hash" +
+        "    -r test.hash:system/tools/hidl/test/hash_test/missing_hash" +
         "    test.hash.hash@1.0 2> /dev/null)" +
         "&&" +
         "!($(location hidl-gen) -L check " +
@@ -29,9 +29,9 @@
     srcs: [
         "correct_hash/current.txt",
         "correct_hash/hash/1.0/IHash.hal",
-        "correct_hash/hash/1.0/IUnhashed.hal",
         "incorrect_hash/current.txt",
         "incorrect_hash/hash/1.0/IHash.hal",
+        "missing_hash/hash/1.0/IUnhashed.hal",
     ],
 }
 
diff --git a/test/hash_test/correct_hash/hash/1.0/IUnhashed.hal b/test/hash_test/missing_hash/hash/1.0/IUnhashed.hal
similarity index 100%
rename from test/hash_test/correct_hash/hash/1.0/IUnhashed.hal
rename to test/hash_test/missing_hash/hash/1.0/IUnhashed.hal