fastbootd: Fix partition size testing issues.
Partition sizes must be reported with an "0x" prefix for fuzzy_fastboot.
Also, with dynamic partitions, the size of a partition can be 0.
Bug: 78793464
Test: fuzzy_fastboot Conformance.PartitionInfo does not error on
partition sizes when using fastbootd
Change-Id: I4148440bd9ed420878940829618cbf8cee85bf6a
diff --git a/fastboot/device/variables.cpp b/fastboot/device/variables.cpp
index 9f3fa75..91e844a 100644
--- a/fastboot/device/variables.cpp
+++ b/fastboot/device/variables.cpp
@@ -191,7 +191,7 @@
return false;
}
uint64_t size = get_block_device_size(handle.fd());
- *message = android::base::StringPrintf("%" PRIX64, size);
+ *message = android::base::StringPrintf("0x%" PRIX64, size);
return true;
}