From b96e3766b974c7c78f5fb4f2e9559f7da8954589 Mon Sep 17 00:00:00 2001 From: shrikar Date: Tue, 8 Nov 2022 16:49:58 -0800 Subject: [PATCH] Added SEAT_AIRBAG_ENABLED to hardware layer. Bug: 257268798 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I60fbd303a5af6c25c9d242320865eb2cfd2ff61e --- .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 13 +++++++++++++ .../generated_lib/cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../default_config/config/DefaultProperties.json | 16 ++++++++++++++++ .../src/VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++++ 8 files changed, 40 insertions(+) diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index f93d76f3b5..6913ff14ea 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -156,6 +156,7 @@ enum VehicleProperty { SEAT_HEADREST_FORE_AFT_POS = 356518809, SEAT_HEADREST_FORE_AFT_MOVE = 356518810, SEAT_EASY_ACCESS_ENABLED = 354421661, + SEAT_AIRBAG_ENABLED = 354421662, SEAT_CUSHION_SIDE_SUPPORT_POS = 356518815, SEAT_OCCUPANCY = 356518832, WINDOW_POS = 322964416, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl index 245857b816..f9ee52d497 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -1732,6 +1732,19 @@ enum VehicleProperty { */ SEAT_EASY_ACCESS_ENABLED = 0x0B9D + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, + /** + * Represents feature to enable/disable a seat's ability to deploy airbag(s) when triggered + * (e.g. by a crash). + * + * If true, it means the seat's airbags are enabled, and if triggered (e.g. by a crash), they + * will deploy. If false, it means the seat's airbags are disabled, and they will not deploy + * under any circumstance. This property does not indicate if the airbags are deployed or not. + * + * This property can be set to VehiclePropertyAccess.READ read only for the sake of regulation + * or safety concerns. + */ + SEAT_AIRBAG_ENABLED = + 0x0B9E + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, /** * Represents property for seat’s hipside (bottom cushion’s side) support position. * diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index e3a3f0b16f..9435a417ad 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -156,6 +156,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyAccess::READ}, {VehicleProperty::WINDOW_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 51cb60a7ac..730d03ebdd 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -156,6 +156,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::WINDOW_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 4d10d50d29..f73d94a9b8 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -148,6 +148,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.WINDOW_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 162b8d2216..ee650b7fcf 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -148,6 +148,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.WINDOW_POS, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 5a0f4a30c0..7cbf8f97b6 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -1051,6 +1051,22 @@ } ] }, + { + "property": "VehicleProperty::SEAT_AIRBAG_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + } + ] + }, { "property": "VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS", "defaultValue": { diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index d57ef64d0b..2b2ef80f39 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -541,6 +541,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatEasyAccessEnabledConfig) { VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagEnabledConfig) { + verifyProperty(VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatCushionSideSupportPosConfig) { verifyProperty(VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,