From 032403fb75a4d423c0855ea278b0441287904a82 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 18 Mar 2019 13:22:50 -0700 Subject: Skip calling verify_package_compatibility when resuming. android::vintf::VintfObjectRecovery::CheckCompatibility() may try to mount partitions in order to read the needed files, which may not be feasible when resuming an interrupted update. This CL changes the logic to enforce compatibility check on fresh install only. Fix: 122864541 Test: Sideloading on taimen keeps working. Test: Sideload a package by setting the retry bit. Check that compatibility check is skipped. Change-Id: I018a0c802c85a0e84a6f2aac50630a677d64382a --- install.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.cpp b/install.cpp index 05f9af7a4..dbc815d47 100644 --- a/install.cpp +++ b/install.cpp @@ -606,8 +606,8 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo return INSTALL_CORRUPT; } - // Additionally verify the compatibility of the package. - if (!verify_package_compatibility(zip)) { + // Additionally verify the compatibility of the package if it's a fresh install. + if (retry_count == 0 && !verify_package_compatibility(zip)) { log_buffer->push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure)); return INSTALL_CORRUPT; } -- cgit v1.2.3