Generate cpp header file for supported enums.

Auto generate cpp header files for getting supported enum values
for property ID and use this in VTS test to verify the
supportedEnumValues are populated correctly.

Flag: EXEMPT VTS
Test: atest VehiclePropertyAnnotationCppTest \
VtsHalAutomotiveVehicle_TargetTest
Bug: 381123190

Change-Id: I55fa28b75e2e2c668a5f53d1fffcc8fb74c10de5
diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp
index d3ce307..1419455 100644
--- a/automotive/vehicle/aidl/aidl_test/Android.bp
+++ b/automotive/vehicle/aidl/aidl_test/Android.bp
@@ -44,6 +44,7 @@
     srcs: ["VehiclePropertyAnnotationCppTest.cpp"],
     header_libs: ["IVehicleGeneratedHeaders-V4"],
     static_libs: [
+        "VehicleHalUtils",
         "libgtest",
         "libgmock",
     ],
diff --git a/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp
index dd82d1b..d982caf 100644
--- a/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp
+++ b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp
@@ -17,6 +17,8 @@
 #include <AccessForVehicleProperty.h>
 #include <AnnotationsForVehicleProperty.h>
 #include <ChangeModeForVehicleProperty.h>
+#include <EnumForVehicleProperty.h>
+#include <VehicleHalTypes.h>
 
 #include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
 #include <gmock/gmock.h>
@@ -73,3 +75,16 @@
                 << " must not be empty";
     }
 }
