Adding fastboot-info version to host tool

Replacing check with PLATFORM_TOOLS_VERSION with FASTBOOT_INFO_VERSION
to indicate waht version of fastboot_info.txt we currently support. This
makes mor sense since PLATFORM_TOOLS_VERSION won't be updated every time
me make a change to the host tool

Test: fastboot flashall
Bug: 194686221
Change-Id: I621b62c92ba129f402857463dae9112a0797ab07
This commit is contained in:
Daniel Zheng 2023-04-28 16:37:46 -07:00
parent 630f29e0db
commit 451e46f1ae

View file

@ -95,6 +95,8 @@ using android::base::unique_fd;
using namespace std::string_literals;
using namespace std::placeholders;
#define FASTBOOT_INFO_VERSION 1
static const char* serial = nullptr;
static bool g_long_listing = false;
@ -1710,9 +1712,7 @@ std::vector<std::unique_ptr<Task>> ParseFastbootInfo(const FlashingPlan* fp,
continue;
}
if (command.size() > 1 && command[0] == "version") {
uint32_t platform_tools_version;
android::base::ParseUint(PLATFORM_TOOLS_VERSION, &platform_tools_version);
if (!CheckFastbootInfoRequirements(command, platform_tools_version)) {
if (!CheckFastbootInfoRequirements(command, FASTBOOT_INFO_VERSION)) {
return {};
}
continue;