From 42a26244ad0d1c72b023c5fed4d63aea179906b5 Mon Sep 17 00:00:00 2001 From: Kai Date: Thu, 20 Jun 2019 16:40:22 -0700 Subject: [PATCH] Add Speed_Display_Units property in DefaultHal Update properties for DefaultHal and it is also be a code sample for adding new properties. Bug: 134988550 Test: flash it and verify property by kitchenSink Change-Id: Iedf3ea5b288acfe95b3c676d90660435b34ed367 --- .../2.0/default/impl/vhal_v2_0/DefaultConfig.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 39fe991339..a46de24b16 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 @@ -240,6 +240,17 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {0.0f}}}, + {.config = + { + .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {(int)VehicleUnit::METER_PER_SEC, + (int)VehicleUnit::MILES_PER_HOUR, + (int)VehicleUnit::KILOMETERS_PER_HOUR}, + }, + .initialValue = {.int32Values = {(int)VehicleUnit::KILOMETERS_PER_HOUR}}}, + {.config = { .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT),