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 fastboot getvar hw-revision in fastbootd

Change-Id: I6e785c3fe3a49409e815af269a9a8db732b80ada
diff --git a/fastboot/device/variables.cpp b/fastboot/device/variables.cpp
index 0cf4699..abcea34 100644
--- a/fastboot/device/variables.cpp
+++ b/fastboot/device/variables.cpp
@@ -428,7 +428,10 @@
 
 bool GetHardwareRevision(FastbootDevice* /* device */, const std::vector<std::string>& /* args */,
                          std::string* message) {
-    *message = android::base::GetProperty("ro.revision", "");
+    *message = android::base::GetProperty("ro.boot.hardware.revision", "");
+    if (message->empty()) {
+        *message = android::base::GetProperty("ro.revision", "");
+    }
     return true;
 }