From 80d251133c7475e0dad3af49062b934d709a16d9 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Wed, 11 May 2022 04:47:15 +0300 Subject: [PATCH] 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 --- fastboot/device/variables.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fastboot/device/variables.cpp b/fastboot/device/variables.cpp index 77210abcb..078bb13e3 100644 --- a/fastboot/device/variables.cpp +++ b/fastboot/device/variables.cpp @@ -447,7 +447,10 @@ std::vector> GetAllPartitionArgsNoSlot(FastbootDevice* bool GetHardwareRevision(FastbootDevice* /* device */, const std::vector& /* 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; }