summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot2018-01-11 03:24:55 -0600
committerandroid-build-team Robot2018-01-11 03:24:55 -0600
commiteaffd4a2a652305877545cc8d8c46d5e25b0ad3e (patch)
treed1d7d00d204934d877800979e59f427a66af9377
parentb2d2f8a69fcac60e0c7dfabdc388de28ed63cdf1 (diff)
parente29530445eb82c1a0822a96002c1d46e5db78393 (diff)
downloadplatform-system-libvintf-eaffd4a2a652305877545cc8d8c46d5e25b0ad3e.tar.gz
platform-system-libvintf-eaffd4a2a652305877545cc8d8c46d5e25b0ad3e.tar.xz
platform-system-libvintf-eaffd4a2a652305877545cc8d8c46d5e25b0ad3e.zip
Snap for 4539010 from e29530445eb82c1a0822a96002c1d46e5db78393 to pi-release
Change-Id: I32ea33be771d66d03dba49b935081ff326727b30
-rw-r--r--VintfObject.cpp6
-rw-r--r--test/vintf_object_tests.cpp33
2 files changed, 20 insertions, 19 deletions
diff --git a/VintfObject.cpp b/VintfObject.cpp
index a49fc24..8dd08ef 100644
--- a/VintfObject.cpp
+++ b/VintfObject.cpp
@@ -79,11 +79,11 @@ std::shared_ptr<const HalManifest> VintfObject::GetDeviceHalManifest(bool skipCa
79 std::unique_lock<std::mutex> _lock(gDeviceManifestMutex); 79 std::unique_lock<std::mutex> _lock(gDeviceManifestMutex);
80 80
81#ifdef LIBVINTF_TARGET 81#ifdef LIBVINTF_TARGET
82 std::string productModel = android::base::GetProperty("ro.product.model", ""); 82 std::string productModel = android::base::GetProperty("ro.boot.product.hardware.sku", "");
83 if (!productModel.empty()) { 83 if (!productModel.empty()) {
84 auto product = Get(&gProductManifest, skipCache, 84 auto product = Get(&gProductManifest, skipCache,
85 std::bind(&HalManifest::fetchAllInformation, _1, 85 std::bind(&HalManifest::fetchAllInformation, _1,
86 "/odm/manifest_" + productModel + ".xml", _2)); 86 "/odm/etc/manifest_" + productModel + ".xml", _2));
87 if (product != nullptr) { 87 if (product != nullptr) {
88 return product; 88 return product;
89 } 89 }
@@ -91,7 +91,7 @@ std::shared_ptr<const HalManifest> VintfObject::GetDeviceHalManifest(bool skipCa
91#endif 91#endif
92 92
93 auto odm = Get(&gOdmManifest, skipCache, 93 auto odm = Get(&gOdmManifest, skipCache,
94 std::bind(&HalManifest::fetchAllInformation, _1, "/odm/manifest.xml", _2)); 94 std::bind(&HalManifest::fetchAllInformation, _1, "/odm/etc/manifest.xml", _2));
95 if (odm != nullptr) { 95 if (odm != nullptr) {
96 return odm; 96 return odm;
97 } 97 }
diff --git a/test/vintf_object_tests.cpp b/test/vintf_object_tests.cpp
index 3033dfe..61eb4df 100644
--- a/test/vintf_object_tests.cpp
+++ b/test/vintf_object_tests.cpp
@@ -175,10 +175,10 @@ void setupMockFetcher(const std::string& vendorManifestXml, const std::string& s
175 MockFileFetcher* fetcher = static_cast<MockFileFetcher*>(gFetcher); 175 MockFileFetcher* fetcher = static_cast<MockFileFetcher*>(gFetcher);
176 176
177 if (!productModel.empty()) { 177 if (!productModel.empty()) {
178 ON_CALL(*fetcher, fetch(StrEq("/odm/manifest_" + productModel + ".xml"), _)) 178 ON_CALL(*fetcher, fetch(StrEq("/odm/etc/manifest_" + productModel + ".xml"), _))
179 .WillByDefault(Return(::android::NAME_NOT_FOUND)); 179 .WillByDefault(Return(::android::NAME_NOT_FOUND));
180 } 180 }
181 ON_CALL(*fetcher, fetch(StrEq("/odm/manifest.xml"), _)) 181 ON_CALL(*fetcher, fetch(StrEq("/odm/etc/manifest.xml"), _))
182 .WillByDefault(Return(::android::NAME_NOT_FOUND)); 182 .WillByDefault(Return(::android::NAME_NOT_FOUND));
183 ON_CALL(*fetcher, fetch(StrEq("/vendor/manifest.xml"), _)) 183 ON_CALL(*fetcher, fetch(StrEq("/vendor/manifest.xml"), _))
184 .WillByDefault(Invoke([vendorManifestXml](const std::string& path, std::string& fetched) { 184 .WillByDefault(Invoke([vendorManifestXml](const std::string& path, std::string& fetched) {
@@ -218,7 +218,7 @@ class VintfObjectCompatibleTest : public testing::Test {
218 virtual void SetUp() { 218 virtual void SetUp() {
219 mounter().reset(); 219 mounter().reset();
220#ifdef LIBVINTF_TARGET 220#ifdef LIBVINTF_TARGET
221 productModel = android::base::GetProperty("ro.product.model", ""); 221 productModel = android::base::GetProperty("ro.boot.product.hardware.sku", "");
222#endif 222#endif
223 setupMockFetcher(vendorManifestXml1, systemMatrixXml1, systemManifestXml1, vendorMatrixXml1, 223 setupMockFetcher(vendorManifestXml1, systemMatrixXml1, systemManifestXml1, vendorMatrixXml1,
224 productModel); 224 productModel);
@@ -236,9 +236,9 @@ TEST_F(VintfObjectCompatibleTest, TestDeviceCompatibility) {
236 std::vector<std::string> packageInfo; 236 std::vector<std::string> packageInfo;
237 237
238 if (!productModel.empty()) { 238 if (!productModel.empty()) {
239 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest_" + productModel + ".xml"), _)); 239 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest_" + productModel + ".xml"), _));
240 } 240 }
241 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest.xml"), _)); 241 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest.xml"), _));
242 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _)); 242 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _));
243 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)); 243 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _));
244 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _)); 244 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _));
@@ -279,9 +279,9 @@ TEST_F(VintfObjectCompatibleTest, TestInputVsDeviceSuccess) {
279 std::vector<std::string> packageInfo = {systemMatrixXml1}; 279 std::vector<std::string> packageInfo = {systemMatrixXml1};
280 280
281 if (!productModel.empty()) { 281 if (!productModel.empty()) {
282 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest_" + productModel + ".xml"), _)); 282 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest_" + productModel + ".xml"), _));
283 } 283 }
284 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest.xml"), _)); 284 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest.xml"), _));
285 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _)); 285 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _));
286 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)); 286 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _));
287 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _)); 287 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _));
@@ -344,9 +344,9 @@ TEST_F(VintfObjectCompatibleTest, TestFrameworkOnlyOta) {
344 std::vector<std::string> packageInfo = {systemMatrixXml1, systemManifestXml1}; 344 std::vector<std::string> packageInfo = {systemMatrixXml1, systemManifestXml1};
345 345
346 if (!productModel.empty()) { 346 if (!productModel.empty()) {
347 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest_" + productModel + ".xml"), _)); 347 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest_" + productModel + ".xml"), _));
348 } 348 }
349 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest.xml"), _)); 349 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest.xml"), _));
350 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _)); 350 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _));
351 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)).Times(0); 351 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)).Times(0);
352 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _)); 352 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _));
@@ -386,9 +386,10 @@ TEST_F(VintfObjectCompatibleTest, TestFullOta) {
386 vendorMatrixXml1, vendorManifestXml1}; 386 vendorMatrixXml1, vendorManifestXml1};
387 387
388 if (!productModel.empty()) { 388 if (!productModel.empty()) {
389 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest_" + productModel + ".xml"), _)).Times(0); 389 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest_" + productModel + ".xml"), _))
390 .Times(0);
390 } 391 }
391 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest.xml"), _)).Times(0); 392 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest.xml"), _)).Times(0);
392 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _)).Times(0); 393 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _)).Times(0);
393 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)).Times(0); 394 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)).Times(0);
394 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _)).Times(0); 395 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _)).Times(0);
@@ -429,7 +430,7 @@ class VintfObjectIncompatibleTest : public testing::Test {
429 virtual void SetUp() { 430 virtual void SetUp() {
430 mounter().reset(); 431 mounter().reset();
431#ifdef LIBVINTF_TARGET 432#ifdef LIBVINTF_TARGET
432 productModel = android::base::GetProperty("ro.product.model", ""); 433 productModel = android::base::GetProperty("ro.boot.product.hardware.sku", "");
433#endif 434#endif
434 setupMockFetcher(vendorManifestXml1, systemMatrixXml2, systemManifestXml1, vendorMatrixXml1, 435 setupMockFetcher(vendorManifestXml1, systemMatrixXml2, systemManifestXml1, vendorMatrixXml1,
435 productModel); 436 productModel);
@@ -447,9 +448,9 @@ TEST_F(VintfObjectIncompatibleTest, TestDeviceCompatibility) {
447 std::vector<std::string> packageInfo; 448 std::vector<std::string> packageInfo;
448 449
449 if (!productModel.empty()) { 450 if (!productModel.empty()) {
450 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest_" + productModel + ".xml"), _)); 451 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest_" + productModel + ".xml"), _));
451 } 452 }
452 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest.xml"), _)); 453 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest.xml"), _));
453 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _)); 454 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _));
454 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)); 455 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _));
455 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _)); 456 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _));
@@ -466,9 +467,9 @@ TEST_F(VintfObjectIncompatibleTest, TestInputVsDeviceSuccess) {
466 std::vector<std::string> packageInfo = {systemMatrixXml1}; 467 std::vector<std::string> packageInfo = {systemMatrixXml1};
467 468
468 if (!productModel.empty()) { 469 if (!productModel.empty()) {
469 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest_" + productModel + ".xml"), _)); 470 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest_" + productModel + ".xml"), _));
470 } 471 }
471 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/manifest.xml"), _)); 472 EXPECT_CALL(fetcher(), fetch(StrEq("/odm/etc/manifest.xml"), _));
472 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _)); 473 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/manifest.xml"), _));
473 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _)); 474 EXPECT_CALL(fetcher(), fetch(StrEq("/system/manifest.xml"), _));
474 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _)); 475 EXPECT_CALL(fetcher(), fetch(StrEq("/vendor/compatibility_matrix.xml"), _));