From 7b7f6661b6048aa0833c5ce384b3758d51e458c4 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 14 Jul 2022 00:32:15 +0000 Subject: [PATCH] Fix a bug for generating enum script. We were previously checking "/**" as the start of a comment, however some properties was using "/*" which causes the script to generate wrong enums. This CL fixes this issue. Test: Local run. Bug: 238944990 Change-Id: I56c350663fdde15a405b11fd108df0c7b1f4eb3a --- .../vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h | 2 +- .../aidl/generated_lib/java/AccessForVehicleProperty.java | 2 +- automotive/vehicle/tools/generate_annotation_enums.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 4d37cd3520..14a694d565 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -77,7 +77,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::IGNITION_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::ABS_ACTIVE, VehiclePropertyAccess::READ}, {VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess::READ}, - {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyAccess::READ}, + {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess::READ}, {VehicleProperty::HVAC_TEMPERATURE_SET, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index fdf6c64afe..0a17ba196d 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -69,7 +69,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.IGNITION_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ABS_ACTIVE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess.READ), - Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.HVAC_TEMPERATURE_SET, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py index 154fe658db..fc6f157283 100644 --- a/automotive/vehicle/tools/generate_annotation_enums.py +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -41,7 +41,7 @@ ACCESS_JAVA_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_ TAB = " " RE_ENUM_START = re.compile("\s*enum VehicleProperty \{") RE_ENUM_END = re.compile("\s*\}\;") -RE_COMMENT_BEGIN = re.compile("\s*\/\*\*") +RE_COMMENT_BEGIN = re.compile("\s*\/\*\*?") RE_COMMENT_END = re.compile("\s*\*\/") RE_CHANGE_MODE = re.compile("\s*\* @change_mode (\S+)\s*") RE_ACCESS = re.compile("\s*\* @access (\S+)\s*")