Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5df458d2 authored by Aaqib Ismail's avatar Aaqib Ismail
Browse files

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
parent dc90e226
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue(

    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 @@ VhalResult<void> FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu

    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) {
+2 −2
Original line number Diff line number Diff line
@@ -1183,7 +1183,7 @@ TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) {

                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 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) {
                                                              .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);
                }