summaryrefslogtreecommitdiffstats
path: root/fastboot/device/fastboot_device.cpp
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2018-09-14 13:58:21 -0700
committerHridya Valsaraju <hridya@google.com>2018-09-25 22:55:47 +0000
commita15fe315079d8d423aaf1651a69ee3612f603e39 (patch)
tree16febdb292d798d764a859512933579dbab875aa /fastboot/device/fastboot_device.cpp
parent6590255dbbcbd35c527b3a2e6871275ec88fee64 (diff)
downloadsystem_core-a15fe315079d8d423aaf1651a69ee3612f603e39.tar.gz
system_core-a15fe315079d8d423aaf1651a69ee3612f603e39.tar.bz2
system_core-a15fe315079d8d423aaf1651a69ee3612f603e39.zip
Pass OEM commands to HAL
Bug: 78793464 Bug: 79480454 Test: fastboot oem command Change-Id: Ibaabef6ea725857102f7531997fcff2a1dbdc1ca Merged-In: Ibaabef6ea725857102f7531997fcff2a1dbdc1ca (cherry picked from commit 993b4edb0f33ac4f46cd4da932ba5fb033c06328)
Diffstat (limited to 'fastboot/device/fastboot_device.cpp')
-rw-r--r--fastboot/device/fastboot_device.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/fastboot/device/fastboot_device.cpp b/fastboot/device/fastboot_device.cpp
index ae2e7a607..6862741b6 100644
--- a/fastboot/device/fastboot_device.cpp
+++ b/fastboot/device/fastboot_device.cpp
@@ -48,6 +48,7 @@ FastbootDevice::FastbootDevice()
{FB_CMD_DELETE_PARTITION, DeletePartitionHandler},
{FB_CMD_RESIZE_PARTITION, ResizePartitionHandler},
{FB_CMD_UPDATE_SUPER, UpdateSuperHandler},
+ {FB_CMD_OEM, OemCmdHandler},
}),
transport_(std::make_unique<ClientUsbTransport>()),
boot_control_hal_(IBootControl::getService()),
@@ -120,10 +121,20 @@ void FastbootDevice::ExecuteCommands() {
command[bytes_read] = '\0';
LOG(INFO) << "Fastboot command: " << command;
- auto args = android::base::Split(command, ":");
- auto found_command = kCommandMap.find(args[0]);
+
+ std::vector<std::string> args;
+ std::string cmd_name;
+ if (android::base::StartsWith(command, "oem ")) {
+ args = {command};
+ cmd_name = "oem";
+ } else {
+ args = android::base::Split(command, ":");
+ cmd_name = args[0];
+ }
+
+ auto found_command = kCommandMap.find(cmd_name);
if (found_command == kCommandMap.end()) {
- WriteStatus(FastbootResult::FAIL, "Unrecognized command");
+ WriteStatus(FastbootResult::FAIL, "Unrecognized command " + args[0]);
continue;
}
if (!found_command->second(this, args)) {