aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-04-19 01:54:29 -0500
committerTao Bao2017-05-01 23:51:54 -0500
commitb656a154ea497c1a179079f082b0a0701453bec5 (patch)
tree8e47eb4eab95da0b23a2372f1af34c2f932e9905 /install.cpp
parentba365180d3c09e81f584004ec10eaf49af5d6cc4 (diff)
downloadplatform-bootable-recovery-b656a154ea497c1a179079f082b0a0701453bec5.tar.gz
platform-bootable-recovery-b656a154ea497c1a179079f082b0a0701453bec5.tar.xz
platform-bootable-recovery-b656a154ea497c1a179079f082b0a0701453bec5.zip
Move sysMapFile and sysReleaseMap into MemMapping class.
Test: recovery_component_test Test: recovery_unit_test Test: Apply an OTA on angler. Change-Id: I7170f03e4ce1fe06184ca1d7bcce0a695f33ac4d
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/install.cpp b/install.cpp
index d86f46ca..689f4a0c 100644
--- a/install.cpp
+++ b/install.cpp
@@ -569,7 +569,7 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
569 } 569 }
570 570
571 MemMapping map; 571 MemMapping map;
572 if (sysMapFile(path.c_str(), &map) != 0) { 572 if (!map.MapFile(path)) {
573 LOG(ERROR) << "failed to map file"; 573 LOG(ERROR) << "failed to map file";
574 return INSTALL_CORRUPT; 574 return INSTALL_CORRUPT;
575 } 575 }
@@ -577,7 +577,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
577 // Verify package. 577 // Verify package.
578 if (!verify_package(map.addr, map.length)) { 578 if (!verify_package(map.addr, map.length)) {
579 log_buffer->push_back(android::base::StringPrintf("error: %d", kZipVerificationFailure)); 579 log_buffer->push_back(android::base::StringPrintf("error: %d", kZipVerificationFailure));
580 sysReleaseMap(&map);
581 return INSTALL_CORRUPT; 580 return INSTALL_CORRUPT;
582 } 581 }
583 582
@@ -588,7 +587,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
588 LOG(ERROR) << "Can't open " << path << " : " << ErrorCodeString(err); 587 LOG(ERROR) << "Can't open " << path << " : " << ErrorCodeString(err);
589 log_buffer->push_back(android::base::StringPrintf("error: %d", kZipOpenFailure)); 588 log_buffer->push_back(android::base::StringPrintf("error: %d", kZipOpenFailure));
590 589
591 sysReleaseMap(&map);
592 CloseArchive(zip); 590 CloseArchive(zip);
593 return INSTALL_CORRUPT; 591 return INSTALL_CORRUPT;
594 } 592 }
@@ -596,7 +594,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
596 // Additionally verify the compatibility of the package. 594 // Additionally verify the compatibility of the package.
597 if (!verify_package_compatibility(zip)) { 595 if (!verify_package_compatibility(zip)) {
598 log_buffer->push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure)); 596 log_buffer->push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure));
599 sysReleaseMap(&map);
600 CloseArchive(zip); 597 CloseArchive(zip);
601 return INSTALL_CORRUPT; 598 return INSTALL_CORRUPT;
602 } 599 }
@@ -611,7 +608,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
611 ui->SetEnableReboot(true); 608 ui->SetEnableReboot(true);
612 ui->Print("\n"); 609 ui->Print("\n");
613 610
614 sysReleaseMap(&map);
615 CloseArchive(zip); 611 CloseArchive(zip);
616 return result; 612 return result;
617} 613}