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

Commit 810144a1 authored by Aaqib Ismail's avatar Aaqib Ismail
Browse files

Add missing supportedEnumValues

Bug: 299192013
Test: m
Change-Id: I36d1e4942cb44604539e384bde9300ac8ca8eba2
parent e279306e
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);
}
+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;
};