Merge "Removing DRIVER_ATTENTION_MONITORING properties from HAL layer." into udc-dev

This commit is contained in:
Shrikar Amirisetty
2023-03-16 23:53:20 +00:00
committed by Android (Google) Code Review
14 changed files with 2 additions and 319 deletions

View File

@@ -272,9 +272,6 @@ std::unordered_map<VehicleProperty, VehiclePropertyAccess> AccessForVehiclePrope
{VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess::READ},
{VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess::READ},
{VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::DRIVER_ATTENTION_MONITORING_STATE, VehiclePropertyAccess::READ},
{VehicleProperty::DRIVER_ATTENTION_MONITORING_WARNING, VehiclePropertyAccess::READ},
};
} // namespace vehicle

View File

@@ -272,9 +272,6 @@ std::unordered_map<VehicleProperty, VehiclePropertyChangeMode> ChangeModeForVehi
{VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::DRIVER_ATTENTION_MONITORING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::DRIVER_ATTENTION_MONITORING_WARNING, VehiclePropertyChangeMode::ON_CHANGE},
};
} // namespace vehicle

View File

@@ -263,10 +263,7 @@ public final class AccessForVehicleProperty {
Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_STATE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_WARNING, VehiclePropertyAccess.READ)
Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess.READ)
);
}

View File

@@ -263,10 +263,7 @@ public final class ChangeModeForVehicleProperty {
Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyChangeMode.CONTINUOUS),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_WARNING, VehiclePropertyChangeMode.ON_CHANGE)
Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE)
);
}

View File

@@ -41,8 +41,6 @@ using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProper
using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand;
using ::aidl::android::hardware::automotive::vehicle::CruiseControlState;
using ::aidl::android::hardware::automotive::vehicle::CruiseControlType;
using ::aidl::android::hardware::automotive::vehicle::DriverAttentionMonitoringState;
using ::aidl::android::hardware::automotive::vehicle::DriverAttentionMonitoringWarning;
using ::aidl::android::hardware::automotive::vehicle::EmergencyLaneKeepAssistState;
using ::aidl::android::hardware::automotive::vehicle::ErrorState;
using ::aidl::android::hardware::automotive::vehicle::EvConnectorType;
@@ -245,10 +243,6 @@ JsonValueParser::JsonValueParser() {
std::make_unique<ConstantParser<HandsOnDetectionDriverState>>();
mConstantParsersByType["HandsOnDetectionWarning"] =
std::make_unique<ConstantParser<HandsOnDetectionWarning>>();
mConstantParsersByType["DriverAttentionMonitoringState"] =
std::make_unique<ConstantParser<DriverAttentionMonitoringState>>();
mConstantParsersByType["DriverAttentionMonitoringWarning"] =
std::make_unique<ConstantParser<DriverAttentionMonitoringWarning>>();
mConstantParsersByType["ErrorState"] = std::make_unique<ConstantParser<ErrorState>>();
mConstantParsersByType["AutomaticEmergencyBrakingState"] =
std::make_unique<ConstantParser<AutomaticEmergencyBrakingState>>();

View File

@@ -3536,50 +3536,6 @@
}
]
},
{
"property": "VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED",
"defaultValue": {
"int32Values": [
1
]
}
},
{
"property": "VehicleProperty::DRIVER_ATTENTION_MONITORING_STATE",
"defaultValue": {
"int32Values": [
"DriverAttentionMonitoringState::NOT_DISTRACTED"
]
},
"areas": [
{
"areaId": 0,
"supportedEnumValues": [
"ErrorState::NOT_AVAILABLE_DISABLED",
"DriverAttentionMonitoringState::DISTRACTED",
"DriverAttentionMonitoringState::NOT_DISTRACTED"
]
}
]
},
{
"property": "VehicleProperty::DRIVER_ATTENTION_MONITORING_WARNING",
"defaultValue": {
"int32Values": [
"DriverAttentionMonitoringWarning::NO_WARNING"
]
},
"areas": [
{
"areaId": 0,
"supportedEnumValues": [
"ErrorState::NOT_AVAILABLE_DISABLED",
"DriverAttentionMonitoringWarning::NO_WARNING",
"DriverAttentionMonitoringWarning::WARNING"
]
}
]
},
{
"property": "VehicleProperty::INITIAL_USER_INFO"
},

View File

@@ -24,8 +24,6 @@
#include <aidl/android/hardware/automotive/vehicle/CruiseControlType.h>
#include <aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.h>
#include <aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.h>
#include <aidl/android/hardware/automotive/vehicle/DriverAttentionMonitoringState.h>
#include <aidl/android/hardware/automotive/vehicle/DriverAttentionMonitoringWarning.h>
#include <aidl/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.h>
#include <aidl/android/hardware/automotive/vehicle/ErrorState.h>
#include <aidl/android/hardware/automotive/vehicle/EvConnectorType.h>

View File

