Add missing HVAC properties
BUG: 28350886
Change-Id: Ib1e25b62a31d248ac3d8931d42e9cac3346c4717
diff --git a/libvehiclenetwork/native/IVehicleNetwork.cpp b/libvehiclenetwork/native/IVehicleNetwork.cpp
index 528034c..ca3892b 100644
--- a/libvehiclenetwork/native/IVehicleNetwork.cpp
+++ b/libvehiclenetwork/native/IVehicleNetwork.cpp
@@ -143,6 +143,8 @@
if (exceptionCode != NO_ERROR) {
if (exceptionCode == binder::Status::EX_SERVICE_SPECIFIC) {
return -EAGAIN;
+ } else if (exceptionCode == binder::Status::EX_ILLEGAL_STATE) {
+ return -ESHUTDOWN;
}
return exceptionCode;
}
@@ -327,6 +329,27 @@
}
r = getProperty(&value);
if (r == NO_ERROR) {
+ // If int32 or float value is out of range, throw an exception:
+ switch (value.value_type) {
+ case VEHICLE_VALUE_TYPE_INT32:
+ case VEHICLE_VALUE_TYPE_ZONED_INT32:
+ // TODO: Handle array types as well?
+ if (value.value.int32_value == VEHICLE_INT_OUT_OF_RANGE_OFF) {
+ // this should be handled specially to throw IllegalStateException in java.
+ reply->writeInt32(binder::Status::EX_ILLEGAL_STATE);
+ return NO_ERROR;
+ }
+ break;
+ case VEHICLE_VALUE_TYPE_FLOAT:
+ case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
+ // TODO: Handle array types as well?
+ if (value.value.float_value == VEHICLE_FLOAT_OUT_OF_RANGE_OFF) {
+ // this should be handled specially to throw IllegalStateException in java.
+ reply->writeInt32(binder::Status::EX_ILLEGAL_STATE);
+ return NO_ERROR;
+ }
+ break;
+ }
reply->writeNoException();
r = VehiclePropValueBinderUtil::writeToParcel(*reply, value);
releaseMemoryFromGet(&value);