gs-common: bootctrl: check both properties in setActiveBootSlot

properties: ro.boot.bootdevice, ro.boot.boot_devices

Bug: 313092597
Change-Id: Ib158c2b2aadf87b2155c4c268264f06bc659b544
Signed-off-by: Jason Chiu <jasoncschiu@google.com>
This commit is contained in:
Jason Chiu 2023-11-25 02:53:02 +08:00
parent f4d8fb7ad8
commit 2a201a74c2
2 changed files with 12 additions and 4 deletions

@ -345,8 +345,12 @@ Return<void> BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb
char boot_dev[PROPERTY_VALUE_MAX]; char boot_dev[PROPERTY_VALUE_MAX];
property_get("ro.boot.bootdevice", boot_dev, ""); property_get("ro.boot.bootdevice", boot_dev, "");
if (boot_dev[0] == '\0') { if (boot_dev[0] == '\0') {
_hidl_cb({false, "invalid ro.boot.bootdevice prop"}); ALOGI("failed to get ro.boot.bootdevice. try ro.boot.boot_devices\n");
return Void(); property_get("ro.boot.boot_devices", boot_dev, "");
if (boot_dev[0] == '\0') {
_hidl_cb({false, "invalid ro.boot.bootdevice and ro.boot.boot_devices prop"});
return Void();
}
} }
std::string boot_lun_path = std::string boot_lun_path =

@ -461,8 +461,12 @@ ScopedAStatus BootControl::setActiveBootSlot(int32_t in_slot) {
char boot_dev[PROPERTY_VALUE_MAX]; char boot_dev[PROPERTY_VALUE_MAX];
property_get("ro.boot.bootdevice", boot_dev, ""); property_get("ro.boot.bootdevice", boot_dev, "");
if (boot_dev[0] == '\0') { if (boot_dev[0] == '\0') {
return ScopedAStatus::fromServiceSpecificErrorWithMessage( ALOGI("failed to get ro.boot.bootdevice. try ro.boot.boot_devices\n");
COMMAND_FAILED, "invalid ro.boot.bootdevice prop"); property_get("ro.boot.boot_devices", boot_dev, "");
if (boot_dev[0] == '\0') {
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
COMMAND_FAILED, "invalid ro.boot.bootdevice and ro.boot.boot_devices prop");
}
} }
std::string boot_lun_path = std::string boot_lun_path =