@@ -1,40 +0,0 @@
/*
* 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 <name>-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 DriverAttentionMonitoringState {
OTHER = 0,
DISTRACTED = 1,
NOT_DISTRACTED = 2,
}

View File

@@ -1,40 +0,0 @@
/*
* 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 <name>-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 DriverAttentionMonitoringWarning {
OTHER = 0,
NO_WARNING = 1,
WARNING = 2,
}

View File

@@ -270,7 +270,4 @@ enum VehicleProperty {
HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */,
HANDS_ON_DETECTION_DRIVER_STATE = (((0x1017 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411095 */,
HANDS_ON_DETECTION_WARNING = (((0x1018 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411096 */,
DRIVER_ATTENTION_MONITORING_ENABLED = (((0x1019 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313945 */,
DRIVER_ATTENTION_MONITORING_STATE = (((0x101A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411098 */,
DRIVER_ATTENTION_MONITORING_WARNING = (((0x101B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411099 */,
}

View File

@@ -1,43 +0,0 @@
/*
* 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 driver state of Driver Attention Monitoring.
*
* This enum could be extended in future releases to include additional feature states.
*/
@VintfStability
@Backing(type="int")
enum DriverAttentionMonitoringState {
/**
* This state is used as an alternative for any DriverAttentionMonitoringState value that is
* not defined in the platform. Ideally, implementations of
* VehicleProperty#DRIVER_ATTENTION_MONITORING_STATE should not use this state. The
* framework can use this field to remain backwards compatible if DriverAttentionMonitoringState
* is extended to include additional states.
*/
OTHER = 0,
/**
* The system detects that the driver is distracted.
*/
DISTRACTED = 1,
/**
* The system detects that the driver is attentive / not distracted.
*/
NOT_DISTRACTED = 2,
}

View File

@@ -1,43 +0,0 @@
/*
* 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 warning state of Driver Attention Monitoring.
*/
@VintfStability
@Backing(type="int")
enum DriverAttentionMonitoringWarning {
/**
* This state is used as an alternative for any DriverAttentionMonitoringWarning value that is
* defined in the platform. Ideally, implementations of
* VehicleProperty#DRIVER_ATTENTION_MONITORING_WARNING should not use this state. The framework
* can use this field to remain backwards compatible if DriverAttentionMonitoringWarning is
* extended to include additional states.
*/
OTHER = 0,
/**
* Driver Attention Monitoring is enabled and the driver's current state does not warrant
* sending a warning.
*/
NO_WARNING = 1,
/**
* Driver Attention Monitoring is enabled and the driver has been distracted for too long of a
* duration, and the vehicle is sending a warning to the driver as a consequence of this.
*/
WARNING = 2,
}

View File

@@ -4169,72 +4169,6 @@ enum VehicleProperty {
HANDS_ON_DETECTION_WARNING =
0x1018 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
/**
* Enable or disable driver attention monitoring.
*
* Set true to enable driver attention monitoring and false to disable driver attention
* monitoring. When driver attention monitoring is enabled, a system inside the vehicle should
* be monitoring the attention level of the driver and should send a warning if it detects that
* the driver is distracted.
*
* In general, DRIVER_ATTENTION_MONITORING_ENABLED should always return true or false. If the
* feature is not available due to some temporary state, that information must be conveyed
* through the ErrorState values in the DRIVER_ATTENTION_MONITORING_STATE property.
*
* This property is defined as read_write, but OEMs have the option to implement it as read
* only.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
*/
DRIVER_ATTENTION_MONITORING_ENABLED =
0x1019 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
/**
* Driver attention monitoring state.
*
* Returns whether the driver is currently attentive or distracted. Generally, this property
* should return a valid state defined in the DriverAttentionMonitoringState or ErrorState. For
* example, if the feature is not available due to some temporary state, that information should
* be conveyed through an ErrorState.
*
* If the vehicle wants to send a warning to the user because the driver has been distracted for
* too long, the warning should be surfaced through DRIVER_ATTENTION_MONITORING_WARNING.
*
* The VehicleAreaConfig#configArray array must define all states from
* DriverAttentionMonitoringState (including OTHER, which is not recommended) and ErrorState
* that are supported.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum DriverAttentionMonitoringState
* @data_enum ErrorState
*/
DRIVER_ATTENTION_MONITORING_STATE =
0x101A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
/**
* Driver attention monitoring warning.
*
* Returns whether a warning is being sent to the driver for being distracted for too long a
* duration.
*
* Generally, this property should return a valid state defined in the
* DriverAttentionMonitoringWarning or ErrorState. For example, if the feature is not available
* due to some temporary state, that information should be conveyed through an ErrorState.
*
* For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
* unless all states of both DriverAttentionMonitoringWarning (including OTHER, which is not
* recommended) and ErrorState are supported.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum DriverAttentionMonitoringWarning
* @data_enum ErrorState
*/
DRIVER_ATTENTION_MONITORING_WARNING =
0x101B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
/***************************************************************************
* End of ADAS Properties
**************************************************************************/

View File

@@ -601,24 +601,6 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionWarningConfig) {
VehicleArea::GLOBAL, VehiclePropertyType::INT32);
}
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverAttentionMonitoringEnabledConfig) {
verifyProperty(VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED,
VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
}
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverAttentionMonitoringStateConfig) {
verifyProperty(VehicleProperty::DRIVER_ATTENTION_MONITORING_STATE, VehiclePropertyAccess::READ,
VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
VehicleArea::GLOBAL, VehiclePropertyType::INT32);
}
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverAttentionMonitoringWarningConfig) {
verifyProperty(VehicleProperty::DRIVER_ATTENTION_MONITORING_WARNING,
VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
}
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) {
verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL,
VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,