From 3c7a832aca00f21b7f687b31044043253daf0edd Mon Sep 17 00:00:00 2001 From: seanhong Date: Mon, 25 Jul 2022 22:43:48 +0000 Subject: [PATCH] Add seat belt properties to the emulator for CTS tests Test: atest CarPropertyManagerTest Bug: 239613431 Change-Id: I5137d64ab3025040f23efe58dbab01dc797923fe --- .../default_config/include/DefaultConfig.h | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index 96d6ab895f..2eb9e6b3c0 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -182,6 +182,68 @@ const std::vector kVehicleProperties = { }, .initialValue = {.int32Values = {toInt(VehicleUnit::KILOWATT_HOUR)}}}, + {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_BUCKLED), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT}, + VehicleAreaConfig{.areaId = SEAT_1_RIGHT}, + VehicleAreaConfig{.areaId = SEAT_2_LEFT}, + VehicleAreaConfig{.areaId = SEAT_2_RIGHT}, + VehicleAreaConfig{.areaId = SEAT_2_CENTER}}}, + .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, + {SEAT_1_RIGHT, {.int32Values = {0}}}, + {SEAT_2_LEFT, {.int32Values = {0}}}, + {SEAT_2_RIGHT, {.int32Values = {0}}}, + {SEAT_2_CENTER, {.int32Values = {0}}}}}, + + {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_HEIGHT_POS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = SEAT_1_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = SEAT_2_LEFT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = SEAT_2_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = SEAT_2_CENTER, + .minInt32Value = 0, + .maxInt32Value = 10}}}, + .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {10}}}, + {SEAT_1_RIGHT, {.int32Values = {10}}}, + {SEAT_2_LEFT, {.int32Values = {10}}}, + {SEAT_2_RIGHT, {.int32Values = {10}}}, + {SEAT_2_CENTER, {.int32Values = {10}}}}}, + + {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_HEIGHT_MOVE), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, + .minInt32Value = -1, + .maxInt32Value = 1}, + VehicleAreaConfig{.areaId = SEAT_1_RIGHT, + .minInt32Value = -1, + .maxInt32Value = 1}, + VehicleAreaConfig{.areaId = SEAT_2_LEFT, + .minInt32Value = -1, + .maxInt32Value = 1}, + VehicleAreaConfig{.areaId = SEAT_2_RIGHT, + .minInt32Value = -1, + .maxInt32Value = 1}, + VehicleAreaConfig{.areaId = SEAT_2_CENTER, + .minInt32Value = -1, + .maxInt32Value = 1}}}, + .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, + {SEAT_1_RIGHT, {.int32Values = {0}}}, + {SEAT_2_LEFT, {.int32Values = {0}}}, + {SEAT_2_RIGHT, {.int32Values = {0}}}, + {SEAT_2_CENTER, {.int32Values = {0}}}}}, + {.config = { .prop = toInt(VehicleProperty::SEAT_OCCUPANCY),