Fix property unavailable check logic.
Test: Presubmit
Bug: 322070490
Change-Id: Ifd97370a5dd71ace57791c0287bea0bb8c912c29
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 960c5ac..9937570 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -288,11 +288,8 @@
bool VtsHalAutomotiveVehicleTargetTest::isUnavailable(
const VhalClientResult<std::unique_ptr<IHalPropValue>>& result) {
- if (result.ok()) {
- return false;
- }
- if (result.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL) {
- return true;
+ if (!result.ok()) {
+ return result.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL;
}
if (result.value() != nullptr &&
result.value()->getStatus() == VehiclePropertyStatus::UNAVAILABLE) {