Support loading /odm/manifest_${ro.product.model}.xml

Bug: 65032103
Test: vendor manifest still loaded properly
Test: vintf_object_test + libvintf_test
Change-Id: Ida6e50bcce471ebb561f8b24e19e7fddf631b126
diff --git a/VintfObject.cpp b/VintfObject.cpp
index 9dea4d9..efe6242 100644
--- a/VintfObject.cpp
+++ b/VintfObject.cpp
@@ -24,6 +24,10 @@
 #include <memory>
 #include <mutex>
 
+#ifdef LIBVINTF_TARGET
+#include <android-base/properties.h>
+#endif
+
 namespace android {
 namespace vintf {
 
@@ -58,10 +62,25 @@
 std::shared_ptr<const HalManifest> VintfObject::GetDeviceHalManifest(bool skipCache) {
     static LockedSharedPtr<HalManifest> gVendorManifest;
     static LockedSharedPtr<HalManifest> gOdmManifest;
+#ifdef LIBVINTF_TARGET
+    static LockedSharedPtr<HalManifest> gProductManifest;
+#endif
     static std::mutex gDeviceManifestMutex;
 
     std::unique_lock<std::mutex> _lock(gDeviceManifestMutex);
 
+#ifdef LIBVINTF_TARGET
+    std::string productModel = android::base::GetProperty("ro.product.model", "");
+    if (!productModel.empty()) {
+        auto product = Get(&gProductManifest, skipCache,
+                           std::bind(&HalManifest::fetchAllInformation, std::placeholders::_1,
+                                     "/odm/manifest_" + productModel + ".xml"));
+        if (product != nullptr) {
+            return product;
+        }
+    }
+#endif
+
     auto odm = Get(
         &gOdmManifest, skipCache,
         std::bind(&HalManifest::fetchAllInformation, std::placeholders::_1, "/odm/manifest.xml"));