HVAC dependent properties should return NOT_AVAILABLE_DISABLED
To be consistent with the new API in Android U, NOT_AVAILABLE_DISABLED
is the more appropiate StatusCode.
Bug: 255430764
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest FakeVehicleHardwareTest
Change-Id: I4c49f255817f1f9bc2888c99177c6dc666213ab6
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
index 4544389..096a6cd 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -471,7 +471,7 @@
if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) {
*isSpecialValue = true;
- return StatusError(StatusCode::NOT_AVAILABLE) << "hvac not available";
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available";
}
switch (propId) {
@@ -562,7 +562,7 @@
if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) {
*isSpecialValue = true;
- return StatusError(StatusCode::NOT_AVAILABLE) << "hvac not available";
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available";
}
switch (propId) {
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
index 65585d9..254d30f 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -1183,7 +1183,7 @@
if (areaId == powerDependentAreaId) {
EXPECT_FALSE(getValueResult.ok());
- EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE);
+ EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED);
} else {
EXPECT_TRUE(getValueResult.ok());
}
@@ -1216,7 +1216,7 @@
.value.int32Values = {1}});
if (areaId == powerDependentAreaId) {
- EXPECT_EQ(status, StatusCode::NOT_AVAILABLE);
+ EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED);
} else {
EXPECT_EQ(status, StatusCode::OK);
}