From b299cb7217e7f63d9128a0e595bcc21ab645f41f Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 17 Feb 2021 13:44:49 -0800 Subject: fastbootd: Add getvar max-fetch-size. Test: run it Test: see follow up CL on fuzzy_fastboot Bug: 173654501 Change-Id: I5ed110c5569d83cbe791d04b4abea3a2af2765a9 --- fastboot/device/variables.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'fastboot/device/variables.cpp') diff --git a/fastboot/device/variables.cpp b/fastboot/device/variables.cpp index e7d8bc366..ee1eed876 100644 --- a/fastboot/device/variables.cpp +++ b/fastboot/device/variables.cpp @@ -33,6 +33,12 @@ #include "flashing.h" #include "utility.h" +#ifdef FB_ENABLE_FETCH +static constexpr bool kEnableFetch = true; +#else +static constexpr bool kEnableFetch = false; +#endif + using ::android::hardware::boot::V1_0::BoolResult; using ::android::hardware::boot::V1_0::Slot; using ::android::hardware::boot::V1_1::MergeStatus; @@ -509,3 +515,13 @@ bool GetTrebleEnabled(FastbootDevice* /* device */, const std::vector& /* args */, + std::string* message) { + if (!kEnableFetch) { + *message = "fetch not supported on user builds"; + return false; + } + *message = android::base::StringPrintf("0x%X", kMaxFetchSizeDefault); + return true; +} -- cgit v1.2.3