summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-05-15 16:53:53 -0700
committerElliott Hughes <enh@google.com>2017-05-15 16:53:53 -0700
commit1eec97af07f5a744df7316e5e599ff513e99022b (patch)
treedd51eb09ddad886194e9d1a2fe092c09c3f9c0bc /fastboot/fastboot.cpp
parent3cfc1ab89dd841c69f0d477e75d534329a7a2e47 (diff)
Fix "fastboot flashing".
...without breaking "fastboot oem". Turns out the bootloader actually needs to know whether it's getting a "flashing" or "oem" command. Bug: http://b/38321935 Test: "fastboot flashing unlock" "fastboot oem uart enable" Change-Id: I2b3c0b42b01e3c884aa794fa273034a366985089
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index e1f289ae1..3e890c717 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1260,10 +1260,10 @@ static void do_bypass_unlock_command(std::vector<std::string>* args) {
fb_queue_command("flashing unlock_bootloader", "unlocking bootloader");
}
-static void do_oem_command(std::vector<std::string>* args) {
+static void do_oem_command(const std::string& cmd, std::vector<std::string>* args) {
if (args->empty()) syntax_error("empty oem command");
- std::string command("oem");
+ std::string command(cmd);
while (!args->empty()) {
command += " " + next_arg(args);
}
@@ -1766,7 +1766,7 @@ int main(int argc, char **argv)
std::string filename = next_arg(&args);
fb_queue_upload(filename.c_str());
} else if (command == "oem") {
- do_oem_command(&args);
+ do_oem_command("oem", &args);
} else if (command == "flashing") {
if (args.empty()) {
syntax_error("missing 'flashing' command");
@@ -1776,7 +1776,7 @@ int main(int argc, char **argv)
args[0] == "get_unlock_ability" ||
args[0] == "get_unlock_bootloader_nonce" ||
args[0] == "lock_bootloader")) {
- do_oem_command(&args);
+ do_oem_command("flashing", &args);
} else if (args.size() == 2 && args[0] == "unlock_bootloader") {
do_bypass_unlock_command(&args);
} else {