From db03444d5a26ac184d5b3c2eb38c1f5aa2196358 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Tue, 10 Jan 2023 18:14:28 -0800 Subject: [PATCH 1/7] Add HAL changes for LANE_CENTERING_ASSIST_STATE This property supports error states in addition to its own state. This is why the comments mention two @data_enums for this property. This works because states are integer values so as long as all states have distinct integer values, this functions correctly. Bug: 264946042 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Test: atest CtsCarTestCases:LaneCenteringAssistStateTest Test: atest AndroidCarApiTest:LaneCenteringAssistStateTest Change-Id: I3f805bedff35eef2731a7d9fc0bec593e3c639a3 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 26 ++++++- .../aidl/impl/default_config/config/README.md | 2 + .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/LaneCenteringAssistState.aidl | 43 ++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/LaneCenteringAssistState.aidl | 70 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 22 ++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 13 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 68641ab617..e488951ce1 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -250,6 +250,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 96105da51e..133e7a9d22 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -250,6 +250,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index e25af0f3cd..4f072cf478 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -242,6 +242,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 207f6c76bc..23015035ef 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -242,6 +242,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, 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 aa8fd83e8c..9bf575014e 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -45,6 +45,7 @@ using ::aidl::android::hardware::automotive::vehicle::EvsServiceType; using ::aidl::android::hardware::automotive::vehicle::ForwardCollisionWarningState; using ::aidl::android::hardware::automotive::vehicle::FuelType; using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType; +using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState; using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; @@ -221,6 +222,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["LaneKeepAssistState"] = std::make_unique>(); + mConstantParsersByType["LaneCenteringAssistState"] = + std::make_unique>(); mConstantParsersByType["Constants"] = std::make_unique(); } diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index d9958966f1..da9eaaffe0 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3288,9 +3288,33 @@ "property": "VehicleProperty::LANE_CENTERING_ASSIST_ENABLED", "defaultValue": { "int32Values": [ - 0 + 1 ] } + }, + { + "property": "VehicleProperty::LANE_CENTERING_ASSIST_STATE", + "defaultValue": { + "int32Values": [ + "LaneCenteringAssistState::ENABLED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "LaneCenteringAssistState::ENABLED", + "LaneCenteringAssistState::ACTIVATION_REQUESTED", + "LaneCenteringAssistState::ACTIVATED", + "LaneCenteringAssistState::USER_OVERRIDE", + "LaneCenteringAssistState::FORCED_DEACTIVATION_WARNING" + ] + } + ] } ] } diff --git a/automotive/vehicle/aidl/impl/default_config/config/README.md b/automotive/vehicle/aidl/impl/default_config/config/README.md index e04710105c..6f0785f695 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/README.md +++ b/automotive/vehicle/aidl/impl/default_config/config/README.md @@ -149,6 +149,8 @@ We support the following constant types: * LaneKeepAssistState +* LaneCenteringAssistState + * ErrorState * Constants diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 0fc3215934..950b3a061c 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl new file mode 100644 index 0000000000..c5afe2be1a --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl @@ -0,0 +1,43 @@ +/* + * 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 LaneCenteringAssistState { + OTHER = 0, + ENABLED = 1, + ACTIVATION_REQUESTED = 2, + ACTIVATED = 3, + USER_OVERRIDE = 4, + FORCED_DEACTIVATION_WARNING = 5, +} 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 941c0ae78b..930fbd853c 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 @@ -248,6 +248,7 @@ enum VehicleProperty { LANE_KEEP_ASSIST_ENABLED = (((0x1008 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313928 */, LANE_KEEP_ASSIST_STATE = (((0x1009 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411081 */, LANE_CENTERING_ASSIST_ENABLED = (((0x100A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313930 */, + LANE_CENTERING_ASSIST_STATE = (((0x100C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411084 */, EMERGENCY_LANE_KEEP_ASSIST_ENABLED = (((0x100D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313933 */, ADAPTIVE_CRUISE_CONTROL_ENABLED = (((0x100F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313935 */, HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl new file mode 100644 index 0000000000..340a669d2d --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl @@ -0,0 +1,70 @@ +/* + * 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 state of Lane Centering Assist (LCA). + */ +@VintfStability +@Backing(type="int") +enum LaneCenteringAssistState { + + /** + * This state is used as an alternative for any LaneCenteringAssistState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#LANE_CENTERING_ASSIST_STATE should not use this state. The framework + * can use this field to remain backwards compatible if LaneCenteringAssistState is + * extended to include additional states. + */ + OTHER = 0, + /** + * LCA is enabled but the ADAS system has not received an activation signal from the driver. + * Therefore, LCA is not steering the car and waits for the driver to send a + * LaneCenteringAssistCommand#ACTIVATE command. + */ + ENABLED = 1, + /** + * LCA is enabled and the driver has sent an activation command to the LCA system, but the + * system has not started actively steering the vehicle. This may happen when LCA needs time to + * detect valid lane lines. The activation command can be sent through the + * VehicleProperty#LANE_CENTERING_ASSIST_COMMAND vehicle property or through a system external + * to Android. Once LCA is actively steering the vehicle, the state must be updated to + * ACTIVATED. If the feature is not able to activate, then the cause can be communicated through + * the ErrorState values and then return to the ENABLED state. + */ + ACTIVATION_REQUESTED = 2, + /** + * LCA is enabled and actively steering the car to keep it centered in its lane. + */ + ACTIVATED = 3, + /** + * Many LCA implementations allow the driver to override LCA. This means that the car has + * determined it should go a certain direction to keep the car centered in the lane, but a user + * decides to take over and do something else. This is often done for safety reasons and to + * ensure that the driver can always take control of the vehicle. This state should be set when + * the user is actively overriding the LCA system. + */ + USER_OVERRIDE = 4, + /** + * When LCA is in the ACTIVATED state but it will potentially need to deactivate because of + * external conditions (e.g. roads curvature is too extreme, the driver does not have their + * hands on the steering wheel for a long period of time, or the driver is not paying + * attention), then the ADAS system will notify the driver of a potential need to deactivate and + * give control back to the driver. + */ + FORCED_DEACTIVATION_WARNING = 5, +} 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 8f52d850af..400c1cee77 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3652,6 +3652,28 @@ enum VehicleProperty { LANE_CENTERING_ASSIST_ENABLED = 0x100A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Lane Centering Assist (LCA) state. + * + * Returns the current state of LCA. This property must always return a valid state defined in + * LaneCenteringAssistState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * If LCA includes lane departure warnings, those warnings must be surfaced through the Lane + * Departure Warning (LDW) properties. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both LaneCenteringAssistState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum LaneCenteringAssistState + * @data_enum ErrorState + */ + LANE_CENTERING_ASSIST_STATE = + 0x100C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /* * Enable or disable emergency lane keep assist (ELKA). * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 57b57e9eaf..0215907412 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -738,6 +738,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistEnabledConfig VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistStateConfig) { + verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + std::vector getDescriptors() { std::vector descriptors; for (std::string name : getAidlHalInstanceNames(IVehicle::descriptor)) { From f5b63fcf1380dfce3b2eef788b9d939297cd69f0 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Tue, 10 Jan 2023 18:19:38 -0800 Subject: [PATCH 2/7] Update LANE_CENTERING_ASSIST_ENABLED documentation in HAL Temporary errors should be conveyed through ErrorState values in the STATE property. Bug: 264946042 Test: presubmit Change-Id: Idfd427fb69948f81307c29acd6285826e2cada99 --- .../android/hardware/automotive/vehicle/VehicleProperty.aidl | 5 +++++ 1 file changed, 5 insertions(+) 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 400c1cee77..d8ffecec00 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3643,6 +3643,11 @@ enum VehicleProperty { * drifts toward or over the lane marking. If an unintentional lane departure is detected, the * system applies steering control to return the vehicle into the current lane. * + * In general, LANE_CENTERING_ASSIST_ENABLED should always return true or false. If the feature + * is not available due to some temporary state, such as the vehicle speed being too low or too + * high, that information must be conveyed through the ErrorState values in the + * LANE_CENTERING_ASSIST_STATE property. + * * This property is defined as read_write, but OEMs have the option to implement it as read * only. * From 0ffd39c1e40d85e7c19fae713de602cf4cba42db Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Wed, 11 Jan 2023 12:19:10 -0800 Subject: [PATCH 3/7] Add HAL changes for LANE_CENTERING_ASSIST_COMMAND Bug: 264946354 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Test: atest CtsCarTestCases:LaneCenteringAssistCommandTest Test: atest AndroidCarApiTest:LaneCenteringAssistCommandTest Change-Id: I126ed24748f9ef7cd9bc0541e2bdbf75eac43edf --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 ++ .../config/DefaultProperties.json | 3 ++ .../aidl/impl/default_config/config/README.md | 2 + .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/LaneCenteringAssistCommand.aidl | 39 ++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/LaneCenteringAssistCommand.aidl | 44 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 24 ++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++ 13 files changed, 127 insertions(+) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index e488951ce1..da10cf4d15 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -250,6 +250,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE}, {VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 133e7a9d22..f1e941266e 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -250,6 +250,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 4f072cf478..10facb57c0 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -242,6 +242,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess.WRITE), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 23015035ef..bcc4b92488 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -242,6 +242,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_ENABLED, 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 9bf575014e..943cf88fab 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -45,6 +45,7 @@ using ::aidl::android::hardware::automotive::vehicle::EvsServiceType; using ::aidl::android::hardware::automotive::vehicle::ForwardCollisionWarningState; using ::aidl::android::hardware::automotive::vehicle::FuelType; using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType; +using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand; using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState; using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; @@ -222,6 +223,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["LaneKeepAssistState"] = std::make_unique>(); + mConstantParsersByType["LaneCenteringAssistCommand"] = + std::make_unique>(); mConstantParsersByType["LaneCenteringAssistState"] = std::make_unique>(); mConstantParsersByType["Constants"] = std::make_unique(); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index da9eaaffe0..cde7bab17a 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3292,6 +3292,9 @@ ] } }, + { + "property": "VehicleProperty::LANE_CENTERING_ASSIST_COMMAND" + }, { "property": "VehicleProperty::LANE_CENTERING_ASSIST_STATE", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/default_config/config/README.md b/automotive/vehicle/aidl/impl/default_config/config/README.md index 6f0785f695..360018fc1e 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/README.md +++ b/automotive/vehicle/aidl/impl/default_config/config/README.md @@ -149,6 +149,8 @@ We support the following constant types: * LaneKeepAssistState +* LaneCenteringAssistCommand + * LaneCenteringAssistState * ErrorState diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 950b3a061c..bba3242754 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl new file mode 100644 index 0000000000..9e726052e8 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl @@ -0,0 +1,39 @@ +/* + * 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 LaneCenteringAssistCommand { + ACTIVATE = 1, + DEACTIVATE = 2, +} 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 930fbd853c..51a3d187d4 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 @@ -248,6 +248,7 @@ enum VehicleProperty { LANE_KEEP_ASSIST_ENABLED = (((0x1008 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313928 */, LANE_KEEP_ASSIST_STATE = (((0x1009 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411081 */, LANE_CENTERING_ASSIST_ENABLED = (((0x100A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313930 */, + LANE_CENTERING_ASSIST_COMMAND = (((0x100B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411083 */, LANE_CENTERING_ASSIST_STATE = (((0x100C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411084 */, EMERGENCY_LANE_KEEP_ASSIST_ENABLED = (((0x100D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313933 */, ADAPTIVE_CRUISE_CONTROL_ENABLED = (((0x100F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313935 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl new file mode 100644 index 0000000000..d8b0e65857 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl @@ -0,0 +1,44 @@ +/* + * 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 by Lane Centering Assist (LCA) to enumerate commands. + */ +@VintfStability +@Backing(type="int") +enum LaneCenteringAssistCommand { + /** + * When VehicleProperty#LANE_CENTERING_ASSIST_STATE = LaneCenteringAssistState#ENABLED, this + * command sends a request to activate steering control that keeps the vehicle centered in its + * lane. While waiting for the LCA System to take control of the vehicle, + * VehicleProperty#LANE_CENTERING_ASSIST_STATE must be in the + * LaneCenteringAssistState#ACTIVATION_REQUESTED state. Once the vehicle takes control of + * steering, then VehicleProperty#LANE_CENTERING_ASSIST_STATE must be in the + * LaneCenteringAssistState#ACTIVATED state. Otherwise, an error can be communicated through an + * ErrorState value. + */ + ACTIVATE = 1, + /** + * When VehicleProperty#LANE_CENTERING_ASSIST_STATE is set to + * LaneCenteringAssistState#ACTIVATION_REQUESTED or LaneCenteringAssistState#ACTIVATED, this + * command deactivates steering control and the driver should take full control of the vehicle. + * If this command succeeds, VehicleProperty#LANE_CENTERING_ASSIST_STATE must be updated to + * LaneCenteringAssistState#ENABLED. + */ + DEACTIVATE = 2, +} 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 d8ffecec00..2f8c41b8d9 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3657,6 +3657,30 @@ enum VehicleProperty { LANE_CENTERING_ASSIST_ENABLED = 0x100A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Lane Centering Assist (LCA) commands. + * + * Commands to activate and suspend LCA. They are only valid when LANE_CENTERING_ASSIST_ENABLED + * = true. Otherwise, these commands must return StatusCode#NOT_AVAILABLE or + * StatusCode#NOT_AVAILABLE_DISABLED. + * + * When the command ACTIVATE from LaneCenteringAssistCommmand is sent, + * LANE_CENTERING_ASSIST_STATE must be set to LaneCenteringAssistState#ACTIVATION_REQUESTED. + * When the ACTIVATE command succeeds, LANE_CENTERING_ASSIST_STATE must be set to + * LaneCenteringAssistState#ACTIVATED. When the command DEACTIVATE from + * LaneCenteringAssistCommmand succeeds, LANE_CENTERING_ASSIST_STATE must be set to + * LaneCenteringAssistState#ENABLED. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless + * all enum values of LaneCenteringAssistCommand are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + * @data_enum LaneCenteringAssistCommmand + */ + LANE_CENTERING_ASSIST_COMMAND = + 0x100B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** * Lane Centering Assist (LCA) state. * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 0215907412..7ab9b65d4f 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -738,6 +738,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistEnabledConfig VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistCommandConfig) { + verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistStateConfig) { verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, From 8462db58590558a78fb7fd12fd63c6319b11fff4 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Fri, 27 Jan 2023 19:59:49 -0800 Subject: [PATCH 4/7] Add HAL changes for LANE_DEPARTURE_WARNING_STATE This property supports error states in addition to its own state. This is why the comments mention two @data_enums for this property. This works because states are integer values so as long as all states have distinct integer values, this functions correctly. Bug: 266998630 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Test: atest CtsCarTestCases:LaneDepartureWarningStateTest Test: atest AndroidCarApiTest:LaneDepartureWarningStateTest Change-Id: Ic26fcfe8b41bb44a851daf59d64f0ceb536333c3 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 ++ .../config/DefaultProperties.json | 24 +++++++++- .../aidl/impl/default_config/config/README.md | 2 + .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/LaneDepartureWarningState.aidl | 41 ++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/LaneDepartureWarningState.aidl | 48 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 19 ++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++ 13 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index da10cf4d15..21478522f9 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -247,6 +247,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index f1e941266e..19113b11df 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -247,6 +247,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 10facb57c0..d1de770e9b 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -239,6 +239,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index bcc4b92488..4debdc59da 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -239,6 +239,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.BLIND_SPOT_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, 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 943cf88fab..edacca002e 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -47,6 +47,7 @@ using ::aidl::android::hardware::automotive::vehicle::FuelType; using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType; using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand; using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState; +using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState; using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; @@ -221,6 +222,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["BlindSpotWarningState"] = std::make_unique>(); + mConstantParsersByType["LaneDepartureWarningState"] = + std::make_unique>(); mConstantParsersByType["LaneKeepAssistState"] = std::make_unique>(); mConstantParsersByType["LaneCenteringAssistCommand"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index cde7bab17a..4246ea1e76 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3249,10 +3249,32 @@ "property": "VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED", "defaultValue": { "int32Values": [ - 0 + 1 ] } }, + { + "property": "VehicleProperty::LANE_DEPARTURE_WARNING_STATE", + "defaultValue": { + "int32Values": [ + "LaneDepartureWarningState::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "LaneDepartureWarningState::NO_WARNING", + "LaneDepartureWarningState::WARNING_LEFT", + "LaneDepartureWarningState::WARNING_RIGHT" + ] + } + ] + }, { "property": "VehicleProperty::LANE_KEEP_ASSIST_ENABLED", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/default_config/config/README.md b/automotive/vehicle/aidl/impl/default_config/config/README.md index 360018fc1e..ff5a2e24de 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/README.md +++ b/automotive/vehicle/aidl/impl/default_config/config/README.md @@ -147,6 +147,8 @@ We support the following constant types: * BlindSpotWarningState +* LaneDepartureWarningState + * LaneKeepAssistState * LaneCenteringAssistCommand diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index bba3242754..ef715cc2fe 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl new file mode 100644 index 0000000000..cdddb6f2d2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl @@ -0,0 +1,41 @@ +/* + * 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 LaneDepartureWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING_LEFT = 2, + WARNING_RIGHT = 3, +} 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 51a3d187d4..5b7524d2bf 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 @@ -245,6 +245,7 @@ enum VehicleProperty { BLIND_SPOT_WARNING_ENABLED = (((0x1004 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313924 */, BLIND_SPOT_WARNING_STATE = (((0x1005 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 339742725 */, LANE_DEPARTURE_WARNING_ENABLED = (((0x1006 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313926 */, + LANE_DEPARTURE_WARNING_STATE = (((0x1007 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411079 */, LANE_KEEP_ASSIST_ENABLED = (((0x1008 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313928 */, LANE_KEEP_ASSIST_STATE = (((0x1009 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411081 */, LANE_CENTERING_ASSIST_ENABLED = (((0x100A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313930 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl new file mode 100644 index 0000000000..c12c5765ad --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl @@ -0,0 +1,48 @@ +/* + * 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 state of Lane Departure Warning (LDW). + */ +@VintfStability +@Backing(type="int") +enum LaneDepartureWarningState { + + /** + * This state is used as an alternative for any LaneDepartureWarningState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#LANE_DEPARTURE_WARNING_STATE should not use this state. The framework + * can use this field to remain backwards compatible if LaneDepartureWarningState is + * extended to include additional states. + */ + OTHER = 0, + /** + * LDW is enabled and monitoring, but the vehicle is centered in the lane. + */ + NO_WARNING = 1, + /** + * LDW is enabled, detects the vehicle is approaching or crossing lane lines on the left side + * of the vehicle, and is currently warning the user. + */ + WARNING_LEFT = 2, + /** + * LDW is enabled, detects the vehicle is approaching or crossing lane lines on the right side + * of the vehicle, and is currently warning the user. + */ + WARNING_RIGHT = 3, +} 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 2f8c41b8d9..82b38b8d4b 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3584,6 +3584,25 @@ enum VehicleProperty { LANE_DEPARTURE_WARNING_ENABLED = 0x1006 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Lane Departure Warning (LDW) state. + * + * Returns the current state of LDW. This property must always return a valid state defined in + * LaneDepartureWarningState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both LaneDepartureWarningState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum LaneDepartureWarningState + * @data_enum ErrorState + */ + LANE_DEPARTURE_WARNING_STATE = + 0x1007 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** * Enable or disable Lane Keep Assist (LKA). * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 7ab9b65d4f..b1afaa767a 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -720,6 +720,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningEnabledConfi VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningStateConfig) { + verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneKeepAssistEnabledConfig) { verifyProperty(VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, From 162976161adb5fc70f172cf0b749ae23ccf733e8 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Mon, 30 Jan 2023 07:30:29 -0800 Subject: [PATCH 5/7] Update LANE_DEPARTURE_WARNING_ENABLED documentation in HAL Temporary errors should be conveyed through ErrorState values in the STATE property. Bug: 266998630 Test: presubmit Change-Id: If1acfe2454d552b2339c636cd7d790fa42f3bc10 --- .../android/hardware/automotive/vehicle/VehicleProperty.aidl | 5 +++++ 1 file changed, 5 insertions(+) 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 82b38b8d4b..803e093981 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3575,6 +3575,11 @@ enum VehicleProperty { * vehicle should be turned on and monitoring if the vehicle is approaching or crossing lane * lines, in which case a warning will be given. * + * In general, LANE_DEPARTURE_WARNING_ENABLED should always return true or false. If the feature + * is not available due to some temporary state, such as the vehicle speed being too low or too + * high, that information must be conveyed through the ErrorState values in the + * LANE_DEPARTURE_WARNING_STATE property. + * * This property is defined as read_write, but OEMs have the option to implement it as read * only. * From d76f8458a6a32c0c4bb601a163db6fd0b69e82b4 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Thu, 9 Feb 2023 10:08:13 -0800 Subject: [PATCH 6/7] Update AUTOMATIC_EMERGENCY_BRAKING_ENABLED documentation in HAL Temporary errors should be conveyed through ErrorState values in the STATE property. Bug: 264336118 Test: presubmit Change-Id: I28de0aceaabb33647085d80b79da215da4a146cf --- .../hardware/automotive/vehicle/VehicleProperty.aidl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 803e093981..269408e74a 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3457,9 +3457,10 @@ enum VehicleProperty { * Set true to enable AEB and false to disable AEB. When AEB is enabled, the ADAS system in the * vehicle should be turned on and monitoring to avoid potential collisions. * - * If AEB is not available, IVehicle#get must not return any NOT_AVAILABLE value in StatusCode. - * Other StatusCode values like TRY_AGAIN may still be used as needed. For example, if AEB is - * not available because the vehicle speed is too low, IVehicle#get must return false. + * In general, AUTOMATIC_EMERGENCY_BRAKING_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * low, that information must be conveyed through the ErrorState values in the + * AUTOMATIC_EMERGENCY_BRAKING_STATE property. * * This property is defined as read_write, but OEMs have the option to implement it as read * only. From 326c88dd0f4d0cc7bba5a1a43651221ccdab3ef8 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Thu, 9 Feb 2023 10:14:34 -0800 Subject: [PATCH 7/7] Update FORWARD_COLLISION_WARNING_ENABLED documentation in HAL Temporary errors should be conveyed through ErrorState values in the STATE property. Bug: 264946034 Test: presubmit Change-Id: I720dd691bc859d3113fa48f0f5b9a0b4a909d952 --- .../hardware/automotive/vehicle/VehicleProperty.aidl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 269408e74a..92dc8a7b55 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3499,9 +3499,10 @@ enum VehicleProperty { * Set true to enable FCW and false to disable FCW. When FCW is enabled, the ADAS system in the * vehicle should be turned on and monitoring for potential collisions. * - * If FCW is not available, IVehicle#get must not return any NOT_AVAILABLE value in StatusCode. - * Other StatusCode values like TRY_AGAIN may still be used as needed. For example, if FCW is - * not available because the vehicle speed is too low, IVehicle#get must return false. + * In general, FORWARD_COLLISION_WARNING_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * low, that information must be conveyed through the ErrorState values in the + * FORWARD_COLLISION_WARNING_STATE property. * * This property is defined as read_write, but OEMs have the option to implement it as read * only.