HalManifest::checkIncompatibleHals uses instances API.

Now that <hal> is not the smallest unit of a manifest,
the compatibility check logic is updated accordingly.

Test: libvintf_test
Test: vintf_object_test
Bug: 73556059

Change-Id: Ief73afc61bace0dcc3d02410c16c7e261fa63315
diff --git a/ManifestHal.cpp b/ManifestHal.cpp
index 7d687fc..cd30f16 100644
--- a/ManifestHal.cpp
+++ b/ManifestHal.cpp
@@ -75,5 +75,13 @@
     return !hasInstance;
 }
 
+void ManifestHal::appendAllVersions(std::set<Version>* ret) const {
+    ret->insert(versions.begin(), versions.end());
+    forEachInstance([&](const auto& e) {
+        ret->insert(e.version());
+        return true;
+    });
+}
+
 } // namespace vintf
 } // namespace android