diff options
Diffstat (limited to 'install.cpp')
-rw-r--r-- | install.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/install.cpp b/install.cpp index 73ddf5e9..e5a59b83 100644 --- a/install.cpp +++ b/install.cpp | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <android-base/properties.h> | 44 | #include <android-base/properties.h> |
45 | #include <android-base/stringprintf.h> | 45 | #include <android-base/stringprintf.h> |
46 | #include <android-base/strings.h> | 46 | #include <android-base/strings.h> |
47 | #include <vintf/VintfObjectRecovery.h> | ||
47 | #include <ziparchive/zip_archive.h> | 48 | #include <ziparchive/zip_archive.h> |
48 | 49 | ||
49 | #include "common.h" | 50 | #include "common.h" |
@@ -535,10 +536,15 @@ bool verify_package_compatibility(ZipArchiveHandle package_zip) { | |||
535 | } | 536 | } |
536 | CloseArchive(zip_handle); | 537 | CloseArchive(zip_handle); |
537 | 538 | ||
538 | // TODO(b/36814503): Enable the actual verification when VintfObject::CheckCompatibility() lands. | 539 | // VintfObjectRecovery::CheckCompatibility returns zero on success. |
539 | // VintfObject::CheckCompatibility returns zero on success. | 540 | std::string err; |
540 | // return (android::vintf::VintfObject::CheckCompatibility(compatibility_info, true) == 0); | 541 | int result = android::vintf::VintfObjectRecovery::CheckCompatibility(compatibility_info, &err); |
541 | return true; | 542 | if (result == 0) { |
543 | return true; | ||
544 | } | ||
545 | |||
546 | LOG(ERROR) << "Failed to verify package compatibility (result " << result << "): " << err; | ||
547 | return false; | ||
542 | } | 548 | } |
543 | 549 | ||
544 | static int | 550 | static int |
@@ -590,7 +596,6 @@ really_install_package(const char *path, bool* wipe_cache, bool needs_mount, | |||
590 | 596 | ||
591 | // Additionally verify the compatibility of the package. | 597 | // Additionally verify the compatibility of the package. |
592 | if (!verify_package_compatibility(zip)) { | 598 | if (!verify_package_compatibility(zip)) { |
593 | LOG(ERROR) << "Failed to verify package compatibility"; | ||
594 | log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure)); | 599 | log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure)); |
595 | sysReleaseMap(&map); | 600 | sysReleaseMap(&map); |
596 | CloseArchive(zip); | 601 | CloseArchive(zip); |