Loading fastboot/device/commands.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,11 @@ bool EraseHandler(FastbootDevice* device, const std::vector<std::string>& args) if (args.size() < 2) { return device->WriteStatus(FastbootResult::FAIL, "Invalid arguments"); } if (GetDeviceLockStatus()) { return device->WriteStatus(FastbootResult::FAIL, "Erase is not allowed on locked devices"); } PartitionHandle handle; if (!OpenPartition(device, args[1], &handle)) { return device->WriteStatus(FastbootResult::FAIL, "Partition doesn't exist"); Loading Loading @@ -163,6 +168,12 @@ bool DownloadHandler(FastbootDevice* device, const std::vector<std::string>& arg if (args.size() < 2) { return device->WriteStatus(FastbootResult::FAIL, "size argument unspecified"); } if (GetDeviceLockStatus()) { return device->WriteStatus(FastbootResult::FAIL, "Download is not allowed on locked devices"); } // arg[0] is the command name, arg[1] contains size of data to be downloaded unsigned int size; if (!android::base::ParseUint("0x" + args[1], &size, UINT_MAX)) { Loading Loading @@ -203,6 +214,11 @@ bool SetActiveHandler(FastbootDevice* device, const std::vector<std::string>& ar return device->WriteStatus(FastbootResult::FAIL, "Missing slot argument"); } if (GetDeviceLockStatus()) { return device->WriteStatus(FastbootResult::FAIL, "set_active command is not allowed on locked devices"); } // Slot suffix needs to be between 'a' and 'z'. Slot slot; if (!GetSlotNumber(args[1], &slot)) { Loading Loading
fastboot/device/commands.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,11 @@ bool EraseHandler(FastbootDevice* device, const std::vector<std::string>& args) if (args.size() < 2) { return device->WriteStatus(FastbootResult::FAIL, "Invalid arguments"); } if (GetDeviceLockStatus()) { return device->WriteStatus(FastbootResult::FAIL, "Erase is not allowed on locked devices"); } PartitionHandle handle; if (!OpenPartition(device, args[1], &handle)) { return device->WriteStatus(FastbootResult::FAIL, "Partition doesn't exist"); Loading Loading @@ -163,6 +168,12 @@ bool DownloadHandler(FastbootDevice* device, const std::vector<std::string>& arg if (args.size() < 2) { return device->WriteStatus(FastbootResult::FAIL, "size argument unspecified"); } if (GetDeviceLockStatus()) { return device->WriteStatus(FastbootResult::FAIL, "Download is not allowed on locked devices"); } // arg[0] is the command name, arg[1] contains size of data to be downloaded unsigned int size; if (!android::base::ParseUint("0x" + args[1], &size, UINT_MAX)) { Loading Loading @@ -203,6 +214,11 @@ bool SetActiveHandler(FastbootDevice* device, const std::vector<std::string>& ar return device->WriteStatus(FastbootResult::FAIL, "Missing slot argument"); } if (GetDeviceLockStatus()) { return device->WriteStatus(FastbootResult::FAIL, "set_active command is not allowed on locked devices"); } // Slot suffix needs to be between 'a' and 'z'. Slot slot; if (!GetSlotNumber(args[1], &slot)) { Loading