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
This commit is contained in:
Michael Bestas 2022-05-11 04:47:15 +03:00
parent b6b893f8e1
commit 80d251133c
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -447,7 +447,10 @@ std::vector<std::vector<std::string>> GetAllPartitionArgsNoSlot(FastbootDevice*
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;
}