Convert Vehicle Property to integer
This make sense for easier extending Vehicle Hal interface
by OEMs and creating new versions.
Test: adb shell "su system /data/nativetest/android.hardware.vehicle@2.0-manager-unit-tests/android.hardware.vehicle@2.0-manager-unit-tests" ; ENABLE_TREBLE=true make vts BUILD_GOOGLE_VTS=true -j32 && vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VehicleHidlTest -l INFO
Change-Id: I02415a1c180a6d24fded48a1583f7cb150419820
Fix: b/34894217
diff --git a/vehicle/2.0/default/impl/DefaultConfig.h b/vehicle/2.0/default/impl/DefaultConfig.h
index 12c1c1b..85bba2c 100644
--- a/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/vehicle/2.0/default/impl/DefaultConfig.h
@@ -29,20 +29,20 @@
const VehiclePropConfig kVehicleProperties[] = {
{
- .prop = VehicleProperty::INFO_MAKE,
+ .prop = toInt(VehicleProperty::INFO_MAKE),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::STATIC,
},
{
- .prop = VehicleProperty::HVAC_POWER_ON,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas = toInt(VehicleAreaZone::ROW_1)
},
{
- .prop = VehicleProperty::HVAC_DEFROSTER,
+ .prop = toInt(VehicleProperty::HVAC_DEFROSTER),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas =
@@ -51,28 +51,28 @@
},
{
- .prop = VehicleProperty::HVAC_RECIRC_ON,
+ .prop = toInt(VehicleProperty::HVAC_RECIRC_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas = toInt(VehicleAreaZone::ROW_1)
},
{
- .prop = VehicleProperty::HVAC_AC_ON,
+ .prop = toInt(VehicleProperty::HVAC_AC_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas = toInt(VehicleAreaZone::ROW_1)
},
{
- .prop = VehicleProperty::HVAC_AUTO_ON,
+ .prop = toInt(VehicleProperty::HVAC_AUTO_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas = toInt(VehicleAreaZone::ROW_1)
},
{
- .prop = VehicleProperty::HVAC_FAN_SPEED,
+ .prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas = toInt(VehicleAreaZone::ROW_1),
@@ -86,14 +86,14 @@
},
{
- .prop = VehicleProperty::HVAC_FAN_DIRECTION,
+ .prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas = toInt(VehicleAreaZone::ROW_1),
},
{
- .prop = VehicleProperty::HVAC_TEMPERATURE_SET,
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.supportedAreas =
@@ -114,25 +114,25 @@
},
{
- .prop = VehicleProperty::NIGHT_MODE,
+ .prop = toInt(VehicleProperty::NIGHT_MODE),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
{
- .prop = VehicleProperty::DRIVING_STATUS,
+ .prop = toInt(VehicleProperty::DRIVING_STATUS),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
{
- .prop = VehicleProperty::GEAR_SELECTION,
+ .prop = toInt(VehicleProperty::GEAR_SELECTION),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
{
- .prop = VehicleProperty::INFO_FUEL_CAPACITY,
+ .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {
@@ -144,7 +144,7 @@
},
{
- .prop = VehicleProperty::DISPLAY_BRIGHTNESS,
+ .prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {
@@ -156,19 +156,19 @@
},
{
- .prop = VehicleProperty::IGNITION_STATE,
+ .prop = toInt(VehicleProperty::IGNITION_STATE),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
{
- .prop = VehicleProperty::OBD2_LIVE_FRAME,
+ .prop = toInt(VehicleProperty::OBD2_LIVE_FRAME),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
{
- .prop = VehicleProperty::OBD2_FREEZE_FRAME,
+ .prop = toInt(VehicleProperty::OBD2_FREEZE_FRAME),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
}