diff options
author | Yifan Hong | 2018-01-18 20:57:52 -0600 |
---|---|---|
committer | Yifan Hong | 2018-01-19 13:17:55 -0600 |
commit | b64ec9e960bc1204e6794e0083c2145f1f043abf (patch) | |
tree | 01c8b04fbaa4b9eaf986dd35830d41f357b54c7c /VintfObject.cpp | |
parent | a5ddddfcbf12ae14c560ca4a32d56093e8374efc (diff) | |
download | platform-system-libvintf-b64ec9e960bc1204e6794e0083c2145f1f043abf.tar.gz platform-system-libvintf-b64ec9e960bc1204e6794e0083c2145f1f043abf.tar.xz platform-system-libvintf-b64ec9e960bc1204e6794e0083c2145f1f043abf.zip |
VintfObject: load /vendor/etc/vintf/cm.xml before /vendor/cm.xml
cm => compatibility_matrix
Test: vintf_object_test
Bug: 36790901
Change-Id: Id62cbd1a2a7612c0fbf15adce39dbef67a4c18a8
Diffstat (limited to 'VintfObject.cpp')
-rw-r--r-- | VintfObject.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/VintfObject.cpp b/VintfObject.cpp index 4a3e235..b852665 100644 --- a/VintfObject.cpp +++ b/VintfObject.cpp | |||
@@ -88,8 +88,7 @@ std::shared_ptr<const HalManifest> VintfObject::GetFrameworkHalManifest(bool ski | |||
88 | // static | 88 | // static |
89 | std::shared_ptr<const CompatibilityMatrix> VintfObject::GetDeviceCompatibilityMatrix(bool skipCache) { | 89 | std::shared_ptr<const CompatibilityMatrix> VintfObject::GetDeviceCompatibilityMatrix(bool skipCache) { |
90 | static LockedSharedPtr<CompatibilityMatrix> gDeviceMatrix; | 90 | static LockedSharedPtr<CompatibilityMatrix> gDeviceMatrix; |
91 | return Get(&gDeviceMatrix, skipCache, | 91 | return Get(&gDeviceMatrix, skipCache, &VintfObject::FetchDeviceMatrix); |
92 | std::bind(&CompatibilityMatrix::fetchAllInformation, _1, kVendorLegacyMatrix, _2)); | ||
93 | } | 92 | } |
94 | 93 | ||
95 | // static | 94 | // static |
@@ -234,6 +233,15 @@ status_t VintfObject::FetchDeviceHalManifest(HalManifest* out, std::string* erro | |||
234 | return out->fetchAllInformation(kVendorLegacyManifest, error); | 233 | return out->fetchAllInformation(kVendorLegacyManifest, error); |
235 | } | 234 | } |
236 | 235 | ||
236 | status_t VintfObject::FetchDeviceMatrix(CompatibilityMatrix* out, std::string* error) { | ||
237 | CompatibilityMatrix etcMatrix; | ||
238 | if (etcMatrix.fetchAllInformation(kVendorMatrix, error) == OK) { | ||
239 | *out = std::move(etcMatrix); | ||
240 | return OK; | ||
241 | } | ||
242 | return out->fetchAllInformation(kVendorLegacyMatrix, error); | ||
243 | } | ||
244 | |||
237 | std::vector<Named<CompatibilityMatrix>> VintfObject::GetAllFrameworkMatrixLevels( | 245 | std::vector<Named<CompatibilityMatrix>> VintfObject::GetAllFrameworkMatrixLevels( |
238 | std::string* error) { | 246 | std::string* error) { |
239 | std::vector<std::string> fileNames; | 247 | std::vector<std::string> fileNames; |
@@ -510,6 +518,7 @@ const std::string kVendorVintfDir = "/vendor/etc/vintf/"; | |||
510 | 518 | ||
511 | const std::string kVendorManifest = kVendorVintfDir + "manifest.xml"; | 519 | const std::string kVendorManifest = kVendorVintfDir + "manifest.xml"; |
512 | const std::string kSystemManifest = kSystemVintfDir + "manifest.xml"; | 520 | const std::string kSystemManifest = kSystemVintfDir + "manifest.xml"; |
521 | const std::string kVendorMatrix = kVendorVintfDir + "compatibility_matrix.xml"; | ||
513 | 522 | ||
514 | const std::string kVendorLegacyManifest = "/vendor/manifest.xml"; | 523 | const std::string kVendorLegacyManifest = "/vendor/manifest.xml"; |
515 | const std::string kVendorLegacyMatrix = "/vendor/compatibility_matrix.xml"; | 524 | const std::string kVendorLegacyMatrix = "/vendor/compatibility_matrix.xml"; |