summaryrefslogtreecommitdiffstats
path: root/updater/blockimg.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-05-22 01:05:56 +0200
committerTao Bao <tbao@google.com>2018-07-07 06:12:19 +0200
commit91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3 (patch)
tree0300e0c2d1f901f89d35f93f791174d6693b1296 /updater/blockimg.cpp
parentMerge "tests: Split unit tests out of component/applypatch_test.cpp." (diff)
downloadandroid_bootable_recovery-91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3.tar
android_bootable_recovery-91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3.tar.gz
android_bootable_recovery-91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3.tar.bz2
android_bootable_recovery-91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3.tar.lz
android_bootable_recovery-91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3.tar.xz
android_bootable_recovery-91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3.tar.zst
android_bootable_recovery-91a649ab62c9cf60ae9d02dd38c23fc23f98a1f3.zip
Diffstat (limited to '')
-rw-r--r--updater/blockimg.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 937c5e14b..fc713859b 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1489,6 +1489,11 @@ static int PerformCommandErase(CommandParameters& params) {
return 0;
}
+static int PerformCommandAbort(CommandParameters&) {
+ LOG(INFO) << "Aborting as instructed";
+ return -1;
+}
+
using CommandFunction = std::function<int(CommandParameters&)>;
using CommandMap = std::unordered_map<Command::Type, CommandFunction>;
@@ -1888,6 +1893,7 @@ Value* BlockImageVerifyFn(const char* name, State* state,
// Commands which are not allowed are set to nullptr to skip them completely.
const CommandMap command_map{
// clang-format off
+ { Command::Type::ABORT, PerformCommandAbort },
{ Command::Type::BSDIFF, PerformCommandDiff },
{ Command::Type::ERASE, nullptr },
{ Command::Type::FREE, PerformCommandFree },
@@ -1908,6 +1914,7 @@ Value* BlockImageUpdateFn(const char* name, State* state,
const std::vector<std::unique_ptr<Expr>>& argv) {
const CommandMap command_map{
// clang-format off
+ { Command::Type::ABORT, PerformCommandAbort },
{ Command::Type::BSDIFF, PerformCommandDiff },
{ Command::Type::ERASE, PerformCommandErase },
{ Command::Type::FREE, PerformCommandFree },