summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie <xunchang@google.com>2020-07-23 02:25:11 +0200
committerTianjie <xunchang@google.com>2020-07-23 22:07:24 +0200
commit1bc976a74ed26a5dcdbf9baef53e280f04eb272f (patch)
treea326338cf4a7522342327493e9c95c9ae9ca89ea
parentMerge "Add recovery support of dynamic fingerprints" (diff)
downloadandroid_bootable_recovery-1bc976a74ed26a5dcdbf9baef53e280f04eb272f.tar
android_bootable_recovery-1bc976a74ed26a5dcdbf9baef53e280f04eb272f.tar.gz
android_bootable_recovery-1bc976a74ed26a5dcdbf9baef53e280f04eb272f.tar.bz2
android_bootable_recovery-1bc976a74ed26a5dcdbf9baef53e280f04eb272f.tar.lz
android_bootable_recovery-1bc976a74ed26a5dcdbf9baef53e280f04eb272f.tar.xz
android_bootable_recovery-1bc976a74ed26a5dcdbf9baef53e280f04eb272f.tar.zst
android_bootable_recovery-1bc976a74ed26a5dcdbf9baef53e280f04eb272f.zip
-rw-r--r--otautil/include/otautil/error_code.h2
-rw-r--r--recovery.cpp12
-rw-r--r--tests/unit/host/imgdiff_test.cpp1
-rw-r--r--updater/commands.cpp3
4 files changed, 8 insertions, 10 deletions
diff --git a/otautil/include/otautil/error_code.h b/otautil/include/otautil/error_code.h
index 2b73c1353..7b52ce599 100644
--- a/otautil/include/otautil/error_code.h
+++ b/otautil/include/otautil/error_code.h
@@ -22,7 +22,7 @@ enum ErrorCode : int {
kLowBattery = 20,
kZipVerificationFailure,
kZipOpenFailure,
- kBootreasonInBlacklist,
+ kBootreasonInBlocklist,
kPackageCompatibilityFailure,
kScriptExecutionFailure,
kMapFileFailure,
diff --git a/recovery.cpp b/recovery.cpp
index f41ac6acf..d26424ab1 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -559,15 +559,15 @@ static void set_retry_bootloader_message(int retry_count, const std::vector<std:
}
}
-static bool bootreason_in_blacklist() {
+static bool bootreason_in_blocklist() {
std::string bootreason = android::base::GetProperty("ro.boot.bootreason", "");
if (!bootreason.empty()) {
// More bootreasons can be found in "system/core/bootstat/bootstat.cpp".
- static const std::vector<std::string> kBootreasonBlacklist{
+ static const std::vector<std::string> kBootreasonBlocklist{
"kernel_panic",
"Panic",
};
- for (const auto& str : kBootreasonBlacklist) {
+ for (const auto& str : kBootreasonBlocklist) {
if (android::base::EqualsIgnoreCase(str, bootreason)) return true;
}
}
@@ -734,10 +734,10 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
// Log the error code to last_install when installation skips due to low battery.
log_failure_code(kLowBattery, update_package);
status = INSTALL_SKIPPED;
- } else if (retry_count == 0 && bootreason_in_blacklist()) {
+ } else if (retry_count == 0 && bootreason_in_blocklist()) {
// Skip update-on-reboot when bootreason is kernel_panic or similar
- ui->Print("bootreason is in the blacklist; skip OTA installation\n");
- log_failure_code(kBootreasonInBlacklist, update_package);
+ ui->Print("bootreason is in the blocklist; skip OTA installation\n");
+ log_failure_code(kBootreasonInBlocklist, update_package);
status = INSTALL_SKIPPED;
} else {
// It's a fresh update. Initialize the retry_count in the BCB to 1; therefore we can later
diff --git a/tests/unit/host/imgdiff_test.cpp b/tests/unit/host/imgdiff_test.cpp
index e76ccbdfb..978ac7c2b 100644
--- a/tests/unit/host/imgdiff_test.cpp
+++ b/tests/unit/host/imgdiff_test.cpp
@@ -35,7 +35,6 @@
using android::base::get_unaligned;
-// Sanity check for the given imgdiff patch header.
static void verify_patch_header(const std::string& patch, size_t* num_normal, size_t* num_raw,
size_t* num_deflate) {
const size_t size = patch.size();
diff --git a/updater/commands.cpp b/updater/commands.cpp
index aed63369c..1a7c272b5 100644
--- a/updater/commands.cpp
+++ b/updater/commands.cpp
@@ -128,7 +128,6 @@ bool Command::ParseTargetInfoAndSourceInfo(const std::vector<std::string>& token
// No stashes, only source ranges.
SourceInfo result(src_hash, src_ranges, {}, {});
- // Sanity check the block count.
if (result.blocks() != src_blocks) {
*err =
android::base::StringPrintf("mismatching block count: %zu (%s) vs %zu", result.blocks(),
@@ -262,7 +261,7 @@ Command Command::Parse(const std::string& line, size_t index, std::string* err)
return {};
}
} else if (op == Type::ABORT) {
- // No-op, other than sanity checking the input args.
+ // Abort takes no arguments, so there's nothing else to check.
if (pos != tokens.size()) {
*err = android::base::StringPrintf("invalid number of args: %zu (expected 0)",
tokens.size() - pos);