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

Commit 5a8f9176 authored by Aaqib Ismail's avatar Aaqib Ismail Committed by Android (Google) Code Review
Browse files

Merge changes I36d1e494,I65a74ac6 into main

* changes:
  Add missing supportedEnumValues
  Add missing status codes
parents ab2b50a9 810144a1
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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);
}
+31 −0
Original line number Diff line number Diff line
@@ -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 {
+7 −0
Original line number Diff line number Diff line
@@ -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;
};