diff --git a/otautil/include/otautil/error_code.h b/otautil/include/otautil/error_code.h index 2b73c135..7b52ce59 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 f41ac6ac..d26424ab 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -559,15 +559,15 @@ static void set_retry_bootloader_message(int retry_count, const std::vector kBootreasonBlacklist{ + static const std::vector 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::vectorPrint("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 e76ccbdf..978ac7c2 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 aed63369..1a7c272b 100644 --- a/updater/commands.cpp +++ b/updater/commands.cpp @@ -128,7 +128,6 @@ bool Command::ParseTargetInfoAndSourceInfo(const std::vector& 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);