Loading fastboot/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,12 @@ cc_binary { recovery: true, product_variables: { debuggable: { cppflags: ["-DFB_ENABLE_FETCH"], }, }, srcs: [ "device/commands.cpp", "device/fastboot_device.cpp", Loading fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,3 +77,4 @@ #define FB_VAR_FIRST_API_LEVEL "first-api-level" #define FB_VAR_SECURITY_PATCH_LEVEL "security-patch-level" #define FB_VAR_TREBLE_ENABLED "treble-enabled" #define FB_VAR_MAX_FETCH_SIZE "max-fetch-size" fastboot/device/commands.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,9 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args) {FB_VAR_DYNAMIC_PARTITION, {GetDynamicPartition, nullptr}}, {FB_VAR_FIRST_API_LEVEL, {GetFirstApiLevel, nullptr}}, {FB_VAR_SECURITY_PATCH_LEVEL, {GetSecurityPatchLevel, nullptr}}, {FB_VAR_TREBLE_ENABLED, {GetTrebleEnabled, nullptr}}}; {FB_VAR_TREBLE_ENABLED, {GetTrebleEnabled, nullptr}}, {FB_VAR_MAX_FETCH_SIZE, {GetMaxFetchSize, nullptr}}, }; if (args.size() < 2) { return device->WriteFail("Missing argument"); Loading fastboot/device/commands.h +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <vector> constexpr unsigned int kMaxDownloadSizeDefault = 0x10000000; constexpr unsigned int kMaxFetchSizeDefault = 0x10000000; class FastbootDevice; Loading fastboot/device/variables.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading
fastboot/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,12 @@ cc_binary { recovery: true, product_variables: { debuggable: { cppflags: ["-DFB_ENABLE_FETCH"], }, }, srcs: [ "device/commands.cpp", "device/fastboot_device.cpp", Loading
fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,3 +77,4 @@ #define FB_VAR_FIRST_API_LEVEL "first-api-level" #define FB_VAR_SECURITY_PATCH_LEVEL "security-patch-level" #define FB_VAR_TREBLE_ENABLED "treble-enabled" #define FB_VAR_MAX_FETCH_SIZE "max-fetch-size"
fastboot/device/commands.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,9 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args) {FB_VAR_DYNAMIC_PARTITION, {GetDynamicPartition, nullptr}}, {FB_VAR_FIRST_API_LEVEL, {GetFirstApiLevel, nullptr}}, {FB_VAR_SECURITY_PATCH_LEVEL, {GetSecurityPatchLevel, nullptr}}, {FB_VAR_TREBLE_ENABLED, {GetTrebleEnabled, nullptr}}}; {FB_VAR_TREBLE_ENABLED, {GetTrebleEnabled, nullptr}}, {FB_VAR_MAX_FETCH_SIZE, {GetMaxFetchSize, nullptr}}, }; if (args.size() < 2) { return device->WriteFail("Missing argument"); Loading
fastboot/device/commands.h +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <vector> constexpr unsigned int kMaxDownloadSizeDefault = 0x10000000; constexpr unsigned int kMaxFetchSizeDefault = 0x10000000; class FastbootDevice; Loading
fastboot/device/variables.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; }