diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index fbd1a3321d..d4ab0f7678 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -179,6 +179,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::WINDOW_LOCK, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::WINDSHIELD_WIPERS_PERIOD, VehiclePropertyAccess::READ}, {VehicleProperty::WINDSHIELD_WIPERS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::STEERING_WHEEL_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 291fa204b9..d56de3f1ca 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -179,6 +179,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::WINDOW_LOCK, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::WINDSHIELD_WIPERS_PERIOD, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::WINDSHIELD_WIPERS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::STEERING_WHEEL_HEIGHT_POS, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 3395458ea6..caeb26676b 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -171,6 +171,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.WINDOW_LOCK, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.WINDSHIELD_WIPERS_PERIOD, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.WINDSHIELD_WIPERS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.STEERING_WHEEL_HEIGHT_POS, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index e74942f77a..0beab94381 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -171,6 +171,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.WINDOW_LOCK, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.WINDSHIELD_WIPERS_PERIOD, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.WINDSHIELD_WIPERS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_POS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.STEERING_WHEEL_HEIGHT_POS, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 51e5f2ab83..ff601e0342 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -76,6 +76,7 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleTurnSignal; using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; using ::aidl::android::hardware::automotive::vehicle::VehicleVendorPermission; using ::aidl::android::hardware::automotive::vehicle::WindshieldWipersState; +using ::aidl::android::hardware::automotive::vehicle::WindshieldWipersSwitch; using ::android::base::Error; using ::android::base::Result; @@ -226,6 +227,8 @@ JsonValueParser::JsonValueParser() { mConstantParsersByType["FuelType"] = std::make_unique>(); mConstantParsersByType["WindshieldWipersState"] = std::make_unique>(); + mConstantParsersByType["WindshieldWipersSwitch"] = + std::make_unique>(); mConstantParsersByType["EmergencyLaneKeepAssistState"] = std::make_unique>(); mConstantParsersByType["CruiseControlType"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 5d7c67a477..85a7486a40 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -2693,6 +2693,47 @@ } ] }, + { + "property": "VehicleProperty::WINDSHIELD_WIPERS_SWITCH", + "defaultValue": { + "int32Values": [ + "WindshieldWipersSwitch::OFF" + ] + }, + "areas": [ + { + "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD", + "supportedEnumValues": [ + "WindshieldWipersSwitch::OFF", + "WindshieldWipersSwitch::MIST", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_1", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_2", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_3", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_4", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_5", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_1", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_2", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_3", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_4", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_5", + "WindshieldWipersSwitch::AUTO", + "WindshieldWipersSwitch::SERVICE" + ] + }, + { + "areaId": "VehicleAreaWindow::REAR_WINDSHIELD", + "supportedEnumValues": [ + "WindshieldWipersSwitch::OFF", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_1", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_2", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_1", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_2", + "WindshieldWipersSwitch::AUTO", + "WindshieldWipersSwitch::SERVICE" + ] + } + ] + }, { "property": "VehicleProperty::STEERING_WHEEL_DEPTH_POS", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/default_config/config/README.md b/automotive/vehicle/aidl/impl/default_config/config/README.md index 093b13d5ca..6e82de5773 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/README.md +++ b/automotive/vehicle/aidl/impl/default_config/config/README.md @@ -159,6 +159,8 @@ We support the following constant types: * WindshieldWipersState +* WindshieldWipersSwitch + * Constants Every constant type except "Constants" corresponds to a enum defined in Vehicle diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 7b567abeb7..fc0c8db1e4 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -85,5 +85,6 @@ #include #include #include +#include #endif // android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_ diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index b075993418..cc06bf342b 100644 --- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -177,6 +177,7 @@ enum VehicleProperty { WINDOW_LOCK = (((0x0BC4 + 0x10000000) + 0x03000000) + 0x00200000) /* 320867268 */, WINDSHIELD_WIPERS_PERIOD = (((0x0BC5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964421 */, WINDSHIELD_WIPERS_STATE = (((0x0BC6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964422 */, + WINDSHIELD_WIPERS_SWITCH = (((0x0BC7 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964423 */, STEERING_WHEEL_DEPTH_POS = (((0x0BE0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410016 */, STEERING_WHEEL_DEPTH_MOVE = (((0x0BE1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410017 */, STEERING_WHEEL_HEIGHT_POS = (((0x0BE2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410018 */, diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl new file mode 100644 index 0000000000..6c170fe6a4 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2023 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum WindshieldWipersSwitch { + OTHER = 0, + OFF = 1, + MIST = 2, + INTERMITTENT_LEVEL_1 = 3, + INTERMITTENT_LEVEL_2 = 4, + INTERMITTENT_LEVEL_3 = 5, + INTERMITTENT_LEVEL_4 = 6, + INTERMITTENT_LEVEL_5 = 7, + CONTINUOUS_LEVEL_1 = 8, + CONTINUOUS_LEVEL_2 = 9, + CONTINUOUS_LEVEL_3 = 10, + CONTINUOUS_LEVEL_4 = 11, + CONTINUOUS_LEVEL_5 = 12, + AUTO = 13, + SERVICE = 14, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl index 267b3dc26d..473dffcf97 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -2131,6 +2131,31 @@ enum VehicleProperty { WINDSHIELD_WIPERS_STATE = 0x0BC6 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32, + /** + * Windshield wipers switch. + * + * Represents the position of the switch controlling the windshield wipers. The value of + * WINDSHIELD_WIPERS_SWITCH may not match the value of WINDSHIELD_WIPERS_STATE (e.g. + * WINDSHIELD_WIPERS_SWITCH = AUTO and WINDSHIELD_WIPERS_STATE = WindshieldWipersState#ON). + * + * For each supported area ID, the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states in WindshieldWipersSwitch are supported (including OTHER, which is not + * recommended). + * + * This property is defined as read_write, but OEMs have the option to implement it as read + * only. + * + * If this property is implemented as read_write and the OTHER state is listed in the + * VehicleAreaConfig#supportedEnumValues array, then OTHER is not a supported value for writing. + * It is only a supported value for reading. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum WindshieldWipersSwitch + */ + WINDSHIELD_WIPERS_SWITCH = + 0x0BC7 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32, + /** * Steering wheel depth position * diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl new file mode 100644 index 0000000000..911d7ebfa5 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current position of VehicleProperty#WINDSHIELD_WIPERS_SWITCH. + */ +@VintfStability +@Backing(type="int") +enum WindshieldWipersSwitch { + + /** + * This value is used as an alternative for any WindshieldWipersSwitch value that is not defined + * in the platform. Ideally, implementations of VehicleProperty#WINDSHIELD_WIPERS_SWITCH should + * not use this value. The framework can use this field to remain backwards compatible if + * WindshieldWipersSwitch is extended to include additional values. + */ + OTHER = 0, + /** + * The windshield wipers switch is set to the off position. + */ + OFF = 1, + /** + * MIST mode performs a single wipe, and then returns to the OFF position. + */ + MIST = 2, + /** + * INTERMITTENT_LEVEL_* modes performs intermittent wiping. As the level increases, the + * intermittent time period decreases. + */ + INTERMITTENT_LEVEL_1 = 3, + INTERMITTENT_LEVEL_2 = 4, + INTERMITTENT_LEVEL_3 = 5, + INTERMITTENT_LEVEL_4 = 6, + INTERMITTENT_LEVEL_5 = 7, + /** + * CONTINUOUS_LEVEL_* modes performs continuous wiping. As the level increases the speed of the + * wiping increases as well. + */ + CONTINUOUS_LEVEL_1 = 8, + CONTINUOUS_LEVEL_2 = 9, + CONTINUOUS_LEVEL_3 = 10, + CONTINUOUS_LEVEL_4 = 11, + CONTINUOUS_LEVEL_5 = 12, + /** + * AUTO allows the vehicle to decide the required wiping level based on the exterior weather + * conditions. + */ + AUTO = 13, + /** + * Windshield wipers are set to the service mode. + */ + SERVICE = 14, +} diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index cfed217e67..51cc3765da 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -612,6 +612,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersStateConfig) { VehicleArea::WINDOW, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersSwitchConfig) { + verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::WINDOW, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelDepthPosConfig) { verifyProperty(VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,