VintfObject.GetFrameworkManifest reads legacy dir

gsi_util compiles with P libvintf but are operated
on O / O-MR1 vendor image. Hence VintfObject needs to
read legacy dir as well.

Test: vintf_object_test
Bug: 72722951
Change-Id: I4b09f7fe590727f49f26adfce7780038bd8d2dd5
diff --git a/VintfObject.cpp b/VintfObject.cpp
index c66011b..9f3a176 100644
--- a/VintfObject.cpp
+++ b/VintfObject.cpp
@@ -81,8 +81,7 @@
 // static
 std::shared_ptr<const HalManifest> VintfObject::GetFrameworkHalManifest(bool skipCache) {
     static LockedSharedPtr<HalManifest> gFrameworkManifest;
-    return Get(&gFrameworkManifest, skipCache,
-               std::bind(&HalManifest::fetchAllInformation, _1, kSystemManifest, _2));
+    return Get(&gFrameworkManifest, skipCache, &VintfObject::FetchFrameworkHalManifest);
 }
 
 
@@ -273,6 +272,15 @@
     return out->fetchAllInformation(kVendorLegacyMatrix, error);
 }
 
+status_t VintfObject::FetchFrameworkHalManifest(HalManifest* out, std::string* error) {
+    HalManifest etcManifest;
+    if (etcManifest.fetchAllInformation(kSystemManifest, error) == OK) {
+        *out = std::move(etcManifest);
+        return OK;
+    }
+    return out->fetchAllInformation(kSystemLegacyManifest, error);
+}
+
 std::vector<Named<CompatibilityMatrix>> VintfObject::GetAllFrameworkMatrixLevels(
     std::string* error) {
     std::vector<std::string> fileNames;
@@ -547,6 +555,7 @@
 
 const std::string kVendorLegacyManifest = "/vendor/manifest.xml";
 const std::string kVendorLegacyMatrix = "/vendor/compatibility_matrix.xml";
+const std::string kSystemLegacyManifest = "/system/manifest.xml";
 const std::string kSystemLegacyMatrix = "/system/compatibility_matrix.xml";
 const std::string kOdmLegacyVintfDir = "/odm/etc/";
 const std::string kOdmLegacyManifest = kOdmLegacyVintfDir + "manifest.xml";