aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/install.cpp b/install.cpp
index 95794ce0..2a647b1a 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"
@@ -539,10 +540,15 @@ bool verify_package_compatibility(ZipArchiveHandle package_zip) {
539 } 540 }
540 CloseArchive(zip_handle); 541 CloseArchive(zip_handle);
541 542
542 // TODO(b/36814503): Enable the actual verification when VintfObject::CheckCompatibility() lands. 543 // VintfObjectRecovery::CheckCompatibility returns zero on success.
543 // VintfObject::CheckCompatibility returns zero on success. 544 std::string err;
544 // return (android::vintf::VintfObject::CheckCompatibility(compatibility_info, true) == 0); 545 int result = android::vintf::VintfObjectRecovery::CheckCompatibility(compatibility_info, &err);
545 return true; 546 if (result == 0) {
547 return true;
548 }
549
550 LOG(ERROR) << "Failed to verify package compatibility (result " << result << "): " << err;
551 return false;
546} 552}
547 553
548static int 554static int
@@ -594,7 +600,6 @@ really_install_package(const char *path, bool* wipe_cache, bool needs_mount,
594 600
595 // Additionally verify the compatibility of the package. 601 // Additionally verify the compatibility of the package.
596 if (!verify_package_compatibility(zip)) { 602 if (!verify_package_compatibility(zip)) {
597 LOG(ERROR) << "Failed to verify package compatibility";
598 log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure)); 603 log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure));
599 sysReleaseMap(&map); 604 sysReleaseMap(&map);
600 CloseArchive(zip); 605 CloseArchive(zip);