From 6a553afeecd2625d09ef401005c860f32ae367a1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 15 Jun 2022 20:54:17 +0000 Subject: [PATCH] Add support for GSR property in HIDL ref VHAL. Test: Presubmit Bug: 236135569 Merged-In: I3788b66aa409304927e8f5af371c049cb1bcd58e (cherry-picked from I3788b66aa409304927e8f5af371c049cb1bcd58e) Change-Id: I3788b66aa409304927e8f5af371c049cb1bcd58e --- .../2.0/default/impl/vhal_v2_0/DefaultConfig.h | 13 +++++++++++++ .../impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index cfbbbd3224..e276a39314 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h @@ -1109,6 +1109,19 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.stringValue = {"Test"}}, }, + // This property is later defined in the AIDL VHAL interface. However, HIDL VHAL might + // require support for this property to meet EU regulation. + { + .config = + { + // GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT + .prop = 0x11400F47, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + // GsrComplianceRequirementType::GSR_COMPLIANCE_REQUIRED_V1 + .initialValue = {.int32Values = {1}}, + }, #ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING // Vendor propetry for E2E ClusterHomeService testing. { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp index e3c8dd6c79..d35792d4b2 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp @@ -141,7 +141,7 @@ class DefaultVhalImplTest : public ::testing::Test { TEST_F(DefaultVhalImplTest, testListProperties) { std::vector configs = mHal->listProperties(); - EXPECT_EQ((size_t)121, configs.size()); + EXPECT_EQ((size_t)122, configs.size()); } TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) {