diff options
author | Tao Bao <tbao@google.com> | 2018-07-09 19:38:40 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-07-09 19:38:40 +0200 |
commit | c059b6c1c66d802196874b1ad14c62f33774a87a (patch) | |
tree | 0300e0c2d1f901f89d35f93f791174d6693b1296 /updater/blockimg.cpp | |
parent | Merge "tests: Split unit tests out of component/applypatch_test.cpp." (diff) | |
parent | updater: Add ABORT command. (diff) | |
download | android_bootable_recovery-c059b6c1c66d802196874b1ad14c62f33774a87a.tar android_bootable_recovery-c059b6c1c66d802196874b1ad14c62f33774a87a.tar.gz android_bootable_recovery-c059b6c1c66d802196874b1ad14c62f33774a87a.tar.bz2 android_bootable_recovery-c059b6c1c66d802196874b1ad14c62f33774a87a.tar.lz android_bootable_recovery-c059b6c1c66d802196874b1ad14c62f33774a87a.tar.xz android_bootable_recovery-c059b6c1c66d802196874b1ad14c62f33774a87a.tar.zst android_bootable_recovery-c059b6c1c66d802196874b1ad14c62f33774a87a.zip |
Diffstat (limited to '')
-rw-r--r-- | updater/blockimg.cpp | 7 |
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 }, |