Merge changes I36d1e494,I65a74ac6 into main

* changes:
  Add missing supportedEnumValues
  Add missing status codes
This commit is contained in:
Aaqib Ismail 2023-09-07 03:21:12 +00:00 committed by Android (Google) Code Review
commit 5a8f91761b
3 changed files with 47 additions and 1 deletions

View file

@ -73,6 +73,11 @@ void aidlToProto(const aidl_vehicle::VehiclePropConfig& in, proto::VehiclePropCo
protoACfg->set_max_float_value(areaConfig.maxFloatValue);
protoACfg->set_min_int32_value(areaConfig.minInt32Value);
protoACfg->set_max_int32_value(areaConfig.maxInt32Value);
if (areaConfig.supportedEnumValues.has_value()) {
for (auto& supportedEnumValue : areaConfig.supportedEnumValues.value()) {
protoACfg->add_supported_enum_values(supportedEnumValue);
}
}
}
}
@ -87,7 +92,7 @@ void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropCo
COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, config_array, out, configArray);
auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) {
return aidl_vehicle::VehicleAreaConfig{
auto vehicleAreaConfig = aidl_vehicle::VehicleAreaConfig{
.areaId = protoAcfg.area_id(),
.minInt32Value = protoAcfg.min_int32_value(),
.maxInt32Value = protoAcfg.max_int32_value(),
@ -96,6 +101,9 @@ void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropCo
.minFloatValue = protoAcfg.min_float_value(),
.maxFloatValue = protoAcfg.max_float_value(),
};
COPY_PROTOBUF_VEC_TO_VHAL_TYPE(protoAcfg, supported_enum_values, (&vehicleAreaConfig),
supportedEnumValues.value());
return vehicleAreaConfig;
};
CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, area_configs, out, areaConfigs, cast_to_acfg);
}

View file

@ -38,6 +38,37 @@ enum StatusCode {
/* Something unexpected has happened in Vehicle HAL */
INTERNAL_ERROR = 5;
/**
* For features that are not available because the underlying feature is
* disabled.
*/
NOT_AVAILABLE_DISABLED = 6;
/**
* For features that are not available because the vehicle speed is too low.
*/
NOT_AVAILABLE_SPEED_LOW = 7;
/**
* For features that are not available because the vehicle speed is too
* high.
*/
NOT_AVAILABLE_SPEED_HIGH = 8;
/**
* For features that are not available because of bad camera or sensor
* visibility. Examples might be bird poop blocking the camera or a bumper
* cover blocking an ultrasonic sensor.
*/
NOT_AVAILABLE_POOR_VISIBILITY = 9;
/**
* The feature cannot be accessed due to safety reasons. Eg. System could be
* in a faulty state, an object or person could be blocking the requested
* operation such as closing a trunk door, etc.
*/
NOT_AVAILABLE_SAFETY = 10;
};
message VehicleHalCallStatus {

View file

@ -36,4 +36,11 @@ message VehicleAreaConfig {
float min_float_value = 6;
float max_float_value = 7;
/**
* If the property has a @data_enum, then it is possible to specify a supported subset of the
* @data_enum. If the property has a @data_enum and supported_enum_values is null, then it is
* assumed all @data_enum values are supported unless specified through another mechanism.
*/
repeated int64 supported_enum_values = 8;
};