+
+TEST(VehiclePropertyAnnotationCppTest, testSupportedEnums) {
+    auto supportedEnums =
+            aidl_vehicle::getSupportedEnumValuesForProperty(VehicleProperty::INFO_FUEL_TYPE);
+    // We only listed part of the fuel type values here. This is enough to verify that the
+    // generated code is correct.
+    ASSERT_THAT(supportedEnums,
+                ::testing::IsSupersetOf(
+                        {static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_UNLEADED),
+                         static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_LEADED),
+                         static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_DIESEL_1),
+                         static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_DIESEL_2)}));
+}
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h
index eea1c5c..e645b7c 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h
index 27301a5..5b6048a 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h
index b353ab9..ca07ecf 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/EnumForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/EnumForVehicleProperty.h
new file mode 100644
index 0000000..5afe069
--- /dev/null
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/EnumForVehicleProperty.h
@@ -0,0 +1,313 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * DO NOT EDIT MANUALLY!!!
+ *
+ * Generated by tools/generate_annotation_enums.py.
+ */
+
+// clang-format off
+
+#pragma once
+
+#define addSupportedValues(EnumType) \
+{ \
+constexpr auto values = ndk::internal::enum_values<EnumType>; \
+for (size_t i = 0; i < values.size(); i++) { \
+    supportedValues.insert(static_cast<int64_t>(values[i])); \
+} \
+}
+
+#include <VehicleHalTypes.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
+
+#include <unordered_set>
+
+namespace aidl::android::hardware::automotive::vehicle {
+std::unordered_set<int64_t> getSupportedEnumValuesForProperty(VehicleProperty propertyId) {
+    std::unordered_set<int64_t> supportedValues;
+    switch (propertyId) {
+        case VehicleProperty::INFO_FUEL_TYPE:
+            addSupportedValues(FuelType)
+            break;
+        case VehicleProperty::INFO_EV_CONNECTOR_TYPE:
+            addSupportedValues(EvConnectorType)
+            break;
+        case VehicleProperty::INFO_FUEL_DOOR_LOCATION:
+            addSupportedValues(PortLocationType)
+            break;
+        case VehicleProperty::INFO_EV_PORT_LOCATION:
+            addSupportedValues(PortLocationType)
+            break;
+        case VehicleProperty::INFO_DRIVER_SEAT:
+            addSupportedValues(VehicleAreaSeat)
+            break;
+        case VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS:
+            addSupportedValues(PortLocationType)
+            break;
+        case VehicleProperty::INFO_VEHICLE_SIZE_CLASS:
+            addSupportedValues(VehicleSizeClass)
+            break;
+        case VehicleProperty::ENGINE_OIL_LEVEL:
+            addSupportedValues(VehicleOilLevel)
+            break;
+        case VehicleProperty::IMPACT_DETECTED:
+            addSupportedValues(ImpactSensorLocation)
+            break;
+        case VehicleProperty::GEAR_SELECTION:
+            addSupportedValues(VehicleGear)
+            break;
+        case VehicleProperty::CURRENT_GEAR:
+            addSupportedValues(VehicleGear)
+            break;
+        case VehicleProperty::TURN_SIGNAL_STATE:
+            addSupportedValues(VehicleTurnSignal)
+            break;
+        case VehicleProperty::IGNITION_STATE:
+            addSupportedValues(VehicleIgnitionState)
+            break;
+        case VehicleProperty::EV_STOPPING_MODE:
+            addSupportedValues(EvStoppingMode)
+            break;
+        case VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE:
+            addSupportedValues(ElectronicStabilityControlState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::TURN_SIGNAL_LIGHT_STATE:
+            addSupportedValues(VehicleTurnSignal)
+            break;
+        case VehicleProperty::TURN_SIGNAL_SWITCH:
+            addSupportedValues(VehicleTurnSignal)
+            break;
+        case VehicleProperty::HVAC_FAN_DIRECTION:
+            addSupportedValues(VehicleHvacFanDirection)
+            break;
+        case VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS:
+            addSupportedValues(VehicleUnit)
+            break;
+        case VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE:
+            addSupportedValues(VehicleHvacFanDirection)
+            break;
+        case VehicleProperty::DISTANCE_DISPLAY_UNITS:
+            addSupportedValues(VehicleUnit)
+            break;
+        case VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS:
+            addSupportedValues(VehicleUnit)
+            break;
+        case VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS:
+            addSupportedValues(VehicleUnit)
+            break;
+        case VehicleProperty::EV_BATTERY_DISPLAY_UNITS:
+            addSupportedValues(VehicleUnit)
+            break;
+        case VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS:
+            addSupportedValues(VehicleUnit)
+            break;
+        case VehicleProperty::HW_ROTARY_INPUT:
+            addSupportedValues(RotaryInputType)
+            break;
+        case VehicleProperty::HW_CUSTOM_INPUT:
+            addSupportedValues(CustomInputType)
+            break;
+        case VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::SEAT_AIRBAGS_DEPLOYED:
+            addSupportedValues(VehicleAirbagLocation)
+            break;
+        case VehicleProperty::SEAT_OCCUPANCY:
+            addSupportedValues(VehicleSeatOccupancyState)
+            break;
+        case VehicleProperty::WINDSHIELD_WIPERS_STATE:
+            addSupportedValues(WindshieldWipersState)
+            break;
+        case VehicleProperty::WINDSHIELD_WIPERS_SWITCH:
+            addSupportedValues(WindshieldWipersSwitch)
+            break;
+        case VehicleProperty::HEADLIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::HIGH_BEAM_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::FOG_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::HAZARD_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::HEADLIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::FOG_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::HAZARD_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::CABIN_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::CABIN_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::READING_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::READING_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::STEERING_WHEEL_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE:
+            addSupportedValues(ElectronicTollCollectionCardType)
+            break;
+        case VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS:
+            addSupportedValues(ElectronicTollCollectionCardStatus)
+            break;
+        case VehicleProperty::FRONT_FOG_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::FRONT_FOG_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::REAR_FOG_LIGHTS_STATE:
+            addSupportedValues(VehicleLightState)
+            break;
+        case VehicleProperty::REAR_FOG_LIGHTS_SWITCH:
+            addSupportedValues(VehicleLightSwitch)
+            break;
+        case VehicleProperty::EV_CHARGE_STATE:
+            addSupportedValues(EvChargeState)
+            break;
+        case VehicleProperty::EV_REGENERATIVE_BRAKING_STATE:
+            addSupportedValues(EvRegenerativeBrakingState)
+            break;
+        case VehicleProperty::TRAILER_PRESENT:
+            addSupportedValues(TrailerState)
+            break;
+        case VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT:
+            addSupportedValues(GsrComplianceRequirementType)
+            break;
+        case VehicleProperty::SHUTDOWN_REQUEST:
+            addSupportedValues(VehicleApPowerStateShutdownParam)
+            break;
+        case VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL:
+            addSupportedValues(VehicleAutonomousState)
+            break;
+        case VehicleProperty::VEHICLE_DRIVING_AUTOMATION_TARGET_LEVEL:
+            addSupportedValues(VehicleAutonomousState)
+            break;
+        case VehicleProperty::CAMERA_SERVICE_CURRENT_STATE:
+            addSupportedValues(CameraServiceState)
+            break;
+        case VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE:
+            addSupportedValues(AutomaticEmergencyBrakingState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::FORWARD_COLLISION_WARNING_STATE:
+            addSupportedValues(ForwardCollisionWarningState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::BLIND_SPOT_WARNING_STATE:
+            addSupportedValues(BlindSpotWarningState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::LANE_DEPARTURE_WARNING_STATE:
+            addSupportedValues(LaneDepartureWarningState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::LANE_KEEP_ASSIST_STATE:
+            addSupportedValues(LaneKeepAssistState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::LANE_CENTERING_ASSIST_COMMAND:
+            addSupportedValues(LaneCenteringAssistCommand)
+            break;
+        case VehicleProperty::LANE_CENTERING_ASSIST_STATE:
+            addSupportedValues(LaneCenteringAssistState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE:
+            addSupportedValues(EmergencyLaneKeepAssistState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::CRUISE_CONTROL_TYPE:
+            addSupportedValues(CruiseControlType)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::CRUISE_CONTROL_STATE:
+            addSupportedValues(CruiseControlState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::CRUISE_CONTROL_COMMAND:
+            addSupportedValues(CruiseControlCommand)
+            break;
+        case VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE:
+            addSupportedValues(HandsOnDetectionDriverState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::HANDS_ON_DETECTION_WARNING:
+            addSupportedValues(HandsOnDetectionWarning)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE:
+            addSupportedValues(DriverDrowsinessAttentionState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING:
+            addSupportedValues(DriverDrowsinessAttentionWarning)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::DRIVER_DISTRACTION_STATE:
+            addSupportedValues(DriverDistractionState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::DRIVER_DISTRACTION_WARNING:
+            addSupportedValues(DriverDistractionWarning)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE:
+            addSupportedValues(LowSpeedCollisionWarningState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE:
+            addSupportedValues(CrossTrafficMonitoringWarningState)
+            addSupportedValues(ErrorState)
+            break;
+        case VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE:
+            addSupportedValues(LowSpeedAutomaticEmergencyBrakingState)
+            addSupportedValues(ErrorState)
+            break;
+
+        default:
+            // Do nothing.
+            break;
+    }
+    return supportedValues;
+}
+}  // aidl::android::hardware::automotive::vehicle
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h
index 5f6e047..ff69759 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java
index 1a68d4d..8f42a83 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java
index 1d79180..07f55b1 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java
index a0dab66..cf44887 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java
index 7ab14ec..fe88da8 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java
index b30c8e6..3a35dbb 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h
index fcc006b..19d2f71 100644
--- a/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h
+++ b/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h
@@ -24,6 +24,7 @@
 #include <aidl/android/hardware/automotive/vehicle/CruiseControlCommand.h>
 #include <aidl/android/hardware/automotive/vehicle/CruiseControlState.h>
 #include <aidl/android/hardware/automotive/vehicle/CruiseControlType.h>
+#include <aidl/android/hardware/automotive/vehicle/CustomInputType.h>
 #include <aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.h>
 #include <aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.h>
 #include <aidl/android/hardware/automotive/vehicle/DriverDistractionState.h>
@@ -31,9 +32,13 @@
 #include <aidl/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.h>
 #include <aidl/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.h>
 #include <aidl/android/hardware/automotive/vehicle/ElectronicStabilityControlState.h>
+#include <aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.h>
+#include <aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.h>
 #include <aidl/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.h>
 #include <aidl/android/hardware/automotive/vehicle/ErrorState.h>
+#include <aidl/android/hardware/automotive/vehicle/EvChargeState.h>
 #include <aidl/android/hardware/automotive/vehicle/EvConnectorType.h>
+#include <aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.h>
 #include <aidl/android/hardware/automotive/vehicle/EvStoppingMode.h>
 #include <aidl/android/hardware/automotive/vehicle/EvsServiceState.h>
 #include <aidl/android/hardware/automotive/vehicle/EvsServiceType.h>
@@ -62,6 +67,7 @@
 #include <aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.h>
 #include <aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.h>
 #include <aidl/android/hardware/automotive/vehicle/PortLocationType.h>
+#include <aidl/android/hardware/automotive/vehicle/RotaryInputType.h>
 #include <aidl/android/hardware/automotive/vehicle/SetValueRequest.h>
 #include <aidl/android/hardware/automotive/vehicle/SetValueResult.h>
 #include <aidl/android/hardware/automotive/vehicle/SetValueResults.h>
@@ -69,10 +75,12 @@
 #include <aidl/android/hardware/automotive/vehicle/SubscribeOptions.h>
 #include <aidl/android/hardware/automotive/vehicle/SupportedValuesListResult.h>
 #include <aidl/android/hardware/automotive/vehicle/SupportedValuesListResults.h>
+#include <aidl/android/hardware/automotive/vehicle/TrailerState.h>
 #include <aidl/android/hardware/automotive/vehicle/VehicleAirbagLocation.h>
 #include <aidl/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.h>
 #include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.h>
 #include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.h>
 #include <aidl/android/hardware/automotive/vehicle/VehicleArea.h>
 #include <aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.h>
 #include <aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.h>
diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py
index 5367f3f..44a810e 100755
--- a/automotive/vehicle/tools/generate_annotation_enums.py
+++ b/automotive/vehicle/tools/generate_annotation_enums.py
@@ -42,6 +42,7 @@
 ACCESS_CPP_FILE_PATH = GENERATED_LIB + '/cpp/AccessForVehicleProperty.h'
 CHANGE_MODE_JAVA_FILE_PATH = GENERATED_LIB + '/java/ChangeModeForVehicleProperty.java'
 ACCESS_JAVA_FILE_PATH = GENERATED_LIB + '/java/AccessForVehicleProperty.java'
+ENUM_CPP_FILE_PATH = GENERATED_LIB + '/cpp/EnumForVehicleProperty.h'
 ENUM_JAVA_FILE_PATH = GENERATED_LIB + '/java/EnumForVehicleProperty.java'
 UNITS_JAVA_FILE_PATH = GENERATED_LIB + '/java/UnitsForVehicleProperty.java'
 VERSION_CPP_FILE_PATH = GENERATED_LIB + '/cpp/VersionForVehicleProperty.h'
@@ -84,7 +85,7 @@
 ]
 
 LICENSE = """/*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -173,6 +174,40 @@
 }}  // aidl::android::hardware::automotive::vehicle
 """
 
+ENUM_CPP_FORMATTER = """#pragma once
+
+#define addSupportedValues(EnumType) \\
+{{ \\
+constexpr auto values = ndk::internal::enum_values<EnumType>; \\
+for (size_t i = 0; i < values.size(); i++) {{ \\
+    supportedValues.insert(static_cast<int64_t>(values[i])); \\
+}} \\
+}}
+
+#include <VehicleHalTypes.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
+
+#include <unordered_set>
+
+namespace aidl::android::hardware::automotive::vehicle {{
+std::unordered_set<int64_t> getSupportedEnumValuesForProperty(VehicleProperty propertyId) {{
+    std::unordered_set<int64_t> supportedValues;
+    switch (propertyId) {{
+{0}
+        default:
+            // Do nothing.
+            break;
+    }}
+    return supportedValues;
+}}
+}}  // aidl::android::hardware::automotive::vehicle
+"""
+
+ENUM_CPP_SWITCH_CASE_FORMATTER = """        case {0}:
+{1}
+            break;
+"""
+
 CHANGE_MODE_JAVA_FORMATTER = """package android.hardware.automotive.vehicle;
 
 import java.util.Map;
@@ -403,7 +438,16 @@
             elif field == 'enum_types':
                 if len(config.enum_types) < 1:
                     continue
-                if not cpp:
+                if cpp:
+                    switch_case = ''
+                    for index, enum_type in enumerate(config.enum_types):
+                        if index != 0:
+                            switch_case += '\n'
+                        switch_case += TAB + TAB + TAB + 'addSupportedValues({0})'.format(enum_type)
+                    content += ENUM_CPP_SWITCH_CASE_FORMATTER.format(
+                        'VehicleProperty::' + config.name, switch_case)
+                    continue
+                else:
                     value = "List.of(" + ', '.join([class_name + ".class" for class_name in config.enum_types]) + ")"
             elif field == 'unit_type':
                 if not config.unit_type:
@@ -596,8 +640,10 @@
     generated_files.append(access_mode)
 
     enum_types = GeneratedFile('enum_types')
+    enum_types.setCppFilePath(os.path.join(android_top, ENUM_CPP_FILE_PATH))
     enum_types.setJavaFilePath(os.path.join(android_top, ENUM_JAVA_FILE_PATH))
     enum_types.setJavaFormatter(ENUM_JAVA_FORMATTER)
+    enum_types.setCppFormatter(ENUM_CPP_FORMATTER)
     generated_files.append(enum_types)
 
     unit_type = GeneratedFile('unit_type')
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index c93de09..078ba72 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -19,6 +19,7 @@
 #include <AccessForVehicleProperty.h>
 #include <AnnotationsForVehicleProperty.h>
 #include <ChangeModeForVehicleProperty.h>
+#include <EnumForVehicleProperty.h>
 #include <IVhalClient.h>
 #include <VehicleHalTypes.h>
 #include <VehicleUtils.h>
@@ -49,6 +50,7 @@
 using ::aidl::android::hardware::automotive::vehicle::AllowedAccessForVehicleProperty;
 using ::aidl::android::hardware::automotive::vehicle::AnnotationsForVehicleProperty;
 using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::getSupportedEnumValuesForProperty;
 using ::aidl::android::hardware::automotive::vehicle::HasSupportedValueInfo;
 using ::aidl::android::hardware::automotive::vehicle::IVehicle;
 using ::aidl::android::hardware::automotive::vehicle::StatusCode;
@@ -930,7 +932,12 @@
                        "supported enum values is not empty";
         }
 
-        // TODO(b/381123190): Verify the supported enum values are within the defined enum type.
+        if (!supportedEnumValues.empty()) {
+            std::unordered_set<int64_t> allowedEnumValues = getSupportedEnumValuesForProperty(
+                    static_cast<VehicleProperty>(config->getPropId()));
+            EXPECT_THAT(supportedEnumValues, ::testing::IsSubsetOf(allowedEnumValues))
+                    << "Supported enum values must be part of defined enum type";
+        }
     }
 }