diff options
Diffstat (limited to 'fastboot/device/variables.cpp')
-rw-r--r-- | fastboot/device/variables.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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<std::strin *message = android::base::GetProperty("ro.treble.enabled", ""); return true; } + +bool GetMaxFetchSize(FastbootDevice* /* device */, const std::vector<std::string>& /* args */, + std::string* message) { + if (!kEnableFetch) { + *message = "fetch not supported on user builds"; + return false; + } + *message = android::base::StringPrintf("0x%X", kMaxFetchSizeDefault); + return true; +} |