Loading automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ const std::unordered_map<std::string, int> CONSTANTS_BY_NAME = { #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES // Following are test properties: {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES}, {"VENDOR_PROPERTY_ID", VENDOR_PROPERTY_ID}, {"kMixedTypePropertyForTest", kMixedTypePropertyForTest}, {"VENDOR_CLUSTER_NAVIGATION_STATE", VENDOR_CLUSTER_NAVIGATION_STATE}, {"VENDOR_CLUSTER_REQUEST_DISPLAY", VENDOR_CLUSTER_REQUEST_DISPLAY}, Loading automotive/vehicle/aidl/impl/default_config/config/TestProperties.json +5 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,11 @@ "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { "property": "Constants::VENDOR_PROPERTY_ID", "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { "property": "VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION", "defaultValue": { Loading automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,8 @@ constexpr char OVERRIDE_CONFIG_DIR[] = "/vendor/etc/automotive/vhaloverride/"; // overwrite the default configs. constexpr char OVERRIDE_PROPERTY[] = "persist.vendor.vhal_init_value_override"; constexpr char POWER_STATE_REQ_CONFIG_PROPERTY[] = "ro.vendor.fake_vhal.ap_power_state_req.config"; // The value to be returned if VENDOR_PROPERTY_ID is set as the property constexpr int VENDOR_ERROR_CODE = 0x00ab0005; // A list of supported options for "--set" command. const std::unordered_set<std::string> SET_PROP_OPTIONS = { // integer. Loading Loading @@ -389,6 +390,9 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( case ECHO_REVERSE_BYTES: *isSpecialValue = true; return getEchoReverseBytes(value); case VENDOR_PROPERTY_ID: *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); default: // Do nothing. break; Loading Loading @@ -469,6 +473,9 @@ VhalResult<void> FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu case OBD2_FREEZE_FRAME_CLEAR: *isSpecialValue = true; return mFakeObd2Frame->clearObd2FreezeFrames(value); case VENDOR_PROPERTY_ID: *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES case toInt(VehicleProperty::CLUSTER_REPORT_STATE): Loading automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,11 @@ TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { continue; } if (propId == VENDOR_PROPERTY_ID) { // Ignore VENDOR_PROPERTY_ID, it has special logic. continue; } if (isGlobalProp(propId)) { if (config.initialValue == RawPropValues{}) { addGetValueRequest(getValueRequests, expectedGetValueResults, requestId++, Loading automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h +7 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,13 @@ constexpr int32_t ECHO_REVERSE_BYTES = 0x2a12 | toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | toInt(testpropertyutils_impl::VehiclePropertyType::BYTES); // This property is used for testing vendor error codes end to end. // 0x21402a13 constexpr int32_t VENDOR_PROPERTY_ID = 0x2a13 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | toInt(testpropertyutils_impl::VehiclePropertyType::INT32); // This property is used for test purpose. End to end tests use this property to test set and get // method for MIXED type properties. constexpr int32_t kMixedTypePropertyForTest = Loading Loading
automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ const std::unordered_map<std::string, int> CONSTANTS_BY_NAME = { #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES // Following are test properties: {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES}, {"VENDOR_PROPERTY_ID", VENDOR_PROPERTY_ID}, {"kMixedTypePropertyForTest", kMixedTypePropertyForTest}, {"VENDOR_CLUSTER_NAVIGATION_STATE", VENDOR_CLUSTER_NAVIGATION_STATE}, {"VENDOR_CLUSTER_REQUEST_DISPLAY", VENDOR_CLUSTER_REQUEST_DISPLAY}, Loading
automotive/vehicle/aidl/impl/default_config/config/TestProperties.json +5 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,11 @@ "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { "property": "Constants::VENDOR_PROPERTY_ID", "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { "property": "VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION", "defaultValue": { Loading
automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,8 @@ constexpr char OVERRIDE_CONFIG_DIR[] = "/vendor/etc/automotive/vhaloverride/"; // overwrite the default configs. constexpr char OVERRIDE_PROPERTY[] = "persist.vendor.vhal_init_value_override"; constexpr char POWER_STATE_REQ_CONFIG_PROPERTY[] = "ro.vendor.fake_vhal.ap_power_state_req.config"; // The value to be returned if VENDOR_PROPERTY_ID is set as the property constexpr int VENDOR_ERROR_CODE = 0x00ab0005; // A list of supported options for "--set" command. const std::unordered_set<std::string> SET_PROP_OPTIONS = { // integer. Loading Loading @@ -389,6 +390,9 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( case ECHO_REVERSE_BYTES: *isSpecialValue = true; return getEchoReverseBytes(value); case VENDOR_PROPERTY_ID: *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); default: // Do nothing. break; Loading Loading @@ -469,6 +473,9 @@ VhalResult<void> FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu case OBD2_FREEZE_FRAME_CLEAR: *isSpecialValue = true; return mFakeObd2Frame->clearObd2FreezeFrames(value); case VENDOR_PROPERTY_ID: *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES case toInt(VehicleProperty::CLUSTER_REPORT_STATE): Loading
automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,11 @@ TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { continue; } if (propId == VENDOR_PROPERTY_ID) { // Ignore VENDOR_PROPERTY_ID, it has special logic. continue; } if (isGlobalProp(propId)) { if (config.initialValue == RawPropValues{}) { addGetValueRequest(getValueRequests, expectedGetValueResults, requestId++, Loading
automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h +7 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,13 @@ constexpr int32_t ECHO_REVERSE_BYTES = 0x2a12 | toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | toInt(testpropertyutils_impl::VehiclePropertyType::BYTES); // This property is used for testing vendor error codes end to end. // 0x21402a13 constexpr int32_t VENDOR_PROPERTY_ID = 0x2a13 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | toInt(testpropertyutils_impl::VehiclePropertyType::INT32); // This property is used for test purpose. End to end tests use this property to test set and get // method for MIXED type properties. constexpr int32_t kMixedTypePropertyForTest = Loading