fastboot: Prefer ro.boot.hardware.revision for hw-revision
ro.revision defaults to 0 if it's not set in cmdline.
Some devices might want to set it in their device specific init files,
however it's not possible to override ro properties.
Test: Set ro.boot.hardware.revision in device specific init.rc and
observe "HW version" in fastbootd UI
Change-Id: I6e785c3fe3a49409e815af269a9a8db732b80ada
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 898d15c..6a9d084 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -42,7 +42,8 @@
std::string bootloader_version = android::base::GetProperty("ro.bootloader", "");
std::string baseband_version = android::base::GetProperty("ro.build.expect.baseband", "");
- std::string hw_version = android::base::GetProperty("ro.revision", "");
+ std::string hw_version = android::base::GetProperty(
+ "ro.boot.hardware.revision", android::base::GetProperty("ro.revision", ""));
std::vector<std::string> title_lines;
title_lines.push_back("Product name - " + android::base::GetProperty("ro.product.device", ""));
if (!android::base::EqualsIgnoreCase(bootloader_version, "unknown")) {