Return empty suffix for invalid slots am: a6759d5d66 am: 2dba4ac8b4 am: 284508d0b2

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2166409

Change-Id: Ide60989030be2c342a334b2b6d1f3b08f09d5e6c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Kelvin Zhang
2022-07-29 00:22:34 +00:00
committed by Automerger Merge Worker

View File

@@ -84,10 +84,12 @@ ScopedAStatus BootControl::getSnapshotMergeStatus(MergeStatus* _aidl_return) {
ScopedAStatus BootControl::getSuffix(int32_t in_slot, std::string* _aidl_return) { ScopedAStatus BootControl::getSuffix(int32_t in_slot, std::string* _aidl_return) {
if (!impl_.IsValidSlot(in_slot)) { if (!impl_.IsValidSlot(in_slot)) {
return ScopedAStatus::fromServiceSpecificErrorWithMessage( // Old HIDL hal returns empty string for invalid slots. We should maintain this behavior in
INVALID_SLOT, (std::string("Invalid slot ") + std::to_string(in_slot)).c_str()); // AIDL for compatibility.
_aidl_return->clear();
} else {
*_aidl_return = impl_.GetSuffix(in_slot);
} }
*_aidl_return = impl_.GetSuffix(in_slot);
return ScopedAStatus::ok(); return ScopedAStatus::ok();
} }